Average Error: 29.8 → 29.8
Time: 23.2s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[e^{\log \left((\left(\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}\right) \cdot \left(\sqrt{\sqrt[3]{\sqrt[3]{1 + x} \cdot \left(\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}\right)}}\right) + \left(-\sqrt{x}\right))_*\right)}\]

Error

Bits error versus x

Target

Original29.8
Target0.2
Herbie29.8
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 29.8

    \[\sqrt{x + 1} - \sqrt{x}\]
  2. Using strategy rm
  3. Applied add-cube-cbrt29.9

    \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} - \sqrt{x}\]
  4. Applied sqrt-prod29.9

    \[\leadsto \color{blue}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}} - \sqrt{x}\]
  5. Applied fma-neg29.9

    \[\leadsto \color{blue}{(\left(\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right) \cdot \left(\sqrt{\sqrt[3]{x + 1}}\right) + \left(-\sqrt{x}\right))_*}\]
  6. Using strategy rm
  7. Applied add-exp-log29.8

    \[\leadsto \color{blue}{e^{\log \left((\left(\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right) \cdot \left(\sqrt{\sqrt[3]{x + 1}}\right) + \left(-\sqrt{x}\right))_*\right)}}\]
  8. Using strategy rm
  9. Applied add-cbrt-cube29.8

    \[\leadsto e^{\log \left((\left(\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right) \cdot \left(\sqrt{\color{blue}{\sqrt[3]{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}}}\right) + \left(-\sqrt{x}\right))_*\right)}\]
  10. Final simplification29.8

    \[\leadsto e^{\log \left((\left(\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}\right) \cdot \left(\sqrt{\sqrt[3]{\sqrt[3]{1 + x} \cdot \left(\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}\right)}}\right) + \left(-\sqrt{x}\right))_*\right)}\]

Reproduce

herbie shell --seed 2019088 +o rules:numerics
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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