6 real(8) function splint(n,x,f)
9 integer,
intent(in) :: n
10 real(8),
intent(in) :: x(n),f(n)
13 real(8) x0,x1,x2,x3,y0,y1,y2,y3
14 real(8) t0,t1,t2,t3,t4,t5,t6,t7
16 real(8),
external ::
polynm 23 x1=x(2)-x0; x2=x(3)-x0; x3=x(4)-x0
24 t4=x1-x2; t5=x1-x3; t6=x2-x3
26 y1=f(2)-y0; y2=f(3)-y0; y3=f(4)-y0
27 t1=x1*x2*y3; t2=x2*x3*y1; t3=x1*x3
28 t0=0.5d0/(t3*t4*t5*t6)
31 t4=x1**2; t5=x2**2; t6=x3**2
32 y1=t3*t6-t1*t5; y3=t2*t5-t3*t4; y2=t1*t4-t2*t6
35 splint=x2*(y0+t0*(t1+x2*(0.5d0*t7*x2-0.6666666666666666667d0*t2)))
38 x1=x(i-1)-x0; x2=x(i+1)-x0; x3=x(i+2)-x0
39 t4=x1-x2; t5=x1-x3; t6=x2-x3; t3=x1*x3
41 y1=f(i-1)-y0; y2=f(i+1)-y0; y3=f(i+2)-y0
42 t1=x1*x2*y3; t2=x2*x3*y1
43 t0=0.5d0/(t3*t4*t5*t6)
46 t4=x1**2; t5=x2**2; t6=x3**2
47 y1=t3*t6-t1*t5; y2=t1*t4-t2*t6; y3=t2*t5-t3*t4
50 splint=
splint+x2*(y0+t0*(t1+x2*(0.5d0*t7*x2-0.6666666666666666667d0*t2)))
53 x1=x(n-3)-x0; x2=x(n-1)-x0; x3=x(n)-x0
54 t4=x1-x2; t5=x1-x3; t6=x2-x3
56 y1=f(n-3)-y0; y2=f(n-1)-y0; y3=f(n)-y0
57 t1=x1*x2; t2=x2*x3*y1; t3=x1*x3*y2
58 t0=0.5d0/(t1*t4*t5*t6)
61 t4=x1**2; t5=x2**2; t6=x3**2
62 y1=t3*t6-t1*t5; y2=t1*t4-t2*t6; y3=t2*t5-t3*t4
65 splint=
splint+x3*(y0+t0*(t1+x3*(0.5d0*t7*x3-0.6666666666666666667d0*t2)))
real(8) function splint(n, x, f)
pure real(8) function polynm(m, np, xa, ya, x)