Skip to content

Commit 7f91f1d

Browse files
committed
changed newton iteration loop indexing (stdlib_quadrature_gauss.f90) in accordance to a review comment
1 parent 29ebe9c commit 7f91f1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stdlib_quadrature_gauss.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pure module subroutine gauss_legendre_fp64 (x, w, interval)
3030
do i = 0, (n+1)/2 - 1
3131
! use Gauss-Chebyshev points as an initial guess
3232
x(i+1) = -cos((2*i+1)/(2._dp*n+2._dp) * pi)
33-
do j = 0, newton_iters-1
33+
do j = 1, newton_iters
3434
leg = legendre(n+1,x(i+1))
3535
dleg = dlegendre(n+1,x(i+1))
3636
delta = -leg/dleg
@@ -87,7 +87,7 @@ pure module subroutine gauss_legendre_lobatto_fp64 (x, w, interval)
8787
do i = 1, (n+1)/2 - 1
8888
! initial guess from an approximate form given by SV Parter (1999)
8989
x(i+1) = -cos( (i+0.25_dp)*pi/n - 3/(8*n*pi*(i+0.25_dp)))
90-
do j = 0, newton_iters-1
90+
do j = 1, newton_iters
9191
leg = legendre(n+1,x(i+1)) - legendre(n-1,x(i+1))
9292
dleg = dlegendre(n+1,x(i+1)) - dlegendre(n-1,x(i+1))
9393
delta = -leg/dleg

0 commit comments

Comments
 (0)