Average Error: 29.6 → 0.2
Time: 21.3s
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.6
Target0.2
Herbie0.2
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 29.6

    \[\sqrt{x + 1} - \sqrt{x}\]
  2. Using strategy rm
  3. Applied flip--29.4

    \[\leadsto \color{blue}{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity29.4

    \[\leadsto \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \color{blue}{1 \cdot \sqrt{x}}}\]
  6. Applied *-un-lft-identity29.4

    \[\leadsto \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{1 \cdot \sqrt{x + 1}} + 1 \cdot \sqrt{x}}\]
  7. Applied distribute-lft-out29.4

    \[\leadsto \frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{1 \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}}\]
  8. Applied add-cube-cbrt29.4

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}} \cdot \sqrt[3]{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}\right) \cdot \sqrt[3]{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}}}{1 \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}\]
  9. Applied times-frac29.4

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}} \cdot \sqrt[3]{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}}{1} \cdot \frac{\sqrt[3]{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}}{\sqrt{x + 1} + \sqrt{x}}}\]
  10. Simplified29.3

    \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}}{\sqrt{x + 1} + \sqrt{x}}\]
  11. Simplified0.2

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

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

Runtime

Time bar (total: 21.3s)Debug logProfile

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

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

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