chebev_v Function

function chebev_v(a, b, c, x)

Uses

  • proc~~chebev_v~~UsesGraph proc~chebev_v chebev_v module~nrutil nrutil proc~chebev_v->module~nrutil module~nrtype nrtype proc~chebev_v->module~nrtype module~nrutil->module~nrtype

Arguments

Type IntentOptional AttributesName
real(kind=SP), intent(in) :: a
real(kind=SP), intent(in) :: b
real(kind=SP), intent(in), DIMENSION(:):: c
real(kind=SP), intent(in), DIMENSION(:):: x

Return Value real(kind=SP), DIMENSION(size(x))


Contents

Source Code


Source Code

FUNCTION chebev_v(a,b,c,x)
	USE nrtype; USE nrutil, ONLY : nrerror
	IMPLICIT NONE
	REAL(SP), INTENT(IN) :: a,b
	REAL(SP), DIMENSION(:), INTENT(IN) :: c,x
	REAL(SP), DIMENSION(size(x)) :: chebev_v
	INTEGER(I4B) :: j,m
	REAL(SP), DIMENSION(size(x)) :: d,dd,sv,y,y2
	if (any((x-a)*(x-b) > 0.0)) call nrerror('x not in range in chebev_v')
	m=size(c)
	d=0.0
	dd=0.0
	y=(2.0_sp*x-a-b)/(b-a)
	y2=2.0_sp*y
	do j=m,2,-1
		sv=d
		d=y2*d-dd+c(j)
		dd=sv
	end do
	chebev_v=y*d-dd+0.5_sp*c(1)
END FUNCTION chebev_v