[pypy-issue] Issue #2110: simple euler method example failing to converge (pypy/pypy)

zorg24 issues-reply at bitbucket.org
Fri Aug 7 22:03:46 CEST 2015


New issue 2110: simple euler method example failing to converge
https://bitbucket.org/pypy/pypy/issues/2110/simple-euler-method-example-failing-to

zorg24:

This is a very naive attempt at performing at integrating y'=1/3x^2 over [0,1] with y(0)=0 using Euler's method, however for inc between 0.6e-7 and 1.3e-7 (I didn't try to be any more precise) it is failing to converge on my machine. For other values it runs quite fast as would be expected, also noteworthy is that it runs fine if line 6 is commented out.


```
#!python

def main():
	inc=1e-7
	result=0.0
	i=0.0
	while (i <= 1.0):
		result += inc * (1.0/3.0 * i * i)
		i += inc
	print(result)

main()
```





More information about the pypy-issue mailing list