PolyC Function

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

Arguments

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

Return Value complex


Called by

proc~~polyc~~CalledByGraph proc~polyc PolyC interface~poly Poly interface~poly->proc~polyc proc~interpolateirc InterpolateIRC proc~interpolateirc->interface~poly

Source Code

  COMPLEX FUNCTION PolyC( x0, x, f, N )

    INTEGER, INTENT( IN ) :: N   ! order of the polynomial
    COMPLEX, INTENT( IN ) :: x0, x( N ), f( N )  ! x, y values of the polynomial
    COMPLEX               :: 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 ) )
             ft( J ) = ft( J ) + h( J ) * ( ft( J )  - ft( J+1 ) ) / &
                  &                       ( h( J+I ) - h(  J   ) )
          END DO
       END DO
    ENDIF

    PolyC = ft( 1 )

  END FUNCTION PolyC