Average Error: 0.0 → 0.0
Time: 3.6s
Precision: 64
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[\log \left(e^{\frac{1}{x - 1}}\right) + \frac{1}{\frac{x + 1}{x}}\]
\frac{1}{x - 1} + \frac{x}{x + 1}
\log \left(e^{\frac{1}{x - 1}}\right) + \frac{1}{\frac{x + 1}{x}}
double f(double x) {
        double r113754 = 1.0;
        double r113755 = x;
        double r113756 = r113755 - r113754;
        double r113757 = r113754 / r113756;
        double r113758 = r113755 + r113754;
        double r113759 = r113755 / r113758;
        double r113760 = r113757 + r113759;
        return r113760;
}

double f(double x) {
        double r113761 = 1.0;
        double r113762 = x;
        double r113763 = r113762 - r113761;
        double r113764 = r113761 / r113763;
        double r113765 = exp(r113764);
        double r113766 = log(r113765);
        double r113767 = 1.0;
        double r113768 = r113762 + r113761;
        double r113769 = r113768 / r113762;
        double r113770 = r113767 / r113769;
        double r113771 = r113766 + r113770;
        return r113771;
}

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{1}{x - 1} + \frac{x}{x + 1}\]
  2. Using strategy rm
  3. Applied clear-num0.0

    \[\leadsto \frac{1}{x - 1} + \color{blue}{\frac{1}{\frac{x + 1}{x}}}\]
  4. Using strategy rm
  5. Applied add-log-exp0.0

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

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

Reproduce

herbie shell --seed 2020049 
(FPCore (x)
  :name "Asymptote B"
  :precision binary64
  (+ (/ 1 (- x 1)) (/ x (+ x 1))))