Average Error: 29.3 → 0.2
Time: 5.0s
Precision: 64
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{\frac{\sqrt[3]{1 + 0} \cdot \sqrt[3]{1 + 0}}{\sqrt{1}}}{\frac{\sqrt{x + 1} + \sqrt{x}}{\sqrt[3]{1 + 0}}}\]
\sqrt{x + 1} - \sqrt{x}
\frac{\frac{\sqrt[3]{1 + 0} \cdot \sqrt[3]{1 + 0}}{\sqrt{1}}}{\frac{\sqrt{x + 1} + \sqrt{x}}{\sqrt[3]{1 + 0}}}
double code(double x) {
	return (sqrt((x + 1.0)) - sqrt(x));
}
double code(double x) {
	return (((cbrt((1.0 + 0.0)) * cbrt((1.0 + 0.0))) / sqrt(1.0)) / ((sqrt((x + 1.0)) + sqrt(x)) / cbrt((1.0 + 0.0))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 29.3

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

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

    \[\leadsto \frac{\color{blue}{1 + 0}}{\sqrt{x + 1} + \sqrt{x}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.3

    \[\leadsto \frac{1 + 0}{\color{blue}{\sqrt{\sqrt{x + 1} + \sqrt{x}} \cdot \sqrt{\sqrt{x + 1} + \sqrt{x}}}}\]
  7. Applied associate-/r*0.3

    \[\leadsto \color{blue}{\frac{\frac{1 + 0}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.3

    \[\leadsto \frac{\frac{1 + 0}{\sqrt{\color{blue}{1 \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}}}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}\]
  10. Applied sqrt-prod0.3

    \[\leadsto \frac{\frac{1 + 0}{\color{blue}{\sqrt{1} \cdot \sqrt{\sqrt{x + 1} + \sqrt{x}}}}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}\]
  11. Applied add-cube-cbrt0.3

    \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt[3]{1 + 0} \cdot \sqrt[3]{1 + 0}\right) \cdot \sqrt[3]{1 + 0}}}{\sqrt{1} \cdot \sqrt{\sqrt{x + 1} + \sqrt{x}}}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}\]
  12. Applied times-frac0.3

    \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{1 + 0} \cdot \sqrt[3]{1 + 0}}{\sqrt{1}} \cdot \frac{\sqrt[3]{1 + 0}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}}}{\sqrt{\sqrt{x + 1} + \sqrt{x}}}\]
  13. Applied associate-/l*0.4

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

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

    \[\leadsto \frac{\frac{\sqrt[3]{1 + 0} \cdot \sqrt[3]{1 + 0}}{\sqrt{1}}}{\frac{\sqrt{x + 1} + \sqrt{x}}{\sqrt[3]{1 + 0}}}\]

Reproduce

herbie shell --seed 2020066 +o rules:numerics
(FPCore (x)
  :name "Main:bigenough3 from C"
  :precision binary64

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

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