Average Error: 58.0 → 0.0
Time: 2.8s
Precision: binary64
\[\frac{e^{x} - e^{-x}}{2}\]
\[\frac{\sinh x \cdot \log \left(e^{2}\right)}{2}\]
\frac{e^{x} - e^{-x}}{2}
\frac{\sinh x \cdot \log \left(e^{2}\right)}{2}
(FPCore (x) :precision binary64 (/ (- (exp x) (exp (- x))) 2.0))
(FPCore (x) :precision binary64 (/ (* (sinh x) (log (exp 2.0))) 2.0))
double code(double x) {
	return (exp(x) - exp(-x)) / 2.0;
}
double code(double x) {
	return (sinh(x) * log(exp(2.0))) / 2.0;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.0

    \[\frac{e^{x} - e^{-x}}{2}\]
  2. Using strategy rm
  3. Applied add-log-exp_binary6458.3

    \[\leadsto \frac{e^{x} - \color{blue}{\log \left(e^{e^{-x}}\right)}}{2}\]
  4. Applied add-log-exp_binary6458.4

    \[\leadsto \frac{\color{blue}{\log \left(e^{e^{x}}\right)} - \log \left(e^{e^{-x}}\right)}{2}\]
  5. Applied diff-log_binary6458.4

    \[\leadsto \frac{\color{blue}{\log \left(\frac{e^{e^{x}}}{e^{e^{-x}}}\right)}}{2}\]
  6. Simplified58.4

    \[\leadsto \frac{\log \color{blue}{\left(e^{e^{x} - e^{-x}}\right)}}{2}\]
  7. Using strategy rm
  8. Applied sinh-undef_binary6458.4

    \[\leadsto \frac{\log \left(e^{\color{blue}{2 \cdot \sinh x}}\right)}{2}\]
  9. Applied exp-prod_binary6458.4

    \[\leadsto \frac{\log \color{blue}{\left({\left(e^{2}\right)}^{\sinh x}\right)}}{2}\]
  10. Applied log-pow_binary640.0

    \[\leadsto \frac{\color{blue}{\sinh x \cdot \log \left(e^{2}\right)}}{2}\]
  11. Final simplification0.0

    \[\leadsto \frac{\sinh x \cdot \log \left(e^{2}\right)}{2}\]

Reproduce

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