/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:06 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "dsin1.h" #include #include /* PARAMETER translations */ #define CUT 0.125e0 /* end of PARAMETER translations */ double /*FUNCTION*/ dsin1( double x) { long int _l0, m; double dsin1_v, round, s, x2; static long n = -1; /* Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>> 1998-10-29 DSIN1 Krogh Moved external statement up for mangle. *>> 1994-10-20 DSIN1 Krogh Changes to use M77CON *>> 1993-07-21 DSIN1 WV Snyder JPL Original code * * Compute (X - SIN(X)) / X**2. * Use Taylor's series when |X| < CUT (an internal parameter). * Use the intrinsic function otherwise. * *--D replaces "?": ?SIN1 */ if (n < 0) { round = DBL_EPSILON; n = 1; s = 1.0e0; L_10: if (s > round) { s = s*CUT*CUT/((2*n)*(2*n + 1)); n += 1; goto L_10; } } if (fabs( x ) < CUT) { x2 = x*x; m = 2*n; s = 1.0e0 - x2/(m*(m + 1)); L_20: if (m > 4) { m -= 2; s = 1.0e0 - s*x2/(m*(m + 1)); goto L_20; } dsin1_v = s/6.0e0; } else { dsin1_v = (x - sin( x ))/CUBE(x); } return( dsin1_v ); } /* end of function */