Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.16 linux/arm64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/home/ubuntu/.cache/go-build" GOENV="/home/ubuntu/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/ubuntu/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/ubuntu/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/opt/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/opt/go/pkg/tool/linux_arm64" GOVCS="" GOVERSION="go1.16" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build864276053=/tmp/go-build -gno-record-gcc-switches"
What did you do?
While debugging some tests for Gorgonia, we found this strange behavior:
func TestMathTanh(t *testing.T) {
v := 0.2228940815087735
tanh := math.Tanh(v)
a := 1 - tanh*tanh + 1 - 1
b := 1 - tanh*tanh - 1 + 1
if a != b {
t.Fail()
}
}
This test is passing on amd64 and is failing on arm64.
What did you expect to see?
The test should pass
What did you see instead?
The test is failing