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

Go to the documentation of this file.
00001 #include "cdflib.h"
00002 double bcorr(double *a0,double *b0)
00003 /*
00004 -----------------------------------------------------------------------
00005  
00006      EVALUATION OF  DEL(A0) + DEL(B0) - DEL(A0 + B0)  WHERE
00007      LN(GAMMA(A)) = (A - 0.5)*LN(A) - A + 0.5*LN(2*PI) + DEL(A).
00008      IT IS ASSUMED THAT A0 .GE. 8 AND B0 .GE. 8.
00009  
00010 -----------------------------------------------------------------------
00011 */
00012 {
00013 static double c0 = .833333333333333e-01;
00014 static double c1 = -.277777777760991e-02;
00015 static double c2 = .793650666825390e-03;
00016 static double c3 = -.595202931351870e-03;
00017 static double c4 = .837308034031215e-03;
00018 static double c5 = -.165322962780713e-02;
00019 static double bcorr,a,b,c,h,s11,s3,s5,s7,s9,t,w,x,x2;
00020 /*
00021      ..
00022      .. Executable Statements ..
00023 */
00024     a = fifdmin1(*a0,*b0);
00025     b = fifdmax1(*a0,*b0);
00026     h = a/b;
00027     c = h/(1.0e0+h);
00028     x = 1.0e0/(1.0e0+h);
00029     x2 = x*x;
00030 /*
00031                 SET SN = (1 - X**N)/(1 - X)
00032 */
00033     s3 = 1.0e0+(x+x2);
00034     s5 = 1.0e0+(x+x2*s3);
00035     s7 = 1.0e0+(x+x2*s5);
00036     s9 = 1.0e0+(x+x2*s7);
00037     s11 = 1.0e0+(x+x2*s9);
00038 /*
00039                 SET W = DEL(B) - DEL(A + B)
00040 */
00041     t = pow(1.0e0/b,2.0);
00042     w = ((((c5*s11*t+c4*s9)*t+c3*s7)*t+c2*s5)*t+c1*s3)*t+c0;
00043     w *= (c/b);
00044 /*
00045                    COMPUTE  DEL(A) + W
00046 */
00047     t = pow(1.0e0/a,2.0);
00048     bcorr = (((((c5*t+c4)*t+c3)*t+c2)*t+c1)*t+c0)/a+w;
00049     return bcorr;
00050 } /* END */
 

Powered by Plone

This site conforms to the following standards: