On Jun 3, 2009, at 4:42 AM, Dag Sverre Seljebotn wrote:

> Robert Bradshaw wrote:
>>  From before, relative errors for the naive vs. other algorithm,
>> 100000 runs, uniformly chosen in unit square (though nearly all
>> distributions look basically the same):
>>
>> naive
>>      better 26187
>>      avg 1.4940916064705992895601085724e-16
>>      worst 5.7659574333851360909896621025e-16
>> other
>>      better 63116
>>      avg 9.5414951065097745299683547276e-17
>>      worst 3.9584519821557590591785765975e-16
>>
>> - Robert
>>
>
> This is not my speciality, but since the problem here is with things
> like fp cancellation on subtraction etc., wouldn't it be better to
> increase the odds of wildly different values?
>
> Something like exp(uniform square)?

I did exp(X) + exp(X)*I where X was a uniform distribution on  
[-10,10] and various other distributions, all yielded very similar  
results (which was actually surprising to me).

Any thoughts on the 4x speed difference?

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to