Average Error: 30.1 → 0.2
Time: 9.8s
Precision: 64
Internal Precision: 1344
\[\sqrt{x + 1} - \sqrt{x}\]
\[(e^{\log_* (1 + \frac{1}{\sqrt{x} + \sqrt{x + 1}})} - 1)^*\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 30.1

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

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

    \[\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 +-commutative0.2

    \[\leadsto \frac{1}{\color{blue}{\sqrt{x} + \sqrt{1 + x}}}\]
  8. Using strategy rm
  9. Applied expm1-log1p-u0.2

    \[\leadsto \color{blue}{(e^{\log_* (1 + \frac{1}{\sqrt{x} + \sqrt{1 + x}})} - 1)^*}\]
  10. Final simplification0.2

    \[\leadsto (e^{\log_* (1 + \frac{1}{\sqrt{x} + \sqrt{x + 1}})} - 1)^*\]

Runtime

Time bar (total: 9.8s)Debug logProfile

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

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

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