Average Error: 29.4 → 0.2
Time: 18.3s
Precision: 64
Internal Precision: 1344
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 29.4

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

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

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

    \[\leadsto \frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{1 \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)}}\]
  7. Applied add-sqr-sqrt29.3

    \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}} \cdot \sqrt{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}}}{1 \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)}\]
  8. Applied times-frac29.3

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

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

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

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

Runtime

Time bar (total: 18.3s)Debug logProfile

herbie shell --seed 2018252 +o rules:numerics
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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