Average Error: 20.1 → 0.4
Time: 23.2s
Precision: 64
Internal precision: 128
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}\]

Error

Bits error versus x

Target

Original20.1
Comparison0.7
Herbie0.4
\[ \frac{1}{\left(x + 1\right) \cdot \sqrt{x} + x \cdot \sqrt{x + 1}} \]

Derivation

  1. Initial program 20.1

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(\sqrt{1 + x}\right)}^2 - {\left(\sqrt{x}\right)}^2}{\sqrt{1 + x} + \sqrt{x}}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  7. Applied simplify 0.4

    \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x} \cdot \sqrt{x + 1}}\]
  8. Using strategy rm
  9. Applied div-inv 0.4

    \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}} \cdot \frac{1}{\sqrt{x} \cdot \sqrt{x + 1}}}\]
  10. Removed slow pow expressions

Runtime

Time bar (total: 23.2s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3648191583 2304238870 1651587877 1581571448 3486629694 1616363524)'
(FPCore (x)
  :name "2isqrt (example 3.6)"

  :target
  (/ 1 (+ (* (+ x 1) (sqrt x)) (* x (sqrt (+ x 1)))))

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