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

Derivation

  1. Initial program 30.3

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

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

    \[\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 0 0.2

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

    \[\leadsto \frac{1}{\sqrt{\color{blue}{\sqrt{1 + x} \cdot \sqrt{1 + x}}} + \sqrt{x}}\]
  8. Applied sqrt-prod0.3

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

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

Runtime

Time bar (total: 13.7s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.30.30.10.20%
herbie shell --seed 2018285 +o rules:numerics
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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