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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{\log \left(e^{\frac{2}{e^{x} + e^{-x}}}\right)}\]
  4. Final simplification0.1

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

Reproduce

herbie shell --seed 2021176 
(FPCore (x)
  :name "Hyperbolic secant"
  :precision binary64
  (/ 2.0 (+ (exp x) (exp (- x)))))