[math-fun] more binary asinh
I've done more analysis on "binary" asinh and its analogy with floating point -- especially the analogy with "gradual underflow"/"denormalized" arithmetic. as2(x):=asinh(x)/log(2) which is the inverse of s2(x):=(2^x-2^-x)/2. I looked at the 16 bits on either side of the binary point. For x>256, this function is log2(2x) for the 16 bits below the binary point -- i.e., as2(2^8) ~ 9, to 16 bits of precision. For x<2^-5, this function is x/log(2) ~ 1.442695x, to 16 bits of precision. So, asinh(x) is like Kahan's "gradual underflow" floating point numbers, wherein the exponent doesn't go below 0, and the mantissa starts shifting out to the right. Unfortunately, with as2(x) for small x, we don't get x itself, but 1.442695x, but we do get the correct binary exponent (plus 1). We can get x itself with the following function: asl2(x):=asinh(x*log(2))/log(2) so that for x<2^-5, we get asl2(x) ~ x. Unfortunately, with asl2(x), the exponent is now screwed up so that it is no longer an integer for x=2^k, k large. For x>2^9, we can recover the correct exponent by subtracting log2(2ln2)=log2(ln4)~0.4712336270551, so that asl2(2^k)-0.4712336270551 ~ k, for k>9, to at least 16 bits of precision. So, with these asinh functions, we can either get the exponent right, or the mantissa right, but not both at the same time. --- So, asinh(x) seems to combine both the exponent and the mantissa into the same number, but requires that both the exponent and mantissa be brought into "common terms" before being combined. Unfortunately, the "common term" requires either adding or multiplying by a transcendental number, which is a bit inconvenient. To compete with IEEE single precision, we would encode x as as2ieee(x):=asinh(x*2^127*log(2))/log(2) (the exponent of 2 might be off by +-1, but you get the idea.) Thus, as2ieee(x) wouldn't start "denormalizing" until approx the same precision that IEEE single float would. The major difference between asinh encoding and IEEE single float is that the majority of precision (for most numbers) is in the "exponent", not the "mantissa". In this way, asinh encoding is more like Wang's "LOCI" logarithmic encoding for his 1960's-era calculators.
participants (1)
-
Henry Baker