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

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 29.9

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} \cdot \frac{1}{\sqrt{x + 1} + \sqrt{x}}\right)}^{\frac{1}{2}}}\]
  11. Applied simplify0.3

    \[\leadsto {\color{blue}{\left(\frac{1}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}\right)}}^{\frac{1}{2}}\]
  12. Using strategy rm
  13. Applied pow10.3

    \[\leadsto {\left(\frac{1}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \color{blue}{{\left(\sqrt{x + 1} + \sqrt{x}\right)}^{1}}}\right)}^{\frac{1}{2}}\]
  14. Applied pow10.3

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

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

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

Runtime

Time bar (total: 29.2s)Debug logProfile

herbie shell --seed '#(1071725047 233389029 2036512464 3988615230 2972226563 1111574017)' 
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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