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

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 19.9

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

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

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

    \[\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-cube-cbrt0.5

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

    \[\leadsto \frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x} \cdot \color{blue}{\left(\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}\right)}}\]
  11. Applied associate-*r*0.5

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

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

Runtime

Time bar (total: 37.8s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o reduce:binary-search
(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)))))