hankel2_n_derivative Function

private function hankel2_n_derivative(n, x) result(der)

Compute derivative for Hankel function of second kind of order n.

Arguments

Type IntentOptional Attributes Name
integer :: n

The order of the function.

real(kind=rk), intent(in) :: x

The evaluation point.

Return Value complex(kind=rk)

The function value.


Source Code

  function hankel2_n_derivative(n,x) result(der)
    ! --------------------------------------------------------------------------
    !> The order of the function.
    integer :: n
    !> The evaluation point.
    real(kind=rk), intent(in) :: x
    !> The function value.
    complex(kind=rk) :: der
    ! --------------------------------------------------------------------------
    ! --------------------------------------------------------------------------

    ! Calculate the derivative by recursive relation
    der = 0.5_rk*( hankel2_n(n-1,x)-hankel2_n(n+1,x) )

  end function hankel2_n_derivative