shithub: mc

Download patch

ref: 728bf756970e75ca3217776c23dad1637d0f6f2c
parent: 9afaec2ee7ed8864f9f28c39533e2f2094301fba
author: S. Gilles <[email protected]>
date: Sat Jun 30 15:40:01 EDT 2018

Document results of sin/cos a bit more.

--- a/lib/math/sin-impl.myr
+++ b/lib/math/sin-impl.myr
@@ -7,11 +7,15 @@
 use "util"
 
 /*
-   This implmentation of sin and cos uses the "Highly Accurate
-   Tables" method of [GB91]. The idea is to tabulate [0, pi/4] at
-   256 slightly irregular intervals xi, with the lucky property
-   that the infinite binary expansions of significands of sin(xi)
-   and cos(xi) look like
+   This implementation of sin and cos uses the "Highly Accurate
+   Tables" method of [GB91]. It's not as fast as it could be (the
+   sorting and excessive summation really takes a toll), however
+   we seem to be consistently within +/-1 ulp of the correct result
+   in flt64 case. In flt32 case we are correctly rounded.
+
+   The idea is to tabulate [0, pi/4] at 256 slightly irregular
+   intervals xi, with the lucky property that the infinite binary
+   expansions of significands of sin(xi) and cos(xi) look like
 
       / 53 bits \  / many '0's \  / noise \
      1.bbbbbb...bb00000000000...0???????????...