HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Why aren't computables used for numerical calculations?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
whycomputablesnumericalusedarencalculationsfor

Problem

In programming languages like Haskell you can use lazy evaluation to delay calculations.

Why isn't a similar approach being used for numerical methods (I understand that there would be memory implications).

The approach would be that non-integer values would be stored as how they are calculated, so that the next digit can be found when requested.

This kind of approach should allow every value to be calculated to the correct number of significant figures.

Sorry that this is slightly garbled.

Solution

It sounds extremely inefficient compared to floating point. We have a very good understanding of how to control the errors in floating-point calculations (e.g., adding small numbers before large ones, avoiding taking the difference of large numbers and so on) so the only benefit of the methods you're suggesting would appear to be that they offer increased precision. But, for almost all applications, 64-bit floating point is more than enough and the speed of being able to do calculations with single CPU (or GPU!) instructions is a huge win.

Context

StackExchange Computer Science Q#75279, answer score: 6

Revisions (0)

No revisions yet.