-
Notifications
You must be signed in to change notification settings - Fork 18k
math: Exp(x) function on amd64 can not return denormal numbers #23164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@erifan thank you for the report. I have modified your issue just to display your diff in markdown. /cc @griesemer |
This is a limitation of the algorithm used in the amd64 assembly implementation of |
Thank you @ALTree! I'll mark this for Go1.11 then. |
Change https://golang.org/cl/87337 mentions this issue: |
@erifan This has not been submitted yet. Re-opening. Once it's submitted, the issue will be closed automatically. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Go version devel +2de98eb Sat Dec 16 23:30:58 2017 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/username/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/username/golangworkspace"
GORACE=""
GOROOT="/home/username/golang"
GOTMPDIR=""
GOTOOLDIR="/home/username/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build362762432=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Add a test case: Exp(-740.0) for Exp(x) function, and verify the correctness of Exp(x) with commands:
cd golang/src/math/
../../bin/go test -c
./math.test -test.run TestExp$
Changes are as follow:
What did you expect to see?
PASS
What did you see instead?
--- FAIL: TestExp (0.00s)
all_test.go:2277: Exp(-740) = 0, want 4.2e-322
FAIL
The text was updated successfully, but these errors were encountered: