Average Error: 57.9 → 0.0
Time: 16.8s
Precision: binary64
Cost: 6720
\[\frac{e^{x} - e^{-x}}{2}\]
\[\frac{2 \cdot \sinh x}{2}\]
\frac{e^{x} - e^{-x}}{2}
\frac{2 \cdot \sinh x}{2}
(FPCore (x) :precision binary64 (/ (- (exp x) (exp (- x))) 2.0))
(FPCore (x) :precision binary64 (/ (* 2.0 (sinh x)) 2.0))
double code(double x) {
	return (exp(x) - exp(-x)) / 2.0;
}
double code(double x) {
	return (2.0 * sinh(x)) / 2.0;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error60.4
Cost6656
\[{x}^{6} \cdot -0.020833333333333332\]
Alternative 2
Error1.2
Cost7040
\[0.5 \cdot \left(x \cdot 2 + 0.6041666666666666 \cdot {x}^{3}\right)\]
Alternative 3
Error61.5
Cost19520
\[\log \left(\left|x\right|\right) + \frac{x}{\left|x\right|}\]
Alternative 4
Error1.2
Cost64
\[x\]
Alternative 5
Error60.2
Cost320
\[x \cdot \left(x \cdot -0.5\right)\]

Error

Derivation

  1. Initial program 59.0

    \[\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}\]
  2. Taylor expanded around 0 57.9

    \[\leadsto \frac{e^{x} - e^{-x}}{\color{blue}{2}}\]
  3. Using strategy rm
  4. Applied sinh-undef_binary64_2710.0

    \[\leadsto \frac{\color{blue}{2 \cdot \sinh x}}{2}\]
  5. Final simplification0.0

    \[\leadsto \frac{2 \cdot \sinh x}{2}\]

Reproduce

herbie shell --seed 2021043 
(FPCore (x)
  :name "Hyperbolic sine"
  :precision binary64
  (/ (- (exp x) (exp (- x))) 2.0))