Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
cdf_29.c
Go to the documentation of this file.00001 #include "cdflib.h"
00002 void cumf(double *f,double *dfn,double *dfd,double *cum,double *ccum)
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 {
00051 #define half 0.5e0
00052 #define done 1.0e0
00053 static double dsum,prod,xx,yy;
00054 static int ierr;
00055 static double T1,T2;
00056
00057
00058
00059
00060 if(!(*f <= 0.0e0)) goto S10;
00061 *cum = 0.0e0;
00062 *ccum = 1.0e0;
00063 return;
00064 S10:
00065 prod = *dfn**f;
00066
00067
00068
00069
00070
00071
00072 dsum = *dfd+prod;
00073 xx = *dfd/dsum;
00074 if(xx > half) {
00075 yy = prod/dsum;
00076 xx = done-yy;
00077 }
00078 else yy = done-xx;
00079 T1 = *dfd*half;
00080 T2 = *dfn*half;
00081 bratio(&T1,&T2,&xx,&yy,ccum,cum,&ierr);
00082 return;
00083 #undef half
00084 #undef done
00085 }