I'm generating a module that calculates the Legendre polynomials but once I reach to ˋP4(x)ˋ I start getting 0 as output.
For instance ˋP4(x) = 1/8 * (35x^4 - 30x^2 +3)ˋ
So I've decided to make the following program in order to check any possible mistake.
real (kind = 8) :: x,y
integer :: i
y = 0.0, x = -1.0
do i = 1, 30
y = ((1/8)*((35*(x**4))-(30*(x**2))+3)
write (6,*) y
cont = cont + 0.066
end do
The output of this program is always the same 0.000000
Surprisingly, it shows the changes of sign but it still displays -0.000000.