Average Error: 19.6 → 0.2
Time: 1.2m
Precision: 64
Internal Precision: 1088
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[{x}^{\left(-\frac{1}{2}\right)} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x + 1}}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 19.6

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

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

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

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

    \[\leadsto \frac{\frac{\color{blue}{1}}{\sqrt{1 + x} + \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{1 + x} + \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{1 + x} + \sqrt{x}}}{\sqrt{x + 1}}}\]
  11. Using strategy rm
  12. Applied pow1/20.4

    \[\leadsto \frac{1}{\color{blue}{{x}^{\frac{1}{2}}}} \cdot \frac{\frac{1}{\sqrt{1 + x} + \sqrt{x}}}{\sqrt{x + 1}}\]
  13. Applied pow-flip0.2

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

Runtime

Time bar (total: 1.2m)Debug logProfile

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