Average Error: 19.7 → 0.5
Time: 25.6s
Precision: 64
Internal Precision: 1152
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{\sqrt[3]{\frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}}}{\sqrt{x + 1} \cdot \sqrt{x}}\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 19.7

    \[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
  2. Using strategy rm
  3. Applied frac-sub19.6

    \[\leadsto \color{blue}{\frac{1 \cdot \sqrt{x + 1} - \sqrt{x} \cdot 1}{\sqrt{x} \cdot \sqrt{x + 1}}}\]
  4. Applied simplify19.6

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

    \[\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}}\]
  7. Applied simplify0.4

    \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  8. Using strategy rm
  9. Applied add-cbrt-cube0.5

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} \cdot \frac{1}{\sqrt{x + 1} + \sqrt{x}}\right) \cdot \frac{1}{\sqrt{x + 1} + \sqrt{x}}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  10. Applied simplify0.5

    \[\leadsto \frac{\sqrt[3]{\color{blue}{\frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  11. Using strategy rm
  12. Applied add-sqr-sqrt0.5

    \[\leadsto \frac{\sqrt[3]{\color{blue}{\sqrt{\frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}} \cdot \sqrt{\frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  13. Removed slow pow expressions.
  14. Applied simplify0.5

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

Runtime

Time bar (total: 25.6s)Debug log

herbie shell --seed '#(633950927 2092594946 1442981 2827247922 2812758452 390991499)' 
(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)))))