/* RCS $Id: j_log.c,v 1.2 1997/07/15 14:57:04 ae13 Exp $ */
/*
$Log: j_log.c,v $
 * Revision 1.2  1997/07/15  14:57:04  ae13
 * *** empty log message ***
 *
 * Revision 1.1  1997/05/16  13:26:20  ae13
 * Initial revision
 *
 */
/****************************************************************/
/*                                                              */
/*      Entries         : a_intv j_log(a_intv x)                */
/*                        a_intv x  ;                           */
/*                                                              */
/*      Arguments       : x = interval argument of log(x)       */
/*                                                              */
/*      Description     : Fast interval logarithm function      */
/*                        for double IEEE Floating-Point        */
/*                        Arithmetic                            */
/*                                                              */
/*      Date            : 1996-03-08                            */
/*                                                              */
/*      Author          : W. Hofschuster                        */
/*                                                              */
/****************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif

#include "q_defs.h"
#include "q_fcth.h"

#ifdef LINT_ARGS
local a_intv j_log(a_intv x)
#else
local a_intv j_log(x)

a_intv x;
#endif
{
  a_intv res;
  if (x.INF==x.SUP)                  /* point interval */
    { 
      res.INF=q_log(x.INF);
      if (res.INF>=0) 
        {
          res.SUP=res.INF*q_logp;
          res.INF*=q_logm;
        }
      else
        {
          res.SUP=res.INF*q_logm;
          res.INF*=q_logp;
        }
    }
  else
    {
      res.INF=q_log(x.INF);
      if (res.INF>=0)
        res.INF*=q_logm;
      else
        res.INF*=q_logp;
      res.SUP=q_log(x.SUP);
      if (res.SUP>=0)
        res.SUP*=q_logp;
      else
        res.SUP*=q_logm;
    }   
  return(res);
}

