PolyZ Function

public function PolyZ(x0, x, f, N)

Arguments

Type IntentOptional Attributes Name
complex(kind=8), intent(in) :: x0
complex(kind=8), intent(in) :: x(N)
complex(kind=8), intent(in) :: f(N)
integer, intent(in) :: N

Return Value complex(kind=8)


Called by

proc~~polyz~~CalledByGraph proc~polyz PolyZ interface~poly Poly interface~poly->proc~polyz proc~interpolateirc InterpolateIRC proc~interpolateirc->interface~poly

Source Code

  FUNCTION PolyZ( x0, x, F, N )

    INTEGER,            INTENT( IN ) :: N  ! order of the polynomial
    COMPLEX ( KIND=8 ), INTENT( IN ) :: x0, x( N ), f( N ) ! x, y values of the polynomial
    COMPLEX ( KIND=8 )    :: PolyZ
    COMPLEX ( KIND=8 )    :: fT( N ), h( N )

    ! Initialize arrays
    h  = x - x0
    fT = f

    ! Recursion for solution
    IF ( N >= 2 ) THEN
       DO i = 1, N - 1
          DO j = 1, N - i
             fT( j ) = ( h( j + i ) * fT( j ) - h( j ) * fT( j + 1 ) ) / ( h( j + i ) - h( j ) )
          END DO
       END DO
    ENDIF
    PolyZ = fT( 1 )

  END FUNCTION PolyZ