Average Error: 0.0 → 0.0
Time: 23.2s
Precision: 64
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[\log \left(e^{\frac{1}{x - 1} + \frac{x}{1 + x}}\right)\]
\frac{1}{x - 1} + \frac{x}{x + 1}
\log \left(e^{\frac{1}{x - 1} + \frac{x}{1 + x}}\right)
double f(double x) {
        double r5553650 = 1.0;
        double r5553651 = x;
        double r5553652 = r5553651 - r5553650;
        double r5553653 = r5553650 / r5553652;
        double r5553654 = r5553651 + r5553650;
        double r5553655 = r5553651 / r5553654;
        double r5553656 = r5553653 + r5553655;
        return r5553656;
}

double f(double x) {
        double r5553657 = 1.0;
        double r5553658 = x;
        double r5553659 = r5553658 - r5553657;
        double r5553660 = r5553657 / r5553659;
        double r5553661 = r5553657 + r5553658;
        double r5553662 = r5553658 / r5553661;
        double r5553663 = r5553660 + r5553662;
        double r5553664 = exp(r5553663);
        double r5553665 = log(r5553664);
        return r5553665;
}

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}{1 + x}}\right)\]

Reproduce

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