shithub: mc

Download patch

ref: 0843b337e2c2f96bde753090304e1a918b03d73f
parent: c57f69776103121107ad70d86a7b0efbc2553daa
author: S. Gilles <sgilles@math.umd.edu>
date: Thu Jun 28 07:33:53 EDT 2018

Fix bi/ci calculation in reduction.

--- a/lib/math/sin-impl.myr
+++ b/lib/math/sin-impl.myr
@@ -681,9 +681,9 @@
 			xc = 0.0
 		else
 			(u1, u2, u3) = R[j - 2]
-			b1 = std.flt64frombits(u1)
-			b2 = std.flt64frombits(u2)
-			b3 = std.flt64frombits(u3)
+			c1 = std.flt64frombits(u1)
+			c2 = std.flt64frombits(u2)
+			c3 = std.flt64frombits(u3)
 			var e3 : int64 = 50*(j - 2 : int64) + 25
 			var xlo = std.flt64frombits(b & ((~0) << (52 + (e3 - e : uint64))))
 			xc = scale2(xlo, -e3)
--- a/lib/math/test/sin-impl.myr
+++ b/lib/math/test/sin-impl.myr
@@ -71,6 +71,7 @@
 	var inputs : (uint64, uint64, uint64)[:] = [
 		(0x0000000000000000, 0x0000000000000000, 0x3ff0000000000000),
 		(0x4100000000000000, 0xbfeff8bd7b10d6b0, 0x3fa58ced65ec8b50),
+		(0x4b01000000000000, 0xbfe3e9527dc75f12, 0x3fe90cf80997c963),
 	][:]
 
 	for (x, ys, yc) : inputs