Average Error: 0.0 → 0.0
Time: 43.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 r3003045 = 1.0;
        double r3003046 = x;
        double r3003047 = r3003046 - r3003045;
        double r3003048 = r3003045 / r3003047;
        double r3003049 = r3003046 + r3003045;
        double r3003050 = r3003046 / r3003049;
        double r3003051 = r3003048 + r3003050;
        return r3003051;
}

double f(double x) {
        double r3003052 = 1.0;
        double r3003053 = x;
        double r3003054 = r3003053 - r3003052;
        double r3003055 = r3003052 / r3003054;
        double r3003056 = r3003053 + r3003052;
        double r3003057 = r3003053 / r3003056;
        double r3003058 = r3003055 + r3003057;
        double r3003059 = exp(r3003058);
        double r3003060 = log(r3003059);
        return r3003060;
}

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