From: Raymond T. <toy...@gm...> - 2014-09-22 16:57:36
|
>>>>> "Volker" == Volker van Nek <vol...@gm...> writes: Volker> Am 20.09.2014 22:53, schrieb Raymond Toy: >> >> Ok. I haven't looked at your code yet, but if they're significantly faster >> and not (much) less accurate, we should consider adding these. I'm sure we >> can come up with a nice set of tests to cover the code to show that it's >> good. >> Volker> I made some timing measurements and to summarize the results I have to Volker> say that these algorithms are only of interest if you want to use Volker> precisions of $fpprec > 1000 and (much) higher. In "normal" ranges, i.e. Volker> 16 <= $fpprec <= let's say 100, they are generally much slower. Volker> The accuracy depends on the binary representation of the argument. A Volker> simple argument like 0.5b0 results in slightly better accuracy but e.g. Volker> bs_sin(bs_asin(0.5b0)) leads to significantly worse results compared to Volker> sin(asin(0.5b0)) . Volker> fpprec:30$ Volker> x:0.5b0$ Volker> asin(x); --> 5.23598775598298873077107230547b−1 Volker> bs_asin(x); --> 5.23598775598298873077107230547b−1 Volker> sin(asin(x)); --> 5.00000000000000000000000000001b−1 Volker> bs_sin(bs_asin(x)); --> 5.00000000000000000023968760547b−1 Interesting. I'm sure this can be fixed, but it seems like an odd artifact. Thanks for the detailed performance results. I wasn't actually asking for them, but it's really nice to see them. Volker> To merge them into src one has to create precision transition points Volker> from the current versions to the binary splitting versions and these Volker> transitions will vary from Lisp to Lisp, from 32 to 64 bit and from Volker> platform to platform. I am not inclined to open this can of worms. Volker> I will put these functions to /share/contrib, so that someone who needs Volker> $fpprec > 1000 can use them. Or for someone who wants to look at the Volker> implementation details. But nothing more at the moment. Volker> My functions have a bug where I need help. In case the return value is a Volker> power of 2 and fpround has rounded from below I have the problem to fix Volker> the exponent. It seems that I do not understand the mechanism of fpround Volker> and *m in float.lisp. Can someone help? Can you give an example of the problem? I have not looked at fpround in a very long time and don't really remember how it works anymore. Ray |