Average Error: 0.0 → 0.0
Time: 3.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 r129901 = 1.0;
        double r129902 = x;
        double r129903 = r129902 - r129901;
        double r129904 = r129901 / r129903;
        double r129905 = r129902 + r129901;
        double r129906 = r129902 / r129905;
        double r129907 = r129904 + r129906;
        return r129907;
}

double f(double x) {
        double r129908 = 1.0;
        double r129909 = x;
        double r129910 = r129909 - r129908;
        double r129911 = r129908 / r129910;
        double r129912 = r129909 + r129908;
        double r129913 = r129909 / r129912;
        double r129914 = r129911 + r129913;
        double r129915 = exp(r129914);
        double r129916 = log(r129915);
        return r129916;
}

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