summaryrefslogtreecommitdiff
path: root/lib/math/scale2-impl.myr
AgeCommit message (Collapse)Author
2018-06-10Implement powr.S. Gilles
This is an attempt to extend the log algorithm of [Tan90] to compute x^y. I don't intend to keep this algorithm for long, since I didn't succeed very well. It's tremendously slow (worse even than mpfr!), and has some truly terrible edge cases. For example, computing pow(0x3f7ff7f3, 0xc7b58adf) (that is, (0.99987715)^(-92949.74)) returns infinity, when it should be 0x47b1d362 (91046.765), which is a dozen orders of magnitude below the infinity border. In more pedestrian cases, errors of up to ~16 ulps can be observed. For example, powr(0x3f80a83e, 0xc65492ba) = (1.0051343)^(-13604.682) should return 0x0d3304a3, but it gives 0x0d3304b4.
2018-05-10Use x as input variable instead of f.S. Gilles
Some algorithm descriptions use f as an auxiliary variable. Since we attempt to match variable naming to the relevant algorithm description, this becomes a problem. For uniformity, change everywhere.
2018-05-03Implment scale2.S. Gilles
This is, perhaps, a conforming implementation of scalB, but it is highly probable that, in the future, it will be desireable for scalB to accept arbitrary, exponents, not simply integers. Furthermore, we find scalB a non-intuitive name. Therefore, calling the function ‘scale2’ serves two purposes.