Average Error: 30.1 → 0.2
Time: 3.7s
Precision: 64
Internal precision: 1408
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 30.1

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

    \[\leadsto \color{blue}{\frac{{\left(\sqrt{x + 1}\right)}^2 - {\left(\sqrt{x}\right)}^2}{\sqrt{x + 1} + \sqrt{x}}}\]
  4. Applied simplify 0.2

    \[\leadsto \frac{\color{blue}{1}}{\sqrt{x + 1} + \sqrt{x}}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 3.7s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1067773715 2765207660 218871639 3688798924 2755544087 2054563380)'
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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