]> Cypherpunks repositories - gostls13.git/commit
math: fix inaccurate result of Exp(1)
authorcrvv <crvv.mail@gmail.com>
Tue, 18 Jul 2017 06:37:01 +0000 (14:37 +0800)
committerRobert Griesemer <gri@golang.org>
Thu, 17 Aug 2017 09:01:27 +0000 (09:01 +0000)
commitd46953c9f61ee9fe9852be86bf7bae02e1b82e36
tree47d81fb61f1ae49a3be825e1a50ced92b2abe53c
parent3366f515441d2ed1aeffaa215a44959e5089bc30
math: fix inaccurate result of Exp(1)

The existing implementation is translated from C, which uses a
polynomial coefficient very close to 1/6. If the function uses
1/6 as this coeffient, the result of Exp(1) will be more accurate.
And this change doesn't introduce more error to Exp function.

Fixes #20319

Change-Id: I94c236a18cf95570ebb69f7fb99884b0d7cf5f6e
Reviewed-on: https://go-review.googlesource.com/49294
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/all_test.go
src/math/exp.go