Re:High Performance Correctly Rounded Math Libraries for 32-...
by tmyklebu on Thursday August 26, 2021 @10:22PM
(#28323645)
If you're just looking for hard-to-round inputs, you can also enumerate the double precision space completely with some cleverness and modest patience.
Elkies [0] computes a piecewise linear approximation to his (number-theoretic) function of interest and does a lattice reduction on each piece to filter out the vast majority of the space. The same approach, works almost everywhere on all of the transcendental functions I've tried, and I believe the CRlibm group uses it.
Re:High Performance Correctly Rounded Math Libraries for 32-...
by bsder on Friday August 27, 2021 @05:32PM
(#28333199)
Oooh, that's an interesting take.
Re:High Performance Correctly Rounded Math Libraries for 32-...
by adgjlsfhk1 on Thursday August 26, 2021 @06:00PM
(#28321511)
This doesn't contradict what I said. I said that the odds of a function needing more than 3n digits was 4^-n. For single precision, that means you would expect almost all functions to be OK with 3n bits (1 in 2^46 wouldn't be).
Re:High Performance Correctly Rounded Math Libraries for 32-...
by vyodaiken on Thursday August 26, 2021 @08:10PM
(#28322686)
if it was a randomly selected function, which it is not.
Re:High Performance Correctly Rounded Math Libraries for 32-...
by stephencanon on Thursday August 26, 2021 @08:21PM
(#28322791)
In practice the low-order bits of transcendental functions are pretty much indistinguishable from random for _most_ inputs. You do have to be very careful close to especially nice values though, because this falls apart catastrophically there (e.g. logarithms close to 1)--it should be pretty obvious from the Taylor expansions why this happens. The good news is that when this does happen, almost by construction you usually don't end up very close to an exact halfway point for rounding.
Re:High Performance Correctly Rounded Math Libraries for 32-...
by klyrs on Thursday August 26, 2021 @09:50PM
(#28323433)
> In practice the low-order bits of transcendental functions are pretty much indistinguishable from random for _most_ inputs.
In my experience, low order bits of transcendental functions make terrible rng sources (even discounting their runtime). Your example of the logarithm is great -- for large inputs, you need large changes to flip even low order bits.
So, the problem isn't bounded by simple probabilities. There are other properties involved that cause it to diverge from the "naive" probabilistic estimates. What those properties are we don't know yet.
The "rounding" problem is called the "Table Maker's Dilemma" and it descends into some pretty fundamental transcendental number theory.
This is not an "easy" problem. Proof that PI was transcendental is relatively modern (1885).