[SciPy-dev] Problem with flapack
Pearu Peterson
pearu at cens.ioc.ee
Fri Feb 15 15:27:57 CST 2002
On Fri, 15 Feb 2002, eric wrote:
> > >>> s.poly(s.roots([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])).real
> > array([ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11.,
> > 12., 13., 14., 15., 16., 17., 18., 19., 20.])
>
> Sure, but I agree with Heiko that tiny zeros should be detected internally and
> cleaned up automatically.
I hope that you don't mean that in general!!!
I have applications where very tiny numbers have all 15 digits exact and
it is crucial that these tiny numbers will not be zerod.
Here is an example of calculating the amplitude of a cnoidal wave:
>>> import math
>>> from soliton.cnoidal import theta
>>> print theta(math.pi,.01,der=2)/theta(math.pi,.01,der=0)
[ 98596.04401089]
^^^^^^^^^^^^^^^^^ - this is exact (well, almost, all shown digits
are exact). But note that this is found from a ratio of _very_ tiny
numbers:
>>> print theta(math.pi,.01,der=0)
[ 2.42316748e-213]
>>> print theta(math.pi,.01,der=2)
[ 2.38914727e-208]
So, please please please, let us not make scipy too clever based on purely
cosmetic reasons.
Pearu
More information about the Scipy-dev
mailing list