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

Go to the documentation of this file.
00001 #include "cdflib.h"
00002 double fpser(double *a,double *b,double *x,double *eps)
00003 /*
00004 -----------------------------------------------------------------------
00005  
00006                  EVALUATION OF I (A,B)
00007                                 X
00008  
00009           FOR B .LT. MIN(EPS,EPS*A) AND X .LE. 0.5.
00010  
00011 -----------------------------------------------------------------------
00012  
00013                   SET  FPSER = X**A
00014 */
00015 {
00016 static int K1 = 1;
00017 static double fpser,an,c,s,t,tol;
00018 /*
00019      ..
00020      .. Executable Statements ..
00021 */
00022     fpser = 1.0e0;
00023     if(*a <= 1.e-3**eps) goto S10;
00024     fpser = 0.0e0;
00025     t = *a*log(*x);
00026     if(t < exparg(&K1)) return fpser;
00027     fpser = exp(t);
00028 S10:
00029 /*
00030                 NOTE THAT 1/B(A,B) = B
00031 */
00032     fpser = *b/ *a*fpser;
00033     tol = *eps/ *a;
00034     an = *a+1.0e0;
00035     t = *x;
00036     s = t/an;
00037 S20:
00038     an += 1.0e0;
00039     t = *x*t;
00040     c = t/an;
00041     s += c;
00042     if(fabs(c) > tol) goto S20;
00043     fpser *= (1.0e0+*a*s);
00044     return fpser;
00045 } /* END */
 

Powered by Plone

This site conforms to the following standards: