Average Error: 19.5 → 0.5
Time: 43.8s
Precision: 64
Internal Precision: 1088
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\sqrt{\frac{\frac{1}{\sqrt{1 + x}}}{(\left(\sqrt{x}\right) \cdot \left(\sqrt{1 + x}\right) + x)_*}} \cdot \sqrt{\frac{\frac{1}{\sqrt{1 + x}}}{(\left(\sqrt{x}\right) \cdot \left(\sqrt{1 + x}\right) + x)_*}}\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 19.5

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

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

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

    \[\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 associate-/l/19.3

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

    \[\leadsto \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{(\left(\sqrt{x + 1}\right) \cdot x + \left((x \cdot \left(\sqrt{x}\right) + \left(\sqrt{x}\right))_*\right))_*}}\]
  9. Using strategy rm
  10. Applied add-sqr-sqrt19.4

    \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{(\left(\sqrt{x + 1}\right) \cdot x + \left((x \cdot \left(\sqrt{x}\right) + \left(\sqrt{x}\right))_*\right))_*}} \cdot \sqrt{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{(\left(\sqrt{x + 1}\right) \cdot x + \left((x \cdot \left(\sqrt{x}\right) + \left(\sqrt{x}\right))_*\right))_*}}}\]
  11. Applied simplify19.4

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

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

Runtime

Time bar (total: 43.8s)Debug logProfile

herbie shell --seed '#(1071821486 549052472 3784827256 1559736200 3548510075 881134285)' +o rules:numerics
(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)))))