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_38.c

Go to the documentation of this file.
00001 #include "cdflib.h"
00002 double dexpm1(double *x)
00003 /*
00004 **********************************************************************
00005  
00006      double dexpm1(double *x)
00007             Evaluation of the function EXP(X) - 1
00008  
00009  
00010                               Arguments
00011  
00012  
00013      X --> Argument at which exp(x)-1 desired
00014                     DOUBLE PRECISION X
00015  
00016  
00017                               Method
00018  
00019  
00020      Renaming of function rexp from code of:
00021  
00022      DiDinato, A. R. and Morris,  A.   H.  Algorithm 708: Significant
00023      Digit Computation of the Incomplete  Beta  Function Ratios.  ACM
00024      Trans. Math.  Softw. 18 (1993), 360-373.
00025  
00026 **********************************************************************
00027 */
00028 {
00029 static double p1 = .914041914819518e-09;
00030 static double p2 = .238082361044469e-01;
00031 static double q1 = -.499999999085958e+00;
00032 static double q2 = .107141568980644e+00;
00033 static double q3 = -.119041179760821e-01;
00034 static double q4 = .595130811860248e-03;
00035 static double dexpm1,w;
00036 /*
00037      ..
00038      .. Executable Statements ..
00039 */
00040     if(fabs(*x) > 0.15e0) goto S10;
00041     dexpm1 = *x*(((p2**x+p1)**x+1.0e0)/((((q4**x+q3)**x+q2)**x+q1)**x+1.0e0));
00042     return dexpm1;
00043 S10:
00044     w = exp(*x);
00045     if(*x > 0.0e0) goto S20;
00046     dexpm1 = w-0.5e0-0.5e0;
00047     return dexpm1;
00048 S20:
00049     dexpm1 = w*(0.5e0+(0.5e0-1.0e0/w));
00050     return dexpm1;
00051 } /* END */
 

Powered by Plone

This site conforms to the following standards: