Average Error: 28.8 → 0.3
Time: 19.8s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{\frac{1}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}}{\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

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

Derivation

  1. Initial program 28.8

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}}\]
  5. Taylor expanded around inf 0.2

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{\sqrt{1 + x} + \sqrt{x}}}}{\sqrt{\sqrt{1 + x} + \sqrt{x}}}}\]
  9. Final simplification0.3

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

Runtime

Time bar (total: 19.8s)Debug logProfile

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

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

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