1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
8 Floating-point hyperbolic tangent.
10 Sinh and Cosh are called except for large arguments, which
11 would cause overflow improperly.
14 // Tanh computes the hyperbolic tangent of x.
20 func Tanh(x float64) float64 {
26 return -Sinh(x) / Cosh(x)
31 return Sinh(x) / Cosh(x)