horner Subroutine

private pure subroutine horner(B, c, BB)

Horner's method to compute B(x-c) in terms of B(x).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(0:6) :: B

Polynomial B = B(6) x^6 + B(5) x^5 + ... + B(0)

real(kind=wp), intent(in) :: c
real(kind=wp), intent(out), dimension(0:6) :: BB

Polynomial BB such that B(x-c) = BB(x)


Called by

proc~~horner~~CalledByGraph proc~horner geodesy_module::horner proc~cartesianintogeodetici geodesy_module::CartesianIntoGeodeticI proc~cartesianintogeodetici->proc~horner

Source Code

pure subroutine horner(B, c, BB)

  real(wp),dimension(0:6),intent(in) :: B !! Polynomial `B = B(6) x^6 + B(5) x^5 + ... + B(0)`
  real(wp),intent(in) :: c
  real(wp),dimension(0:6),intent(out) :: BB !! Polynomial `BB` such that `B(x-c) = BB(x)`

  integer :: i,j !! counters

  BB = B

  do i = 0,6
    do j = 5,i,-1
      BB(j) = BB(j) - BB(j+1)*c
    end do
  end do

end subroutine horner