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.

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).

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

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

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.

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).

edited Sep 23, 2022I'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