Average Error: 29.5 → 0.2
Time: 14.9s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{(\left(\sqrt{\sqrt{x + 1}}\right) \cdot \left(\sqrt{\sqrt{x + 1}}\right) + \left(\sqrt{x}\right))_*}\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 29.5

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

    \[\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. 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. Applied fma-def0.2

    \[\leadsto \frac{1}{\color{blue}{(\left(\sqrt{\sqrt{1 + x}}\right) \cdot \left(\sqrt{\sqrt{1 + x}}\right) + \left(\sqrt{x}\right))_*}}\]
  10. Final simplification0.2

    \[\leadsto \frac{1}{(\left(\sqrt{\sqrt{x + 1}}\right) \cdot \left(\sqrt{\sqrt{x + 1}}\right) + \left(\sqrt{x}\right))_*}\]

Runtime

Time bar (total: 14.9s)Debug logProfile

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

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

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