Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
cdf_70.c
Go to the documentation of this file.00001 #include "cdflib.h"
00002 double rlog1(double *x)
00003
00004
00005
00006
00007
00008 {
00009 static double a = .566749439387324e-01;
00010 static double b = .456512608815524e-01;
00011 static double p0 = .333333333333333e+00;
00012 static double p1 = -.224696413112536e+00;
00013 static double p2 = .620886815375787e-02;
00014 static double q1 = -.127408923933623e+01;
00015 static double q2 = .354508718369557e+00;
00016 static double rlog1,h,r,t,w,w1;
00017
00018
00019
00020
00021 if(*x < -0.39e0 || *x > 0.57e0) goto S40;
00022 if(*x < -0.18e0) goto S10;
00023 if(*x > 0.18e0) goto S20;
00024
00025
00026
00027 h = *x;
00028 w1 = 0.0e0;
00029 goto S30;
00030 S10:
00031 h = *x+0.3e0;
00032 h /= 0.7e0;
00033 w1 = a-h*0.3e0;
00034 goto S30;
00035 S20:
00036 h = 0.75e0**x-0.25e0;
00037 w1 = b+h/3.0e0;
00038 S30:
00039
00040
00041
00042 r = h/(h+2.0e0);
00043 t = r*r;
00044 w = ((p2*t+p1)*t+p0)/((q2*t+q1)*t+1.0e0);
00045 rlog1 = 2.0e0*t*(1.0e0/(1.0e0-r)-r*w)+w1;
00046 return rlog1;
00047 S40:
00048 w = *x+0.5e0+0.5e0;
00049 rlog1 = *x-log(w);
00050 return rlog1;
00051 }