chebev_s Function

function chebev_s(a, b, c, x)

Uses

  • proc~~chebev_s~~UsesGraph proc~chebev_s chebev_s module~nrutil nrutil proc~chebev_s->module~nrutil module~nrtype nrtype proc~chebev_s->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) :: x

Return Value real(kind=SP)


Contents

Source Code


Source Code

FUNCTION chebev_s(a,b,c,x)
	USE nrtype; USE nrutil, ONLY : nrerror
	IMPLICIT NONE
	REAL(SP), INTENT(IN) :: a,b,x
	REAL(SP), DIMENSION(:), INTENT(IN) :: c
	REAL(SP) :: chebev_s
	INTEGER(I4B) :: j,m
	REAL(SP) :: d,dd,sv,y,y2
	if ((x-a)*(x-b) > 0.0) call nrerror('x not in range in chebev_s')
	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_s=y*d-dd+0.5_sp*c(1)
END FUNCTION chebev_s