Average Error: 0.0 → 0.0
Time: 6.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 r2475101 = 1.0;
        double r2475102 = x;
        double r2475103 = r2475102 - r2475101;
        double r2475104 = r2475101 / r2475103;
        double r2475105 = r2475102 + r2475101;
        double r2475106 = r2475102 / r2475105;
        double r2475107 = r2475104 + r2475106;
        return r2475107;
}

double f(double x) {
        double r2475108 = 1.0;
        double r2475109 = x;
        double r2475110 = r2475109 - r2475108;
        double r2475111 = r2475108 / r2475110;
        double r2475112 = r2475109 + r2475108;
        double r2475113 = r2475109 / r2475112;
        double r2475114 = r2475111 + r2475113;
        double r2475115 = exp(r2475114);
        double r2475116 = log(r2475115);
        return r2475116;
}

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