Average Error: 30.2 → 0.2
Time: 19.5s
Precision: 64
Internal Precision: 1344
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{{\left(\sqrt{1 + x}\right)}^{\left(\frac{1}{2} + \frac{1}{2}\right)} + \sqrt{x}}\]

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 add-sqr-sqrt30.2

    \[\leadsto \sqrt{\color{blue}{\sqrt{x + 1} \cdot \sqrt{x + 1}}} - \sqrt{x}\]
  4. Applied sqrt-prod30.3

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

    \[\leadsto \color{blue}{\frac{\left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right) \cdot \left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right) - \sqrt{x} \cdot \sqrt{x}}{\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}} + \sqrt{x}}}\]
  7. Using strategy rm
  8. Applied add-log-exp31.9

    \[\leadsto \frac{\left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right) \cdot \left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right) - \color{blue}{\log \left(e^{\sqrt{x} \cdot \sqrt{x}}\right)}}{\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}} + \sqrt{x}}\]
  9. Applied add-log-exp31.3

    \[\leadsto \frac{\color{blue}{\log \left(e^{\left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right) \cdot \left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right)}\right)} - \log \left(e^{\sqrt{x} \cdot \sqrt{x}}\right)}{\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}} + \sqrt{x}}\]
  10. Applied diff-log31.3

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

    \[\leadsto \frac{\log \color{blue}{e}}{\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}} + \sqrt{x}}\]
  12. Using strategy rm
  13. Applied pow1/20.3

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

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

    \[\leadsto \frac{\log e}{\color{blue}{{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{2} + \frac{1}{2}\right)}} + \sqrt{x}}\]
  16. Final simplification0.2

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

Runtime

Time bar (total: 19.5s)Debug logProfile

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

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

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