Line data Source code
1 : MODULE m_diflgr 2 : CONTAINS 3 0 : REAL FUNCTION diflgr(x,f) 4 : c ********************************************************** 5 : c differentiate the function f, 6 : c given at the points x0,x1,x2, 7 : c at the point x1 by lagrange interpolation 8 : c e.wimmer 9 : c *********************************************************** 10 : C .. Array Arguments .. 11 : 12 : IMPLICIT NONE 13 : REAL f(0:2),x(0:2) 14 : C .. 15 : diflgr = (x(1)-x(2))*f(0)/ ((x(0)-x(1))* (x(0)-x(2))) + 16 : + (2.0e0*x(1)-x(2)-x(0))*f(1)/ ((x(1)-x(0))* (x(1)-x(2))) + 17 0 : + (x(1)-x(0))*f(2)/ ((x(2)-x(0))* (x(2)-x(1))) 18 : c print *,'x=',x 19 : c print *,'f=',f 20 : c print *,'diflgr=',diflgr 21 : RETURN 22 : END FUNCTION 23 : END