Average Error: 30.2 → 0.2
Time: 16.4s
Precision: 64
Internal Precision: 1344
\[\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

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

Derivation

  1. Initial program 30.2

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

    \[\leadsto \color{blue}{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity30.0

    \[\leadsto \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \color{blue}{1 \cdot \sqrt{x}}}\]
  6. Applied *-un-lft-identity30.0

    \[\leadsto \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{1 \cdot \sqrt{x + 1}} + 1 \cdot \sqrt{x}}\]
  7. Applied distribute-lft-out30.0

    \[\leadsto \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{1 \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}}\]
  8. Applied *-un-lft-identity30.0

    \[\leadsto \frac{\color{blue}{1 \cdot \left(\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}\right)}}{1 \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}\]
  9. Applied times-frac30.0

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}\]
  10. Simplified30.0

    \[\leadsto \color{blue}{1} \cdot \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}\]
  11. Simplified0.2

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

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

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

    \[\leadsto 1 \cdot \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}}}\]
  17. Applied pow-prod-down0.2

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

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

    \[\leadsto 1 \cdot {\left(\left(\sqrt{1 + x} + \sqrt{x}\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)\right)}^{\color{blue}{\frac{-1}{2}}}\]
  20. 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: 16.4s)Debug logProfile

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

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

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