/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:11 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "ssin1.h" #include #include /* PARAMETER translations */ #define CUT 0.125e0 /* end of PARAMETER translations */ float /*FUNCTION*/ ssin1( float x) { long int _l0, m; float round, s, ssin1_v, 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 SSIN1 Krogh Moved external statement up for mangle. *>> 1994-10-20 SSIN1 Krogh Changes to use M77CON *>> 1993-07-21 SSIN1 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. * *--S replaces "?": ?SIN1 */ if (n < 0) { round = FLT_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 (fabsf( 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; } ssin1_v = s/6.0e0; } else { ssin1_v = (x - sinf( x ))/CUBE(x); } return( ssin1_v ); } /* end of function */