Average Error: 19.8 → 0.3
Time: 1.5m
Precision: 64
Internal Precision: 1088
\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\]
\[\frac{\frac{1}{\frac{x}{\sqrt{x + 1}} + \frac{x}{\sqrt{x}}}}{x + 1}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 19.8

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{1 \cdot \left(x + 1\right) - x \cdot 1}{x \cdot \left(x + 1\right)}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}\]
  7. Applied associate-/l/19.2

    \[\leadsto \color{blue}{\frac{1 \cdot \left(x + 1\right) - x \cdot 1}{\left(\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}\right) \cdot \left(x \cdot \left(x + 1\right)\right)}}\]
  8. Using strategy rm
  9. Applied associate-/r*19.2

    \[\leadsto \color{blue}{\frac{\frac{1 \cdot \left(x + 1\right) - x \cdot 1}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{x + 1}}}}{x \cdot \left(x + 1\right)}}\]
  10. Applied simplify5.7

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{\sqrt{x + 1}} + \frac{1}{\sqrt{x}}}}}{x \cdot \left(x + 1\right)}\]
  11. Using strategy rm
  12. Applied associate-/r*0.3

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

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{x}{\sqrt{x + 1}} + \frac{x}{\sqrt{x}}}}}{x + 1}\]

Runtime

Time bar (total: 1.5m)Debug logProfile

herbie shell --seed 2018208 +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)))))