rcond in polyfit

Tim Hochberg tim.hochberg at ieee.org
Sat Oct 14 19:26:30 CDT 2006


Charles R Harris wrote:
>
>
> On 10/14/06, *A. M. Archibald* <peridot.faceted at gmail.com 
> <mailto:peridot.faceted at gmail.com>> wrote:
[SNIP]
>
>
> Hmmm, I wonder if we have a dictionary of precisions indexed by dtype 
> somewhere?

Here's some code I stole from somewhere for computing EPS. It would easy 
enough to generate the dictionary you are looking for at startup using 
this. I can't recall the pedigree of this code though, so caveat emptor:

    def bits_of_precision(dtype):
        one = np.array([1], dtype)
        i = 0
        while not np.alltrue(one + (one / 2.**i) == one):
            i += 1
        return i - 1
       
       
    EPSS = 1.0  / 2**bits_of_precision(float) * 10 # XXX safety factor


It's sorta old and translated from numpy too, so it could probably be 
rewritten in better style.

-tim


>  
[SNIP]




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Numpy-discussion mailing list