summaryrefslogtreecommitdiff
path: root/lib/math
AgeCommit message (Collapse)Author
2018-08-05We can pick fma generically at compile time.Ori Bernstein
It's a trait, and because the functions are generic, they already know the type.
2018-08-05We don't need the impls in sin-impl.Ori Bernstein
2018-08-03Clean up previous fixes.Ori Bernstein
The externs were already defined, they just needed to be moved out to prevent cyclic dependencies.
2018-08-03Fix build on Linux.Ori Bernstein
2018-07-31Include test cases for all (relevant) sub-polynomials of atan.S. Gilles
2018-07-31Correct extra-precision division typo for atan.S. Gilles
2018-07-31Correctly compute u, du for y/x in atan.S. Gilles
Also, apparently the C tables gave negatives. That's probably a mistake.
2018-07-31Improve accuracy of poly path of atan calculations.S. Gilles
2018-07-31Negate atan properly when atan(1/x) is computed.S. Gilles
2018-07-31First compiling atan.S. Gilles
2018-07-24Adjust leeway in arctan tuple generator.S. Gilles
2018-07-24Document that generate-minimax-by-Remez.gp has issues.S. Gilles
2018-07-24Add tuple-generation for arctan.S. Gilles
2018-07-23Handle awkward special cases in tan/cot32.S. Gilles
2018-07-22Test Highly Accurate Tables for tan() and cot().S. Gilles
2018-07-22Handle -0.0 correctly in tan() and cot().S. Gilles
2018-07-22Correct typo in cotangent calculations.S. Gilles
2018-07-20Ensure tan(NaN) is a [q]NaN.S. Gilles
2018-07-20First compiling tan/cot functions.S. Gilles
2018-07-15Update triple-generate to also compute tables for tan and cot.S. Gilles
2018-06-30Document results of sin/cos a bit more.S. Gilles
2018-06-30Eliminate loop sorts in sin/cos reduction.S. Gilles
2018-06-30Cut down results of reduce() from triple to double for sin/cos.S. Gilles
2018-06-30Remove a sort or two in sin/cos.S. Gilles
2018-06-30Reduce overkill on precision in a few sum computations for sin/cos.S. Gilles
2018-06-30Add test cases for each C[j] constant for sin/cos.S. Gilles
2018-06-30Be a little smarter about downscaling flt64s to flt32s in sin/cos.S. Gilles
2018-06-30Find nearest xi value, instead of blindly computing j.S. Gilles
2018-06-28Fix local reduction from [-pi/2, pi/2] to [-pi/4, pi/4]S. Gilles
2018-06-28Rewrite xa, xb, xc calculation in huge_reduce.S. Gilles
2018-06-28Initialize variables (fallout from upstream merge?).S. Gilles
2018-06-28Merge remote-tracking branch 'ori/master' into sin-cos-workS. Gilles
2018-06-28Fix bi/ci calculation in reduction.S. Gilles
2018-06-28Add macros for relative error to lib/math/ancillary.S. Gilles
2018-06-28Fix pi/2 constants.S. Gilles
2018-06-28Fix some errors in sin-impl.S. Gilles
- Remez algorithms don't work when the function to be approximated vanishes (they track relative error, which would go to infinity), so the sin_coeffs needed to be recalculated. - sin and cos were swapped when retrieving from C, so sin(0) was 1. - Negative post-reduction x values needed to be handled better (negating sign before other potential permutations). - Fix huge_reduction by calculating xb from x - xhi, not x. - Change pi/4 for pi/2 (I forgot I was in the middle of doing this halfway through writing it.)
2018-06-27Initial (only compile-tested) implementation of sin, cos.S. Gilles
2018-06-26Update generators for constants.S. Gilles
Now that the tables of triples have finished calculating, check in the final version.
2018-06-21Add ancillary programs for libmath.S. Gilles
Some constants in libmath come from papers, but some come from long computations. Those computations should be reproducible, so that 10 years from now someone can answer the questions "Why are they using 0x3f6921fb53cc441b?" and "Would 0x3f6921fb42e71072 be better?".
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-29Add testdeps to libmath.Ori Bernstein
2018-05-13Add tests for AES GCM decryption, fix a small bug.Ori Bernstein
2018-05-13Merge remote-tracking branch 'ori/master' into libmathS. Gilles
2018-05-13Implement log and log1p.S. Gilles
2018-05-13Fix posix build.Ori Bernstein
2018-05-13Add float trapping controls.Ori Bernstein
This both allows us to error earlier when math goes wonky, and allows us to test all our code on 9front.
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-10Remove fma from exp-impl; not neededS. Gilles
2018-05-03Finish expm1 using scale2.S. Gilles
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.