Average Error: 20.3 → 0.8
Time: 20.6s
Precision: 64
Internal Precision: 1088
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{1}{x \cdot \sqrt{x + 1} + \sqrt{x + 1} \cdot \left(\sqrt{x + 1} \cdot \sqrt{x}\right)}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original20.3
Target0.7
Herbie0.8
\[\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. Simplified20.3

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

    \[\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/20.1

    \[\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. Simplified0.8

    \[\leadsto \frac{\color{blue}{1}}{\left(\sqrt{x} \cdot \sqrt{x + 1}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}\]
  9. Using strategy rm
  10. Applied distribute-lft-in0.8

    \[\leadsto \frac{1}{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x + 1}\right) \cdot \sqrt{x + 1} + \left(\sqrt{x} \cdot \sqrt{x + 1}\right) \cdot \sqrt{x}}}\]
  11. Simplified0.8

    \[\leadsto \frac{1}{\left(\sqrt{x} \cdot \sqrt{x + 1}\right) \cdot \sqrt{x + 1} + \color{blue}{\sqrt{x + 1} \cdot x}}\]
  12. Final simplification0.8

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

Runtime

Time bar (total: 20.6s)Debug logProfile

herbie shell --seed 2018219 
(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)))))