Average Error: 19.9 → 0.3
Time: 20.5s
Precision: 64
Internal Precision: 1152
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{1}{\sqrt{x}} \cdot \frac{1}{(\left(\sqrt{x + 1}\right) \cdot \left(\sqrt{x}\right) + \left(x + 1\right))_*}\]

Error

Bits error versus x

Target

Original19.9
Target0.7
Herbie0.3
\[\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.9

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

    \[\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 *-un-lft-identity0.4

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

    \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{\sqrt{x + 1}}}\]
  11. Applied simplify0.3

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

Runtime

Time bar (total: 20.5s)Debug logProfile

herbie shell --seed '#(1064300848 3212030778 2049303162 3567222883 2277747821 1384278011)' +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)))))