Skip to content

Commit 2849710

Browse files
committed
Add bug references
1 parent 5ca1371 commit 2849710

File tree

2 files changed

+50
-10
lines changed

2 files changed

+50
-10
lines changed

docs/native_math_bugs.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
* [Accuracy of `Math.exp` in V8][@bug:v8:3468]
2121
* [TC39 meeting discussing Math accuracy issues][@bug:esdiscuss:2014-07-31]
2222
* [Spreadsheet showing trigonometric results across browsers][@bug:esdiscuss:038525:spreadsheet]
23+
* [Accuracy of `Math.pow` in V8][@bug:v8:3599]
24+
* [Accumulation of errors in Mozilla `Math.pow`][@bug:mozilla:618251]
25+
* [Accuracy of hyperbolic trigonometric functions in V8][@bug:paulmiller:es6-shim:334]
26+
* [ES6 shim accuracy issues][@bug:paulmillr:es6-shim:314]
27+
* [TC39 testing of Math built-ins][@bug:tc39:test262:269]
2328

24-
* [Accuracy of `Math.pow` in V8][10]
25-
* [Accumulation of errors in Mozilla `Math.pow`][11]
26-
* [Accuracy of hyperbolic trigonometric functions in V8][12]
27-
* [TC39 testing of Math built-ins][13]
28-
* [ES6 shim accuracy issues][14]
2929
* [Non-randomness of `Math.random` in V8][15]
3030
* [V8 fixes `Math.random`][16]
3131
* [V8 patches `Math.random` to return pseudorandom numbers][17]
@@ -59,12 +59,12 @@
5959
[@bug:v8:3468]: https://bugs.chromium.org/p/v8/issues/detail?id=3468
6060
[@bug:esdiscuss:2014-07-31]: https://esdiscuss.org/notes/2014-07-31
6161
[@bug:esdiscuss:038525:spreadsheet]: https://docs.google.com/spreadsheets/d/1t2jrptAvaQetDIYPD8GKc90Dni2dT3FuHgKKFF-eJHw/edit#gid=0
62+
[@bug:v8:3599]: https://bugs.chromium.org/p/v8/issues/detail?id=3599
63+
[@bug:mozilla:618251]: https://bugzilla.mozilla.org/show_bug.cgi?id=618251
64+
[@bug:paulmiller:es6-shim:334]: https://github.com/paulmillr/es6-shim/issues/334
65+
[@bug:paulmillr:es6-shim:314]: https://github.com/paulmillr/es6-shim/issues/314
66+
[@bug:tc39:test262:269]: https://github.com/tc39/test262/pull/269
6267

63-
[10]: https://bugs.chromium.org/p/v8/issues/detail?id=3599
64-
[11]: https://bugzilla.mozilla.org/show_bug.cgi?id=618251
65-
[12]: https://github.com/paulmillr/es6-shim/issues/334
66-
[13]: https://github.com/tc39/test262/pull/269
67-
[14]: https://github.com/paulmillr/es6-shim/issues/314
6868
[15]: https://medium.com/@betable/tifu-by-using-math-random-f1c308c4fd9d#.pxwdcvikc
6969
[16]: http://hackaday.com/2015/12/28/v8-javascript-fixes-horrible-random-number-generator/
7070
[17]: http://thenextweb.com/google/2015/12/17/google-chromes-javascript-engine-finally-returns-actual-random-numbers/#gref

docs/references/bugs.bib

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,43 @@ @misc{bug:esdiscuss:038525:spreadsheet
141141
url = {https://docs.google.com/spreadsheets/d/1t2jrptAvaQetDIYPD8GKc90Dni2dT3FuHgKKFF-eJHw/edit#gid=0},
142142
year = {2014}
143143
}
144+
145+
@misc{bug:v8:3599,
146+
abstract = {Math.pow(10, 308) returns 1.0000000000000006e308. The correct answer is 1e308. fdlibm's pow function does, in fact, return 1e308. The difference between what V8 returns and the correct answer is 3 ulp.},
147+
keywords = {math, javascript, v8, chrome, pow, exponentiation, precision},
148+
title = {{Math.pow(10,308) is inaccurate}},
149+
url = {https://bugs.chromium.org/p/v8/issues/detail?id=3599},
150+
year = {2014}
151+
}
152+
153+
@misc{bug:mozilla:618251,
154+
abstract = {From Shannon Hickey:\n\nvar oneWay:Number = Math.pow(10, 305);\nvar theOther:Number = 1e+305;\ntrace(oneWay);\ntrace(theOther);\ntrace(oneWay == theOther);\ntrace(oneWay - theOther);\n\nResults:\n\n1.00000000000000e+305\n1e+305\nfalse\n5.84718840683999e+289\n\nResult line 1 is unexpected. Result line 3 is odd. Result line 4 is completely crazy.\n\nMy analysis:\n\nPrimarily this looks like an inaccuracy in our code for Math.pow. You will notice that the difference between the two numbers is in the 16th digit (305-289=16), which cannot be represented reliably by a Number: Number only has 15 decimal digits of precision, generally. The pow() code does specialize for integer exponents but there could be inaccuracies creeping in around the extremes of the floating-point range (which extends to e+308) - I'd have to dig deeper to understand precisely what's going on, though. The reason the result of Math.pow() is being written as 1.00000000000000e+305 and not (eg) 1.00000000000001e+305, which is presumably the more accurate representation, is a separate bug in the number formatter. For integer exponents our Math.pow implementation uses a standard doubling algorithm. It appears that that doubling algorithm accumulates error. We ought to be able to do better. That said, 1e305 isn't exactly representable in a Number (it has 708 leading non-zero digits in the binary representation) so it's just a question of how good our approximation is.},
155+
keywords = {math, bug, javascript, firefox, ff, mozilla, pow, exponentiation, precision},
156+
title = {{Math.pow accumulates error}},
157+
url = {https://bugzilla.mozilla.org/show_bug.cgi?id=618251},
158+
year = {2010}
159+
}
160+
161+
@misc{bug:paulmillr:es6-shim:334,
162+
abstract = {var isAsinhOK = Math.asinh(0.0002) >= 0.0001999999986666666 && Math.asinh(0.0002) <= 0.0001999999986666668; var isAtanhOK = Math.atanh(0.0002) >= 0.0002000000026666667 && Math.atanh(0.0002) <= 0.0002000000026666668; Both of these are true in shimmed Firefox 37 and Safari 8, both false in Chrome 41 and Chrome Canary 44. From kangax/compat-table#392 (comment)},
163+
keywords = {math, shim, javascript, precision, chrome, v8},
164+
title = {{Chrome 41: `Math.asinh` and `Math.atanh` are imprecise}},
165+
url = {https://github.com/paulmillr/es6-shim/issues/334},
166+
year = {2015}
167+
}
168+
169+
@misc{bug:paulmillr:es6-shim:314,
170+
abstract = {Large relative error for `Math.expm1` and `Math.log1p`.},
171+
keywords = {math, shim, javascript, es6, es2015, bug, precision},
172+
title = {{Relative error is too big for Math.expm1 and Math.log1p}},
173+
url = {https://github.com/paulmillr/es6-shim/issues/314},
174+
year = {2015}
175+
}
176+
177+
@misc{bug:tc39:test262:269,
178+
abstract = {Discussion on whether to include accuracy tests due to underspecified standard.},
179+
keywords = {math, javascript, tc39, precision, bug},
180+
title = {{Add new tests for Math built-ins}},
181+
url = {https://github.com/tc39/test262/pull/269},
182+
year = {2015}
183+
}

0 commit comments

Comments
 (0)