Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

cdf_02.c

Go to the documentation of this file.
00001 #include "cdflib.h"
00002 double alnrel(double *a)
00003 /*
00004 -----------------------------------------------------------------------
00005             EVALUATION OF THE FUNCTION LN(1 + A)
00006 -----------------------------------------------------------------------
00007 */
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 */
 

Powered by Plone

This site conforms to the following standards: