Average Error: 20.5 → 0.5
Time: 44.4s
Precision: 64
Internal Precision: 1088
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x}} \cdot \left(\frac{\sqrt{1}}{\left|\sqrt[3]{1 + x}\right|} \cdot \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{\sqrt[3]{x + 1}}}\right)\]

Error

Bits error versus x

Target

Original20.5
Target0.6
Herbie0.5
\[\frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}}\]

Derivation

  1. Initial program 20.5

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
  2. Using strategy rm
  3. Applied frac-sub20.4

    \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}}\]
  4. Applied simplify20.4

    \[\leadsto \frac{\color{blue}{\sqrt{x + 1} - \sqrt{x}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  5. Using strategy rm
  6. Applied flip--20.2

    \[\leadsto \frac{\color{blue}{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  7. Applied simplify0.4

    \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt0.5

    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}} \cdot \sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  10. Applied times-frac0.5

    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x}} \cdot \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x + 1}}}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt0.5

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

    \[\leadsto \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x}} \cdot \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\color{blue}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}}}\]
  14. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x}} \cdot \frac{\sqrt{\color{blue}{1 \cdot \frac{1}{\sqrt{x + 1} + \sqrt{x}}}}}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}}\]
  15. Applied sqrt-prod0.5

    \[\leadsto \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x}} \cdot \frac{\color{blue}{\sqrt{1} \cdot \sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}}\]
  16. Applied times-frac0.5

    \[\leadsto \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x}} \cdot \color{blue}{\left(\frac{\sqrt{1}}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{\sqrt[3]{x + 1}}}\right)}\]
  17. Applied simplify0.5

    \[\leadsto \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{x}} \cdot \left(\color{blue}{\frac{\sqrt{1}}{\left|\sqrt[3]{1 + x}\right|}} \cdot \frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{\sqrt[3]{x + 1}}}\right)\]

Runtime

Time bar (total: 44.4s)Debug logProfile

herbie shell --seed '#(1072330854 3074818769 591214268 3603999196 3863745332 3332387116)' 
(FPCore (x)
  :name "2isqrt (example 3.6)"

  :herbie-target
  (/ 1 (+ (* (+ x 1) (sqrt x)) (* x (sqrt (+ x 1)))))

  (- (/ 1 (sqrt x)) (/ 1 (sqrt (+ x 1)))))