Average Error: 20.3 → 1.0
Time: 47.4s
Precision: 64
Internal Precision: 1152
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{\frac{1}{\sqrt[3]{{\left(\sqrt{1 + x} + \sqrt{x}\right)}^{3}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]

Error

Bits error versus x

Target

Original20.3
Target0.8
Herbie1.0
\[\frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}}\]

Derivation

  1. Initial program 20.3

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

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

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

    \[\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-cube1.0

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

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

Runtime

Time bar (total: 47.4s)Debug logProfile

herbie shell --seed '#(1070609872 3456127585 2380521889 2328837196 1765472538 734540918)' 
(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)))))