Average Error: 0.0 → 0.0
Time: 4.6s
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 r1692608 = 1.0;
        double r1692609 = x;
        double r1692610 = r1692609 - r1692608;
        double r1692611 = r1692608 / r1692610;
        double r1692612 = r1692609 + r1692608;
        double r1692613 = r1692609 / r1692612;
        double r1692614 = r1692611 + r1692613;
        return r1692614;
}

double f(double x) {
        double r1692615 = 1.0;
        double r1692616 = x;
        double r1692617 = r1692616 - r1692615;
        double r1692618 = r1692615 / r1692617;
        double r1692619 = r1692616 + r1692615;
        double r1692620 = r1692616 / r1692619;
        double r1692621 = r1692618 + r1692620;
        double r1692622 = exp(r1692621);
        double r1692623 = log(r1692622);
        return r1692623;
}

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