Average Error: 14.3 → 0.4
Time: 8.7s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\log \left(\frac{1}{e^{1}}\right) - 1\right)\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\log \left(\frac{1}{e^{1}}\right) - 1\right)
double f(double x) {
        double r146038 = 1.0;
        double r146039 = x;
        double r146040 = r146039 + r146038;
        double r146041 = r146038 / r146040;
        double r146042 = r146039 - r146038;
        double r146043 = r146038 / r146042;
        double r146044 = r146041 - r146043;
        return r146044;
}

double f(double x) {
        double r146045 = 1.0;
        double r146046 = x;
        double r146047 = r146046 * r146046;
        double r146048 = r146045 * r146045;
        double r146049 = r146047 - r146048;
        double r146050 = r146045 / r146049;
        double r146051 = 1.0;
        double r146052 = exp(r146045);
        double r146053 = r146051 / r146052;
        double r146054 = log(r146053);
        double r146055 = r146054 - r146045;
        double r146056 = r146050 * r146055;
        return r146056;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.3

    \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
  2. Using strategy rm
  3. Applied flip--28.5

    \[\leadsto \frac{1}{x + 1} - \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}}\]
  4. Applied associate-/r/28.5

    \[\leadsto \frac{1}{x + 1} - \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)}\]
  5. Applied flip-+14.3

    \[\leadsto \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)\]
  6. Applied associate-/r/14.3

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x - 1\right)} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)\]
  7. Applied distribute-lft-out--13.7

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)}\]
  8. Simplified11.9

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{\left(\left(\left(x - 1\right) - x\right) - 1\right)}\]
  9. Using strategy rm
  10. Applied add-log-exp31.1

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(\left(x - 1\right) - \color{blue}{\log \left(e^{x}\right)}\right) - 1\right)\]
  11. Applied add-log-exp31.1

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(\left(x - \color{blue}{\log \left(e^{1}\right)}\right) - \log \left(e^{x}\right)\right) - 1\right)\]
  12. Applied add-log-exp31.1

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(\left(\color{blue}{\log \left(e^{x}\right)} - \log \left(e^{1}\right)\right) - \log \left(e^{x}\right)\right) - 1\right)\]
  13. Applied diff-log31.1

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(\color{blue}{\log \left(\frac{e^{x}}{e^{1}}\right)} - \log \left(e^{x}\right)\right) - 1\right)\]
  14. Applied diff-log31.1

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\color{blue}{\log \left(\frac{\frac{e^{x}}{e^{1}}}{e^{x}}\right)} - 1\right)\]
  15. Simplified0.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\log \color{blue}{\left(\frac{1}{e^{1}}\right)} - 1\right)\]
  16. Final simplification0.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\log \left(\frac{1}{e^{1}}\right) - 1\right)\]

Reproduce

herbie shell --seed 2019195 
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))