JensGrabner / mpmath-2

Automatically exported from code.google.com/p/mpmath
Other
3 stars 0 forks source link

Laguerre problem #230

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run
import mpmath as mp
mp.laguerre(1,99,100.0)

What is the expected output? What do you see instead?
It should give zero. It produces error.

What version of the product are you using? On what operating system?
Mac OS 10.8, Linux Mint, mpmath 0.17 with gmpy

Please provide any additional information below.

Original issue reported on code.google.com by D.Vutshi on 23 Nov 2012 at 2:20

GoogleCodeExporter commented 9 years ago
I get:

    ValueError: hypsum() failed to converge to the requested 73 bits of accuracy
    using a working precision of 3588 bits. Try with a higher maxprec,
    maxterms, or set zeroprec.

This is expected, because the zero is nontrivial and cannot be detected by the 
numerical algorithm. As the output suggests, you can force it to return 0 by 
passing zeroprec:

>>> mp.laguerre(1, 99, 100, zeroprec=1000)   
mpf('0.0')

Original comment by fredrik....@gmail.com on 23 Nov 2012 at 2:38

GoogleCodeExporter commented 9 years ago
I see, sorry for false alarm :)

Original comment by D.Vutshi on 23 Nov 2012 at 2:56