00001 function chebev(a,b,c,m,x) 00002 implicit none 00003 integer :: m, j 00004 real(8) :: a, b, x, c(m) 00005 real(8) :: d, dd, sv, y, y2 00006 real(8) :: chebev 00007 if ((x-a)*(x-b).gt.0.0d0) stop 'x not in range in chebev' 00008 d = 0.0d0 00009 dd = 0.0d0 00010 y =(2.0d0*x-a-b)/(b-a) 00011 y2 = 2.0d0*y 00012 do j = m, 2, -1 00013 sv = d 00014 d = y2*d-dd+c(j) 00015 dd = sv 00016 end do 00017 chebev = y*d - dd + 0.5d0*c(1) 00018 return 00019 end function chebev 00020 !