Use std::sqrt in fdlibm
Categories
(Core :: JavaScript Engine, enhancement, P1)
Tracking
()
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(2 files)
std::sqrt
is required to have an error less than 0.5 ulp, so there's no need to use the slower sqrt
implementation from fdlibm.
This improves all fdlibm functions calling sqrt
, for example see the results below for hypot
and acosh
.
// Improves from ~150ms to ~27ms.
function test_hypot() {
var xs = [1023, 10230];
var ys = [Math.PI, 2*Math.PI];
var q = 0;
var t = dateNow();
for (var i = 0; i < 1000000; ++i) {
q += Math.hypot(xs[i & 1], ys[i & 1]);
}
return [dateNow() - t, q];
}
// Improves from ~200ms to ~44ms.
function test_acosh() {
var xs = [1023, 10230];
var q = 0;
var t = dateNow();
for (var i = 0; i < 1000000; ++i) {
q += Math.acosh(xs[i & 1]);
}
return [dateNow() - t, q];
}
Assignee | ||
Comment 1•5 years ago
|
||
std::sqrt is guaranteed to have an error less than 0.5 ulp, so there's no need
to use fdlibm's slower implementation.
Assignee | ||
Comment 2•5 years ago
|
||
This makes it easier to test if modified patch files still apply.
Additionally "--no-backup-if-mismatch" was added to the patch
command to
avoid generating ".orig" files.
Depends on D37256
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ce0e1893b9c0de1b79ac2935d96e04830b486f1e
Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/67c757b08c76
Part 1: Use std::sqrt in fdlibm. r=arai
https://hg.mozilla.org/integration/autoland/rev/478e22e44bdf
Part 2: Allow to reimport a specific fdlibm commit. r=arai
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/67c757b08c76
https://hg.mozilla.org/mozilla-central/rev/478e22e44bdf
Updated•5 years ago
|
Description
•