aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/math/tanh.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/math/tanh.go')
-rw-r--r--libgo/go/math/tanh.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libgo/go/math/tanh.go b/libgo/go/math/tanh.go
index 009a206..a825678 100644
--- a/libgo/go/math/tanh.go
+++ b/libgo/go/math/tanh.go
@@ -72,6 +72,13 @@ var tanhQ = [...]float64{
// Tanh(±Inf) = ±1
// Tanh(NaN) = NaN
func Tanh(x float64) float64 {
+ if haveArchTanh {
+ return archTanh(x)
+ }
+ return tanh(x)
+}
+
+func tanh(x float64) float64 {
const MAXLOG = 8.8029691931113054295988e+01 // log(2**127)
z := Abs(x)
switch {