Average Error: 29.7 → 0.2
Time: 31.2s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[{\left(\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)\right)}^{\frac{-1}{2}}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original29.7
Target0.2
Herbie0.2
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 29.7

    \[\sqrt{x + 1} - \sqrt{x}\]
  2. Initial simplification29.7

    \[\leadsto \sqrt{1 + x} - \sqrt{x}\]
  3. Using strategy rm
  4. Applied flip--29.6

    \[\leadsto \color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}}\]
  5. Taylor expanded around 0 0.2

    \[\leadsto \frac{\color{blue}{1}}{\sqrt{1 + x} + \sqrt{x}}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.4

    \[\leadsto \frac{1}{\color{blue}{\sqrt{\sqrt{1 + x} + \sqrt{x}} \cdot \sqrt{\sqrt{1 + x} + \sqrt{x}}}}\]
  8. Using strategy rm
  9. Applied pow1/20.4

    \[\leadsto \frac{1}{\sqrt{\sqrt{1 + x} + \sqrt{x}} \cdot \color{blue}{{\left(\sqrt{1 + x} + \sqrt{x}\right)}^{\frac{1}{2}}}}\]
  10. Applied pow1/20.4

    \[\leadsto \frac{1}{\color{blue}{{\left(\sqrt{1 + x} + \sqrt{x}\right)}^{\frac{1}{2}}} \cdot {\left(\sqrt{1 + x} + \sqrt{x}\right)}^{\frac{1}{2}}}\]
  11. Applied pow-prod-down0.2

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

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

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

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

Runtime

Time bar (total: 31.2s)Debug logProfile

herbie shell --seed 2018336 
(FPCore (x)
  :name "2sqrt (example 3.1)"

  :herbie-target
  (/ 1 (+ (sqrt (+ x 1)) (sqrt x)))

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