Average Error: 9.6 → 0.3
Time: 3.9m
Precision: 64
Internal Precision: 1088
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
\[\frac{2}{{x}^{3} - x}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.6
Target0.3
Herbie0.3
\[\frac{2}{x \cdot \left(x \cdot x - 1\right)}\]

Derivation

  1. Initial program 9.6

    \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
  2. Using strategy rm
  3. Applied add-cube-cbrt25.6

    \[\leadsto \left(\frac{1}{x + 1} - \frac{2}{x}\right) + \color{blue}{\left(\sqrt[3]{\frac{1}{x - 1}} \cdot \sqrt[3]{\frac{1}{x - 1}}\right) \cdot \sqrt[3]{\frac{1}{x - 1}}}\]
  4. Using strategy rm
  5. Applied cbrt-div25.1

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

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

    \[\leadsto \left(\frac{1}{x + 1} - \frac{2}{x}\right) + \left(\color{blue}{\frac{\sqrt[3]{1}}{\sqrt[3]{x - 1}}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{x - 1}}\right) \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{x - 1}}\]
  8. Applied frac-times25.1

    \[\leadsto \left(\frac{1}{x + 1} - \frac{2}{x}\right) + \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt[3]{x - 1} \cdot \sqrt[3]{x - 1}}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{x - 1}}\]
  9. Applied frac-times24.5

    \[\leadsto \left(\frac{1}{x + 1} - \frac{2}{x}\right) + \color{blue}{\frac{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}{\left(\sqrt[3]{x - 1} \cdot \sqrt[3]{x - 1}\right) \cdot \sqrt[3]{x - 1}}}\]
  10. Applied frac-sub28.7

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

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

    \[\leadsto \frac{\color{blue}{x \cdot \left(\left(x + 1\right) + \left(x - 1\right)\right) - \left(x - 1\right) \cdot \left(2 + x \cdot 2\right)}}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(\left(\sqrt[3]{x - 1} \cdot \sqrt[3]{x - 1}\right) \cdot \sqrt[3]{x - 1}\right)}\]
  13. Applied simplify25.3

    \[\leadsto \frac{x \cdot \left(\left(x + 1\right) + \left(x - 1\right)\right) - \left(x - 1\right) \cdot \left(2 + x \cdot 2\right)}{\color{blue}{\left(x \cdot x + x\right) \cdot \left(x - 1\right)}}\]
  14. Taylor expanded around 0 0.3

    \[\leadsto \frac{\color{blue}{2}}{\left(x \cdot x + x\right) \cdot \left(x - 1\right)}\]
  15. Taylor expanded around 0 0.3

    \[\leadsto \frac{2}{\color{blue}{{x}^{3} - x}}\]

Runtime

Time bar (total: 3.9m)Debug logProfile

herbie shell --seed '#(1072967564 1937075727 894099792 790700740 1036514779 1027793188)' 
(FPCore (x)
  :name "3frac (problem 3.3.3)"

  :herbie-target
  (/ 2 (* x (- (* x x) 1)))

  (+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1))))