Average Error: 29.8 → 0.2
Time: 14.0s
Precision: 64
Internal Precision: 1344
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{\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

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

Derivation

  1. Initial program 29.8

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}}\]
  5. Using strategy rm
  6. Applied add-log-exp31.5

    \[\leadsto \frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \color{blue}{\log \left(e^{\sqrt{x} \cdot \sqrt{x}}\right)}}{\sqrt{1 + x} + \sqrt{x}}\]
  7. Applied add-log-exp31.0

    \[\leadsto \frac{\color{blue}{\log \left(e^{\sqrt{1 + x} \cdot \sqrt{1 + x}}\right)} - \log \left(e^{\sqrt{x} \cdot \sqrt{x}}\right)}{\sqrt{1 + x} + \sqrt{x}}\]
  8. Applied diff-log31.0

    \[\leadsto \frac{\color{blue}{\log \left(\frac{e^{\sqrt{1 + x} \cdot \sqrt{1 + x}}}{e^{\sqrt{x} \cdot \sqrt{x}}}\right)}}{\sqrt{1 + x} + \sqrt{x}}\]
  9. Simplified0.2

    \[\leadsto \frac{\log \color{blue}{e}}{\sqrt{1 + x} + \sqrt{x}}\]
  10. Final simplification0.2

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

Runtime

Time bar (total: 14.0s)Debug logProfile

herbie shell --seed 2018230 
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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