Average Error: 0.0 → 0.0
Time: 9.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 r2574392 = 1.0;
        double r2574393 = x;
        double r2574394 = r2574393 - r2574392;
        double r2574395 = r2574392 / r2574394;
        double r2574396 = r2574393 + r2574392;
        double r2574397 = r2574393 / r2574396;
        double r2574398 = r2574395 + r2574397;
        return r2574398;
}

double f(double x) {
        double r2574399 = 1.0;
        double r2574400 = x;
        double r2574401 = r2574400 - r2574399;
        double r2574402 = r2574399 / r2574401;
        double r2574403 = r2574400 + r2574399;
        double r2574404 = r2574400 / r2574403;
        double r2574405 = r2574402 + r2574404;
        double r2574406 = exp(r2574405);
        double r2574407 = log(r2574406);
        return r2574407;
}

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 \frac{1}{x - 1} + \color{blue}{\log \left(e^{\frac{x}{x + 1}}\right)}\]
  4. Applied add-log-exp0.0

    \[\leadsto \color{blue}{\log \left(e^{\frac{1}{x - 1}}\right)} + \log \left(e^{\frac{x}{x + 1}}\right)\]
  5. Applied sum-log0.0

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

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

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

Reproduce

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