Average Error: 29.9 → 29.8
Time: 30.1s
Precision: 64
\[\sqrt{x + 1} - \sqrt{x}\]
\[(\left(\sqrt[3]{\sqrt{1 + x}} \cdot \left(\sqrt[3]{\left(\sqrt[3]{\sqrt{\sqrt{1 + x}}} \cdot \sqrt[3]{\sqrt{\sqrt{1 + x}}}\right) \cdot \sqrt[3]{\sqrt{\sqrt{1 + x}}}} \cdot \sqrt[3]{\sqrt{\sqrt{1 + x}}}\right)\right) \cdot \left(\sqrt[3]{\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{1 + x}}}\right) + \left(-\sqrt{x}\right))_*\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 29.9

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

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

    \[\leadsto \color{blue}{(\left(\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \left(\sqrt[3]{\sqrt{x + 1}}\right) + \left(-\sqrt{x}\right))_*}\]
  5. Using strategy rm
  6. Applied add-cube-cbrt29.9

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

    \[\leadsto (\left(\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \left(\sqrt[3]{\color{blue}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}}}\right) + \left(-\sqrt{x}\right))_*\]
  8. Applied cbrt-prod29.8

    \[\leadsto (\left(\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right)} + \left(-\sqrt{x}\right))_*\]
  9. Using strategy rm
  10. Applied add-sqr-sqrt29.8

    \[\leadsto (\left(\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\color{blue}{\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}}}\right) \cdot \left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right) + \left(-\sqrt{x}\right))_*\]
  11. Applied cbrt-prod29.8

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

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

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

Reproduce

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

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

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