This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / MINICERN / mathlib / gen / e / chsum64.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1996/04/01 15:02:29  mclareni
6 * Mathlib gen
7 *
8 *
9 #include "gen/pilot.h"
10 #if !defined(CERNLIB_DOUBLE)
11       FUNCTION  CHSUM(MODE,C,N,X)
12 #endif
13 #if defined(CERNLIB_DOUBLE)
14       FUNCTION DCHSUM(MODE,C,N,X)
15 #endif
16 #include "gen/imp64.inc"
17       DIMENSION C(0:N)
18
19       IF(MODE .EQ. 1) THEN
20        H=X
21        F=H
22        V=1
23       ELSE IF(MODE .EQ. 2) THEN
24        H=2*X**2-1
25        F=H
26        V=1
27       ELSE IF(MODE .EQ. 3) THEN
28        H=2*X**2-1
29        F=1
30        V=X
31       ELSE IF(MODE .EQ. 4) THEN
32        H=2*X-1
33        F=H
34        V=1
35       END IF
36
37       ALFA=H+H
38       B1=0
39       B2=0
40       DO 1 I = N,0,-1
41       B0=C(I)+ALFA*B1-B2
42       B2=B1
43     1 B1=B0
44 #if !defined(CERNLIB_DOUBLE)
45        CHSUM=V*(B0-F*B2)
46 #endif
47 #if defined(CERNLIB_DOUBLE)
48       DCHSUM=V*(B0-F*B2)
49 #endif
50       RETURN
51       END