Computes the log power of two we'd need to scale by so that the max double is between (2 ** scaleConstant, 2 ** -scaleConstant).
Computes the log power of two we'd need to scale by so that the max double is between (2 ** scaleConstant, 2 ** -scaleConstant).
Ensures that the max double is between (2**scaleConstant,2**-scaleConstant), scaling the array as necessary.
Ensures that the max double is between (2**scaleConstant,2**-scaleConstant), scaling the array as necessary.
newScale
Converts the scaled value into "normal" space
Sums src
into dest
assuming they're at different scales.
Sums src
into dest
assuming they're at different scales. src
may be longer than
dest
, which is useful for allocating a large work buffer.
the new scale
Converts the scaled value into "normal" space
Scaling utilities.
Often, in order to avoid underflow, we can offload some of the exponent of a double into an int. To make things more efficient, we can actually share that exponent between doubles.
The scales used in this trait are in log space: they can be safely added and subtracted.