/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:10 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "smpval.h" #include float /*FUNCTION*/ smpval( float p[], long ndeg, float x) { long int j; float smpval_v, u; /* OFFSET Vectors w/subscript range: 1 to dimension */ float *const P = &p[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. *>> 1994-10-20 SMPVAL Krogh Changes to use M77CON *>> 1994-04-20 SMPVAL CLL Making DP and SP versions similar. *>> 1987-12-09 SMPVAL Lawson Initial code. * Evaluation of polynomial using monomial basis and a * linear transformation of the argument. * C.L.LAWSON, JPL, 1974 NOV 19 * ------------------------------------------------------------------ *--S replaces "?": ?MPVAL * ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */ smpval_v = 0.0e0; u = (x - P[1])/P[2]; for (j = ndeg; j >= 0; j--) { smpval_v = smpval_v*u + P[j + 3]; } return( smpval_v ); } /* end of function */