Average Error: 0.0 → 0.0
Time: 12.4s
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 r7131157 = 1.0;
        double r7131158 = x;
        double r7131159 = r7131158 - r7131157;
        double r7131160 = r7131157 / r7131159;
        double r7131161 = r7131158 + r7131157;
        double r7131162 = r7131158 / r7131161;
        double r7131163 = r7131160 + r7131162;
        return r7131163;
}

double f(double x) {
        double r7131164 = 1.0;
        double r7131165 = x;
        double r7131166 = r7131165 - r7131164;
        double r7131167 = r7131164 / r7131166;
        double r7131168 = r7131165 + r7131164;
        double r7131169 = r7131165 / r7131168;
        double r7131170 = r7131167 + r7131169;
        double r7131171 = exp(r7131170);
        double r7131172 = log(r7131171);
        return r7131172;
}

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