qofs Function

public pure elemental function qofs(f0, fp0, f1, fp1, dels, s) result(res)

This function computes the Hermite cubic interpolant at a point s.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: f0

Function value at the start of the interval.

real(kind=dp), intent(in) :: fp0

Derivative value at the start of the interval.

real(kind=dp), intent(in) :: f1

Function value at the end of the interval.

real(kind=dp), intent(in) :: fp1

Derivative value at the end of the interval.

real(kind=dp), intent(in) :: dels

Width of the interpolation interval.

real(kind=dp), intent(in) :: s

Local coordinate of the interpolation point to the start.

Return Value real(kind=dp)


Called by

proc~~qofs~~CalledByGraph proc~qofs qofs proc~rootnf rootnf proc~rootnf->proc~qofs proc~stepnf stepnf proc~stepnf->proc~qofs proc~fixpnf fixpnf proc~fixpnf->proc~rootnf proc~fixpnf->proc~stepnf proc~nf_solver_solve nf_solver%nf_solver_solve proc~nf_solver_solve->proc~fixpnf

Source Code

   elemental pure function qofs(f0, fp0, f1, fp1, dels, s) result(res)
   !! This function computes the Hermite cubic interpolant at a point `s`.

      real(dp), intent(in) :: f0
         !! Function value at the start of the interval.
      real(dp), intent(in) :: fp0
         !! Derivative value at the start of the interval.
      real(dp), intent(in) :: f1
         !! Function value at the end of the interval.
      real(dp), intent(in) :: fp1
         !! Derivative value at the end of the interval.
      real(dp), intent(in) :: dels
         !! Width of the interpolation interval.
      real(dp), intent(in) :: s
         !! Local coordinate of the interpolation point to the start.
      real(dp) :: res

      real(dp) :: dd01, dd001, dd011, dd0011

      ! Calculate divided differences sequentially
      dd01 = (f1 - f0)/dels
      dd001 = (dd01 - fp0)/dels
      dd011 = (fp1 - dd01)/dels
      dd0011 = (dd011 - dd001)/dels

      ! Evaluate the cubic polynomial using Horner's method
      res = ((dd0011*(s - dels) + dd001)*s + fp0)*s + f0

   end function qofs