std.math performance (SSE vs. real)

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 28 03:42:21 PDT 2014


On 6/28/2014 2:47 AM, francesco cattoglio wrote:
> When you need accuracy, 999 times out of 1000 you change the numerical
> technique, you don't just blindly upgrade the precision.

I have experience doing numerical work? Upgrading the precision is the first 
thing people try.


> The only real reason one would use 80 bits is when there is an actual need of
> adding values which differ for more than 16 orders of magnitude. And I've never
> seen this happen in any numerical paper I've read.

It happens with both numerical integration and inverting matrices. Inverting 
matrices is commonplace for solving N equations with N unknowns.

Errors accumulate very rapidly and easily overwhelm the significance of the answer.


> Especially the numerical analysts themselves will pay that price. 64 bit HAS to
> be as fast as possible, if you want to be competitive when it comes to any kind
> of numerical work.

Getting the wrong answer quickly is not useful when you're calculating the 
stress levels in a part.

Again, I've done numerical programming in airframe design. The correct answer is 
what matters. You can accept wrong answers in graphics display algorithms, but 
not when designing critical parts.


More information about the Digitalmars-d mailing list