x[0] == 45000.0, x[1] == 45010.0, ... x[999] == 54990.0

and

y[0] == 0.0 y[1] == 2.0, ..., y[9999] == 19998.0

while the latter results in

X(1) == 55000.0, X(2) == 45010.0, X(3) == 45020.0, ..., X(1000) == 54990.0

and

Y(1) == 2.0, Y(2) == 4.0, ..., Y(10000) == 20000.0.

The Fortran version could be made consistent with the C/C++ version by changing lines 23-24 from

- Code: Select all
`X(INDEX(I)) = X(INDEX(I)) + WORK1(I)`

Y(I) = Y(I) + WORK2(I)

to

- Code: Select all
`X(INDEX(I)) = X(INDEX(I)) + WORK1(I-1)`

Y(I) = Y(I) + WORK2(I-1)

and line 35 from

- Code: Select all
`INDEX(I) = MOD(I, 1000) + 1`

to

- Code: Select all
`INDEX(I) = MOD(I-1, 1000) + 1`