4 Comments
Nov 12, 2021Liked by Jim Cownie

Swift is getting 128-bit FP at some time in the future. One suspects that will coincide with MacOS getting beefed up.

Expand full comment

If you're simulating physics from black holes down to quarks then you need higher precision because you're doing arithmetic between values of vastly different scale. In that case you might even need 256-bit fp.

Expand full comment
author

That doesn't say that you need higher precision, merely higher range. So something like a 64b format with 32 exponent bits and 32 mantissa bits (including the normalised out one on the front) seems a better bet to me. Of course, you'd need to emulate that in software, but it may still be faster (if nothing else, your caches just effectively got eight times larger than if you used 512b).

Expand full comment
Sep 23, 2022·edited Sep 23, 2022

I'm pretty sure that wouldn't work. When you add a really large value to a really small value, not having enough digits of precision means the smaller value gets thrown out. More exponent bits won't fix that. The libraries exist for a reason. They're not an academic exercise for fun, the herculean effort was put in out of necessity. David Bailey's QD library (quad-double) supports up to 62 digits of precision and is as optimized as possible given the native regular 'double' type is typically accelerated by the fpu. https://www.davidhbailey.com/dhbsoftware

Expand full comment