Average Error: 29.9 → 0.3
Time: 4.4s
Precision: 64
Internal precision: 1408
\[\sqrt{x + 1} - \sqrt{x}\]
\[{\left(\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}\right)}^2\]

Error

Bits error versus x

Target

Original29.9
Comparison0.2
Herbie0.3
\[ \frac{1}{\sqrt{x + 1} + \sqrt{x}} \]

Derivation

  1. Initial program 29.9

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

    \[\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. Using strategy rm
  6. Applied add-sqr-sqrt 0.3

    \[\leadsto \color{blue}{{\left(\sqrt{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}\right)}^2}\]
  7. Removed slow pow expressions

Runtime

Time bar (total: 4.4s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064555532 179913862 452496668 2441903500 287849034 462453547)'
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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