Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
cdf_68.c
Go to the documentation of this file.00001 #include "cdflib.h"
00002 double rexp(double *x)
00003
00004
00005
00006
00007
00008 {
00009 static double p1 = .914041914819518e-09;
00010 static double p2 = .238082361044469e-01;
00011 static double q1 = -.499999999085958e+00;
00012 static double q2 = .107141568980644e+00;
00013 static double q3 = -.119041179760821e-01;
00014 static double q4 = .595130811860248e-03;
00015 static double rexp,w;
00016
00017
00018
00019
00020 if(fabs(*x) > 0.15e0) goto S10;
00021 rexp = *x*(((p2**x+p1)**x+1.0e0)/((((q4**x+q3)**x+q2)**x+q1)**x+1.0e0));
00022 return rexp;
00023 S10:
00024 w = exp(*x);
00025 if(*x > 0.0e0) goto S20;
00026 rexp = w-0.5e0-0.5e0;
00027 return rexp;
00028 S20:
00029 rexp = w*(0.5e0+(0.5e0-1.0e0/w));
00030 return rexp;
00031 }