On 5 janv. 2013, at 09:02, Rick Mann <rm...@latencyzero.com> wrote: > Well, that shouldn't matter. If a "double" is a double, then even if it can't > do it in hardware, it should be done in software, and the result should be > the same.
Of course. But, if I am not mistaken, the IEEE norm does not define by itself the precision of transcendental functions. > Regardless, we're doing it all in float, and we're getting different results > on the different platforms. If you do it in float, you can maybe adopt an hybrid solution without having to fully compile crlibm. cos (a + b) = cos a cos b + sin a sin b If you implement a table with, say, 200 exact values of cos/sin (i.e. 1,600 bytes), then, since you can compute any cos from values in [0, pi/2], it means that, using the aforementioned identity, you can compute any cos from a value ‘a’ in the table (thus an exact value) and ‘b’ < 1e-2. So, if you need a 1e-10 precision, a Taylor expansion in O(x^5) is enough. That means three terms for either cos and sin, that you can perform in parallel using NEON. I am not sure crlibm is optimized for SIMD… Vincent _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com