]> Cypherpunks repositories - gostls13.git/commit
math: fix portable FMA implementation when x*y ~ 0, x*y < 0 and z = 0
authorICHINOSE Shogo <shogo82148@gmail.com>
Sun, 18 May 2025 17:28:09 +0000 (17:28 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 19 May 2025 21:45:48 +0000 (14:45 -0700)
commit498899e20549a9e30f7641fc3a3592f89a933a95
tree1942e42c5c6b0d4b91aa535c8e0c66047c230cef
parent2cde950049dd46cae3ae91cde3e270825793ba0f
math: fix portable FMA implementation when x*y ~ 0, x*y < 0 and z = 0

Adding zero usually does not change the original value.
However, there is an exception with negative zero. (e.g. (-0) + (+0) = (+0))
This applies when x * y is negative and underflows.

Fixes #73757

Change-Id: Ib7b54bdacd1dcfe3d392802ea35cdb4e989f9371
GitHub-Last-Rev: 30d74883b21667fc9439d9d14932b7edb3e72cd5
GitHub-Pull-Request: golang/go#73759
Reviewed-on: https://go-review.googlesource.com/c/go/+/673856
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
src/math/all_test.go
src/math/fma.go