summaryrefslogtreecommitdiff
path: root/src/pkg/math/sinh.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/math/sinh.go')
-rw-r--r--src/pkg/math/sinh.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pkg/math/sinh.go b/src/pkg/math/sinh.go
index 1e55f0ba5..255ea2851 100644
--- a/src/pkg/math/sinh.go
+++ b/src/pkg/math/sinh.go
@@ -20,14 +20,13 @@ package math
// Sinh returns the hyperbolic sine of x.
func Sinh(x float64) float64 {
// The coefficients are #2029 from Hart & Cheney. (20.36D)
- const
- (
+ const (
P0 = -0.6307673640497716991184787251e+6;
P1 = -0.8991272022039509355398013511e+5;
P2 = -0.2894211355989563807284660366e+4;
P3 = -0.2630563213397497062819489e+2;
Q0 = -0.6307673640497716991212077277e+6;
- Q1 = 0.1521517378790019070696485176e+5;
+ Q1 = 0.1521517378790019070696485176e+5;
Q2 = -0.173678953558233699533450911e+3;
)
@@ -47,8 +46,8 @@ func Sinh(x float64) float64 {
default:
sq := x*x;
- temp = (((P3*sq+P2)*sq+P1)*sq+P0)*x;
- temp = temp/(((sq+Q2)*sq+Q1)*sq+Q0);
+ temp = (((P3*sq + P2)*sq + P1)*sq + P0)*x;
+ temp = temp/(((sq+Q2)*sq + Q1)*sq + Q0);
}
if sign {
@@ -60,7 +59,7 @@ func Sinh(x float64) float64 {
// Cosh returns the hyperbolic cosine of x.
func Cosh(x float64) float64 {
if x < 0 {
- x = - x;
+ x = -x;
}
if x > 21 {
return Exp(x)/2;