Average Error: 0.0 → 0.0
Time: 7.5s
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 r3316351 = 1.0;
        double r3316352 = x;
        double r3316353 = r3316352 - r3316351;
        double r3316354 = r3316351 / r3316353;
        double r3316355 = r3316352 + r3316351;
        double r3316356 = r3316352 / r3316355;
        double r3316357 = r3316354 + r3316356;
        return r3316357;
}

double f(double x) {
        double r3316358 = 1.0;
        double r3316359 = x;
        double r3316360 = r3316359 - r3316358;
        double r3316361 = r3316358 / r3316360;
        double r3316362 = r3316359 + r3316358;
        double r3316363 = r3316359 / r3316362;
        double r3316364 = r3316361 + r3316363;
        double r3316365 = exp(r3316364);
        double r3316366 = log(r3316365);
        return r3316366;
}

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 2019132 +o rules:numerics
(FPCore (x)
  :name "Asymptote B"
  (+ (/ 1 (- x 1)) (/ x (+ x 1))))