What features of D you would not miss?

Nicholas Wilson iamthewilsonator at hotmail.com
Sun Sep 18 23:01:48 UTC 2022


On Sunday, 18 September 2022 at 20:33:03 UTC, Walter Bright wrote:
> Just like with cars where there is no substitute for 
> horsepower, there's no substitute for extra precision.

Yes there is. Use an algorithm with better convergence properties 
or that is more numerically stable. If you have a problem with 
precision, you have other problems. You should fix the other 
problems first.

> Yes, there are known techniques for dealing with roundoff error,

The cases when roundoff is a problem is usually one of:
* catastrophic loss of precision from (something like) finite 
difference derivatives (algorithmic fix: use dual numbers aka 
automatic differentiation),
* massively different scales of the data you are working with. 
Your problem is poorly conditioned anyway, and you should try to 
separate the scales of your problem.
* you are doing _so_ many operations that (unacceptable) drift 
occurs, in which case why are you doing so many ops? Usually its 
from something like an alternating series summation with terrible 
convergence. Algorithmic fix, fix your convergence properties.

> but these are complex and tricky and are for experts in this 
> sort of thing.

Libraries are a thing, mir for example has many solutions to 
these kinds of problems. The only expertise required is to 
recognise you have a problem that would be fixed by one of them.

>Adding more precision often "just works" for the rest.

it is a bandaid fix that doesn't fix the root cause of your 
problem.


More information about the Digitalmars-d mailing list