File: poly.c

package info (click to toggle)
gsl 0.5-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 8,804 kB
  • ctags: 6,343
  • sloc: ansic: 89,342; sh: 7,749; makefile: 882; perl: 37
file content (17 lines) | stat: -rw-r--r-- 442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Author:  G. Jungman
 * RCS:     $Id: poly.c,v 1.4 1998/11/18 00:47:03 bjg Exp $
 */
#include <config.h>
#include "gsl_sf_poly.h"


/*-*-*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*-*/

/* checked OK [GJ] Tue May  5 12:19:56 MDT 1998 */
double gsl_sf_poly_eval(const double c[], const int len, const double x)
{
  int i;
  double ans = c[len-1];
  for(i=len-1; i>0; i--) ans = c[i-1] + x * ans;
  return ans;
}