Average Error: 30.0 → 0.2
Time: 19.1s
Precision: 64
Internal Precision: 1344
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}} \cdot \sqrt{1}}{\sqrt{\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.0
Target0.2
Herbie0.2
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 30.0

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

    \[\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 sqrt-div0.3

    \[\leadsto \sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}}\]
  9. Applied associate-*r/0.2

    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}} \cdot \sqrt{1}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}}\]

Runtime

Time bar (total: 19.1s)Debug logProfile

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

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

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