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

Go to the documentation of this file.
00001 #include "cdflib.h"
00002 double dlanor(double *x)
00003 /*
00004 **********************************************************************
00005  
00006      double dlanor(double *x)
00007            Double precision Logarith of the Asymptotic Normal
00008  
00009  
00010                               Function
00011  
00012  
00013       Computes the logarithm of the cumulative normal distribution
00014       from abs( x ) to infinity for abs( x ) >= 5.
00015  
00016  
00017                               Arguments
00018  
00019  
00020       X --> Value at which cumulative normal to be evaluated
00021                      DOUBLE PRECISION X
00022  
00023  
00024                               Method
00025  
00026  
00027       23 term expansion of formula 26.2.12 of Abramowitz and Stegun.
00028       The relative error at X = 5 is about 0.5E-5.
00029  
00030  
00031                               Note
00032  
00033  
00034       ABS(X) must be >= 5 else there is an error stop.
00035  
00036 **********************************************************************
00037 */
00038 {
00039 #define dlsqpi 0.91893853320467274177e0
00040 static double coef[12] = {
00041     -1.0e0,3.0e0,-15.0e0,105.0e0,-945.0e0,10395.0e0,-135135.0e0,2027025.0e0,
00042     -34459425.0e0,654729075.0e0,-13749310575.e0,316234143225.0e0
00043 };
00044 static int K1 = 12;
00045 static double dlanor,approx,correc,xx,xx2,T2;
00046 /*
00047      ..
00048      .. Executable Statements ..
00049 */
00050     xx = fabs(*x);
00051     if(xx < 5.0e0) ftnstop(" Argument too small in DLANOR");
00052     approx = -dlsqpi-0.5e0*xx*xx-log(xx);
00053     xx2 = xx*xx;
00054     T2 = 1.0e0/xx2;
00055     correc = devlpl(coef,&K1,&T2)/xx2;
00056     correc = dln1px(&correc);
00057     dlanor = approx+correc;
00058     return dlanor;
00059 #undef dlsqpi
00060 } /* END */
 

Powered by Plone

This site conforms to the following standards: