/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:32:03 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "sbesj0.h" #include #include float /*FUNCTION*/ sbesj0( float x) { long int _l0; float ampl, sbesj0_v, theta, y; static float bj0cs[19]={.10025416196893913701073127264074e0,-.66522300776440513177678757831124e0, .24898370349828131370460468726680e0,-.33252723170035769653884341503854e-1, .23114179304694015462904924117729e-2,-.99112774199508092339048519336549e-4, .28916708643998808884733903747078e-5,-.61210858663032635057818407481516e-7, .98386507938567841324768748636415e-9,-.12423551597301765145515897006836e-10, .12654336302559045797915827210363e-12,-.10619456495287244546914817512959e-14, .74706210758024567437098915584000e-17,-.44697032274412780547627007999999e-19, .23024281584337436200523093333333e-21,-.10319144794166698148522666666666e-23, .40608178274873322700800000000000e-26,-.14143836005240913919999999999999e-28, .43910905496698880000000000000000e-31}; static long ntj0 = 0; static float xsml = 0.e0; /* OFFSET Vectors w/subscript range: 1 to dimension */ float *const Bj0cs = &bj0cs[0] - 1; /* end of OFFSET VECTORS */ /* Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>> 1996-03-30 SBESJ0 Krogh Added external statement. *>> 1995-11-10 SBESJ0 Krogh Changed data statment for C converstion. *>> 1995-11-03 SBESJ0 Krogh Removed blanks in numbers for C conversion. *>> 1994-11-11 SBESJ0 Krogh Declared all vars. *>> 1994-10-20 SBESJ0 Krogh Changes to use M77CON *>> 1990-11-29 SBESJ0 CLL *>> 1985-08-02 SBESJ0 Lawson Initial code. * JULY 1977 EDITION. W. FULLERTON, C3, LOS ALAMOS SCIENTIFIC LAB. * C.L.LAWSON & S.CHAN, JPL, 1984 FEB ADAPTED TO JPL MATH77 LIBRARY. * ------------------------------------------------------------------ *--S replaces "?": ?BESJ0, ?BMP0, ?INITS, ?CSEVL * ------------------------------------------------------------------ */ /* SERIES FOR BJ0 ON THE INTERVAL 0. TO 1.60000E+01 * WITH WEIGHTED ERROR 4.39E-32 * LOG WEIGHTED ERROR 31.36 * SIGNIFICANT FIGURES REQUIRED 31.21 * DECIMAL PLACES REQUIRED 32.00 * */ /* ------------------------------------------------------------------ */ if (ntj0 != 0) goto L_10; sinits( bj0cs, 19, 0.1e0*FLT_EPSILON/FLT_RADIX, &ntj0 ); xsml = sqrtf( 4.0e0*FLT_EPSILON/FLT_RADIX ); L_10: y = fabsf( x ); if (y <= xsml) { sbesj0_v = 1.e0; } else if (y <= 4.e0) { sbesj0_v = scsevl( .125e0*y*y - 1.e0, bj0cs, ntj0 ); } else { sbmp0( y, &l, &theta ); sbesj0_v = ampl*cosf( theta ); } return( sbesj0_v ); } /* end of function */