Average Error: 20.1 → 0.7
Time: 19.3s
Precision: 64
Internal Precision: 1088
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{1}{(x \cdot \left(\sqrt{\sqrt[3]{x + 1}} \cdot \left|\sqrt[3]{x + 1}\right|\right) + \left((\left(\sqrt{x}\right) \cdot x + \left(\sqrt{x}\right))_*\right))_*}\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 20.1

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
  2. Initial simplification20.1

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

    \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}}\]
  5. Simplified20.0

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

    \[\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}}\]
  8. Applied associate-/l/19.8

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

    \[\leadsto \frac{\color{blue}{1}}{\left(\sqrt{x} \cdot \sqrt{x + 1}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}\]
  10. Using strategy rm
  11. Applied pow10.8

    \[\leadsto \frac{1}{\left(\sqrt{x} \cdot \sqrt{x + 1}\right) \cdot \color{blue}{{\left(\sqrt{x + 1} + \sqrt{x}\right)}^{1}}}\]
  12. Applied pow10.8

    \[\leadsto \frac{1}{\left(\sqrt{x} \cdot \color{blue}{{\left(\sqrt{x + 1}\right)}^{1}}\right) \cdot {\left(\sqrt{x + 1} + \sqrt{x}\right)}^{1}}\]
  13. Applied pow10.8

    \[\leadsto \frac{1}{\left(\color{blue}{{\left(\sqrt{x}\right)}^{1}} \cdot {\left(\sqrt{x + 1}\right)}^{1}\right) \cdot {\left(\sqrt{x + 1} + \sqrt{x}\right)}^{1}}\]
  14. Applied pow-prod-down0.8

    \[\leadsto \frac{1}{\color{blue}{{\left(\sqrt{x} \cdot \sqrt{x + 1}\right)}^{1}} \cdot {\left(\sqrt{x + 1} + \sqrt{x}\right)}^{1}}\]
  15. Applied pow-prod-down0.8

    \[\leadsto \frac{1}{\color{blue}{{\left(\left(\sqrt{x} \cdot \sqrt{x + 1}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)\right)}^{1}}}\]
  16. Simplified0.7

    \[\leadsto \frac{1}{{\color{blue}{\left((x \cdot \left(\sqrt{x + 1}\right) + \left((\left(\sqrt{x}\right) \cdot x + \left(\sqrt{x}\right))_*\right))_*\right)}}^{1}}\]
  17. Using strategy rm
  18. Applied add-cube-cbrt0.7

    \[\leadsto \frac{1}{{\left((x \cdot \left(\sqrt{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}}\right) + \left((\left(\sqrt{x}\right) \cdot x + \left(\sqrt{x}\right))_*\right))_*\right)}^{1}}\]
  19. Applied sqrt-prod0.7

    \[\leadsto \frac{1}{{\left((x \cdot \color{blue}{\left(\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}\right)} + \left((\left(\sqrt{x}\right) \cdot x + \left(\sqrt{x}\right))_*\right))_*\right)}^{1}}\]
  20. Simplified0.7

    \[\leadsto \frac{1}{{\left((x \cdot \left(\color{blue}{\left|\sqrt[3]{1 + x}\right|} \cdot \sqrt{\sqrt[3]{x + 1}}\right) + \left((\left(\sqrt{x}\right) \cdot x + \left(\sqrt{x}\right))_*\right))_*\right)}^{1}}\]
  21. Final simplification0.7

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

Runtime

Time bar (total: 19.3s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.70.70.00.70%
herbie shell --seed 2018286 +o rules:numerics
(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)))))