Average Error: 29.6 → 0.3
Time: 2.7m
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{\sqrt{x} + \sqrt{\sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1} \cdot \left(\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}\right)}}\]

Error

Bits error versus x

Target

Original29.6
Target0.2
Herbie0.3
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 29.6

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

    \[\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.6

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

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

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

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

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

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

Reproduce

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

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

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