Average Error: 0.0 → 0.0
Time: 11.2s
Precision: 64
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[\log \left(e^{\frac{1}{x - 1} + \frac{x}{x + 1}}\right)\]
\frac{1}{x - 1} + \frac{x}{x + 1}
\log \left(e^{\frac{1}{x - 1} + \frac{x}{x + 1}}\right)
double f(double x) {
        double r3905558 = 1.0;
        double r3905559 = x;
        double r3905560 = r3905559 - r3905558;
        double r3905561 = r3905558 / r3905560;
        double r3905562 = r3905559 + r3905558;
        double r3905563 = r3905559 / r3905562;
        double r3905564 = r3905561 + r3905563;
        return r3905564;
}

double f(double x) {
        double r3905565 = 1.0;
        double r3905566 = x;
        double r3905567 = r3905566 - r3905565;
        double r3905568 = r3905565 / r3905567;
        double r3905569 = r3905566 + r3905565;
        double r3905570 = r3905566 / r3905569;
        double r3905571 = r3905568 + r3905570;
        double r3905572 = exp(r3905571);
        double r3905573 = log(r3905572);
        return r3905573;
}

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 add-log-exp0.0

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

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
  :name "Asymptote B"
  (+ (/ 1 (- x 1)) (/ x (+ x 1))))