Average Error: 0.0 → 0.0
Time: 19.8s
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 r4348578 = 1.0;
        double r4348579 = x;
        double r4348580 = r4348579 - r4348578;
        double r4348581 = r4348578 / r4348580;
        double r4348582 = r4348579 + r4348578;
        double r4348583 = r4348579 / r4348582;
        double r4348584 = r4348581 + r4348583;
        return r4348584;
}

double f(double x) {
        double r4348585 = 1.0;
        double r4348586 = x;
        double r4348587 = r4348586 - r4348585;
        double r4348588 = r4348585 / r4348587;
        double r4348589 = r4348586 + r4348585;
        double r4348590 = r4348586 / r4348589;
        double r4348591 = r4348588 + r4348590;
        double r4348592 = exp(r4348591);
        double r4348593 = log(r4348592);
        return r4348593;
}

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