[Numpy-discussion] Testing for close to zero?
Mon Jan 19 22:17:02 CST 2009
On Mon, Jan 19, 2009 at 22:09, Charles R Harris
> On Mon, Jan 19, 2009 at 7:23 PM, Jonathan Taylor
> <email@example.com> wrote:
>> Interesting. That makes sense and I suppose that also explains why
>> there is no function to do this sort of thing for you.
> A combination of relative and absolute errors is another common solution,
> i.e., test against relerr*max(abs(array_of_inputs)) + abserr. In cases like
> this relerr is typically eps and abserr tends to be something like 1e-12,
> which keeps you from descending towards zero any further than you need to.
I don't think the absolute error term is appropriate in this case. If
all of my inputs are of the size 1e-12, I would expect a result of
1e-14 to be significantly far from 0.
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion