Hacker News new | ask | show | jobs
by _0ffh 86 days ago
Also nobody in his right mind uses lookup tables where the table value is actually the float approximation of the true f(x) - you choose the support values to minimize an error (e.g. mse) of a dense sampling of your interpolated value over x (or, in the limit, the integral of the chosen error function between the true curve and the interpolation of your supports). If you want to e.g. approximate a convex function using linear interpolation, all the tabulated values f'(x) would be <= the true f(x).
1 comments

The true value is far more useful in a lot of cases. If you're building a table indexed by the upper mantissa bits of the float, for example, it's difficult to distribute the error properly across all intervals.