Average Error: 30.8 → 0.2
Time: 15.7s
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

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

Derivation

  1. Initial program 30.8

    \[\sqrt{x + 1} - \sqrt{x}\]
  2. Initial simplification30.8

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

    \[\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-identity30.6

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

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

    \[\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)}}\]
  9. Applied *-un-lft-identity30.6

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

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

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

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

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

Runtime

Time bar (total: 15.7s)Debug logProfile

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

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

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