Average Error: 29.8 → 0.4
Time: 17.1s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{\sqrt[3]{\sqrt{x + 1}} \cdot \left(\sqrt[3]{\sqrt{x + 1}} \cdot \left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right)\right) + \sqrt{x}}\]

Error

Bits error versus x

Target

Original29.8
Target0.2
Herbie0.4
\[\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 \color{blue}{\left(\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \sqrt[3]{\sqrt{x + 1}}} - \sqrt{x}\]
  4. Using strategy rm
  5. Applied add-cube-cbrt29.8

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

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

    \[\leadsto \left(\color{blue}{\left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right)} \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \sqrt[3]{\sqrt{x + 1}} - \sqrt{x}\]
  8. Using strategy rm
  9. Applied flip--29.7

    \[\leadsto \color{blue}{\frac{\left(\left(\left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right) \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \left(\left(\left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right) \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \sqrt[3]{\sqrt{x + 1}}\right) - \sqrt{x} \cdot \sqrt{x}}{\left(\left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right) \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \sqrt[3]{\sqrt{x + 1}} + \sqrt{x}}}\]
  10. Taylor expanded around 0 0.4

    \[\leadsto \frac{\color{blue}{1}}{\left(\left(\sqrt[3]{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt{\sqrt[3]{x + 1}}}\right) \cdot \sqrt[3]{\sqrt{x + 1}}\right) \cdot \sqrt[3]{\sqrt{x + 1}} + \sqrt{x}}\]
  11. Final simplification0.4

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

Reproduce

herbie shell --seed 2019053 
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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