Doxygen Source Code Documentation
cdf_02.c File Reference
#include "cdflib.h"Go to the source code of this file.
Functions | |
| double | alnrel (double *a) |
Function Documentation
|
|
Definition at line 2 of file cdf_02.c. Referenced by algdiv(), alnrel(), betaln(), bgrat(), brcmp1(), brcomp(), dlnbet(), gaminv(), and gsumln().
00008 {
00009 static double p1 = -.129418923021993e+01;
00010 static double p2 = .405303492862024e+00;
00011 static double p3 = -.178874546012214e-01;
00012 static double q1 = -.162752256355323e+01;
00013 static double q2 = .747811014037616e+00;
00014 static double q3 = -.845104217945565e-01;
00015 static double alnrel,t,t2,w,x;
00016 /*
00017 ..
00018 .. Executable Statements ..
00019 */
00020 if(fabs(*a) > 0.375e0) goto S10;
00021 t = *a/(*a+2.0e0);
00022 t2 = t*t;
00023 w = (((p3*t2+p2)*t2+p1)*t2+1.0e0)/(((q3*t2+q2)*t2+q1)*t2+1.0e0);
00024 alnrel = 2.0e0*t*w;
00025 return alnrel;
00026 S10:
00027 x = 1.e0+*a;
00028 alnrel = log(x);
00029 return alnrel;
00030 } /* END */
|