std.math performance (SSE vs. real)

francesco cattoglio via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 28 04:27:35 PDT 2014


On Saturday, 28 June 2014 at 10:42:19 UTC, Walter Bright wrote:
> On 6/28/2014 2:47 AM, francesco cattoglio wrote:
> I have experience doing numerical work? Upgrading the precision 
> is the first thing people try.
>

Brute force is always the first thing people try :o)

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

And that's exactly the reason you change approach instead of 
getting greater precision: the "adding precision" approach scales 
horribly, at least in my field of study, which is solving 
numerical PDEs.
(BTW: no sane person inverts matrices)

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

We are talking about paying a price when you don't need it. With 
the correct approach, solving numerical problems with double 
precision floats yelds perfectly fine results. And it is, in 
fact, commonplace.

Again, I've not read yet a research paper in which it was clearly 
stated that 64bit floats were not good enough for solving a whole 
class of PDE problem. I'm not saying that real is useless, quite 
the opposite: I love the idea of having an extra tool when the 
need arises. I think the focus should be about not paying a price 
for what you don't use


More information about the Digitalmars-d mailing list