Average Error: 14.7 → 0.1
Time: 3.2s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\left(\frac{\sqrt{1}}{x + 1} \cdot \frac{\sqrt{1}}{x - 1}\right) \cdot \left(-2\right)\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\left(\frac{\sqrt{1}}{x + 1} \cdot \frac{\sqrt{1}}{x - 1}\right) \cdot \left(-2\right)
double code(double x) {
	return ((1.0 / (x + 1.0)) - (1.0 / (x - 1.0)));
}
double code(double x) {
	return (((sqrt(1.0) / (x + 1.0)) * (sqrt(1.0) / (x - 1.0))) * -2.0);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.7

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

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

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

    \[\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.7

    \[\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--14.1

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)}\]
  8. Using strategy rm
  9. Applied add-cbrt-cube14.1

    \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot \left(x \cdot x - 1 \cdot 1\right)\right) \cdot \left(x \cdot x - 1 \cdot 1\right)}}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  10. Applied add-cbrt-cube14.1

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(1 \cdot 1\right) \cdot 1}}}{\sqrt[3]{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot \left(x \cdot x - 1 \cdot 1\right)\right) \cdot \left(x \cdot x - 1 \cdot 1\right)}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  11. Applied cbrt-undiv14.1

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\left(1 \cdot 1\right) \cdot 1}{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot \left(x \cdot x - 1 \cdot 1\right)\right) \cdot \left(x \cdot x - 1 \cdot 1\right)}}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  12. Simplified14.1

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{1}{x \cdot x - 1 \cdot 1}\right)}^{3}}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  13. Taylor expanded around 0 10.3

    \[\leadsto \sqrt[3]{{\left(\frac{1}{x \cdot x - 1 \cdot 1}\right)}^{3}} \cdot \color{blue}{\left(-2\right)}\]
  14. Using strategy rm
  15. Applied difference-of-squares10.3

    \[\leadsto \sqrt[3]{{\left(\frac{1}{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}}\right)}^{3}} \cdot \left(-2\right)\]
  16. Applied add-sqr-sqrt10.3

    \[\leadsto \sqrt[3]{{\left(\frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{\left(x + 1\right) \cdot \left(x - 1\right)}\right)}^{3}} \cdot \left(-2\right)\]
  17. Applied times-frac10.3

    \[\leadsto \sqrt[3]{{\color{blue}{\left(\frac{\sqrt{1}}{x + 1} \cdot \frac{\sqrt{1}}{x - 1}\right)}}^{3}} \cdot \left(-2\right)\]
  18. Applied unpow-prod-down10.3

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{\sqrt{1}}{x + 1}\right)}^{3} \cdot {\left(\frac{\sqrt{1}}{x - 1}\right)}^{3}}} \cdot \left(-2\right)\]
  19. Applied cbrt-prod5.4

    \[\leadsto \color{blue}{\left(\sqrt[3]{{\left(\frac{\sqrt{1}}{x + 1}\right)}^{3}} \cdot \sqrt[3]{{\left(\frac{\sqrt{1}}{x - 1}\right)}^{3}}\right)} \cdot \left(-2\right)\]
  20. Simplified5.3

    \[\leadsto \left(\color{blue}{\frac{\sqrt{1}}{x + 1}} \cdot \sqrt[3]{{\left(\frac{\sqrt{1}}{x - 1}\right)}^{3}}\right) \cdot \left(-2\right)\]
  21. Simplified0.1

    \[\leadsto \left(\frac{\sqrt{1}}{x + 1} \cdot \color{blue}{\frac{\sqrt{1}}{x - 1}}\right) \cdot \left(-2\right)\]
  22. Final simplification0.1

    \[\leadsto \left(\frac{\sqrt{1}}{x + 1} \cdot \frac{\sqrt{1}}{x - 1}\right) \cdot \left(-2\right)\]

Reproduce

herbie shell --seed 2020065 
(FPCore (x)
  :name "Asymptote A"
  :precision binary64
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))