/* RCS $Id: j_ex10.c,v 1.3 1997/07/15 14:57:04 ae13 Exp $ */
/*
$Log: j_ex10.c,v $
 * Revision 1.3  1997/07/15  14:57:04  ae13
 * *** empty log message ***
 *
 * Revision 1.2  1997/07/09  09:22:48  ae13
 * *** empty log message ***
 *
 * Revision 1.1  1997/05/16  13:26:20  ae13
 * Initial revision
 *
 */
/****************************************************************/
/*                                                              */
/*      Entries         : a_intv j_ex10(a_intv x)               */
/*                        a_intv x  ;                           */
/*                                                              */
/*      Arguments       : x = interval argument of ex10(x)      */
/*                                                              */
/*      Description     : Fast interval exponential             */
/*                        function for double IEEE              */
/*                        Floating-Point Arithmetic             */
/*                                                              */
/*      Date            : 1997-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_ex10(a_intv x)
#else
local a_intv j_ex10(x)

a_intv x;
#endif
{
 a_intv res;
  if (x.INF==x.SUP)                  /* point interval */
    { 
      if ((x.INF>=0) && (x.INF<=22) && (CUTINT(x.INF)==x.INF))
        {  
          res.INF=q_ex10(x.INF);
          res.SUP=res.INF;
        }
      else if (x.INF<=q_extn)
        { 
          res.INF=0.0;
          res.SUP=q_minr;
        }
      else 
        { 
          res.INF=q_ex10(x.INF);
          res.SUP=res.INF*q_e10p;
          res.INF*=q_e10m;
        }
    }
  else
    {
      if (x.INF<=q_extn) 
        res.INF=0.0;
      else if ((CUTINT(x.INF)==x.INF) && (x.INF>=0) && (x.INF<=22))
        res.INF=q_ex10(x.INF);
      else
        res.INF=q_ex10(x.INF)*q_e10m;
      if (x.SUP<=q_extn)
        res.SUP=q_minr;
      else if ((CUTINT(x.SUP)==x.SUP) && (x.SUP>=0) && (x.SUP<=22))
        res.SUP=q_ex10(x.SUP);
      else  
        res.SUP=q_ex10(x.SUP)*q_e10p;
    }   
  if (res.INF<0.0) res.INF=0.0;
  if ((x.SUP<=0.0) && (res.SUP>1.0)) res.SUP=1.0;
  if ((x.INF>=0.0) && (res.INF<1.0)) res.INF=1.0;

 return(res);
}
