Average Error: 0.0 → 0.2
Time: 8.2s
Precision: 64
\[\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)
double f(double x) {
        double r2335774 = 2.0;
        double r2335775 = x;
        double r2335776 = exp(r2335775);
        double r2335777 = -r2335775;
        double r2335778 = exp(r2335777);
        double r2335779 = r2335776 + r2335778;
        double r2335780 = r2335774 / r2335779;
        return r2335780;
}

double f(double x) {
        double r2335781 = 2.0;
        double r2335782 = x;
        double r2335783 = exp(r2335782);
        double r2335784 = -r2335782;
        double r2335785 = exp(r2335784);
        double r2335786 = r2335783 + r2335785;
        double r2335787 = r2335781 / r2335786;
        double r2335788 = exp(r2335787);
        double r2335789 = log(r2335788);
        return r2335789;
}

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-exp0.2

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

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

Reproduce

herbie shell --seed 2019158 
(FPCore (x)
  :name "Hyperbolic secant"
  (/ 2 (+ (exp x) (exp (- x)))))