Skip to content

Commit

Permalink
correct error in legendre polinomial evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzleucke committed Nov 6, 2024
1 parent 87b81cd commit b99e7b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GX-NAOIntegrals/src/legendre_polynomial.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ subroutine evaluate_legendre_polinomial(n, x, p)
p(1) = 1.0_dp
p(2) = x
do i = 2, n
p(i+1) = (2.0_dp*n-1.0_dp)/dble(n) * x * p(i) - (n-1.0_dp)/dble(n) * p(i-1)
p(i+1) = (2.0_dp*i-1.0_dp)/dble(i) * x * p(i) - (i-1.0_dp)/dble(i) * p(i-1)
end do

end subroutine evaluate_legendre_polinomial
Expand Down Expand Up @@ -67,7 +67,7 @@ subroutine evaluate_legendre_polinomial_batch(n, n_points, x, p)
p(:, 1) = 1.0_dp
p(:, 2) = x(:)
do i = 2, n
p(:, i+1) = (2.0_dp*n-1.0_dp)/dble(n) * x(:) * p(:, i) - (n-1.0_dp)/dble(n) * p(:, i-1)
p(:, i+1) = (2.0_dp*i-1.0_dp)/dble(i) * x(:) * p(:, i) - (i-1.0_dp)/dble(i) * p(:, i-1)
end do

end subroutine evaluate_legendre_polinomial_batch
Expand Down

0 comments on commit b99e7b5

Please sign in to comment.