\sqrt{x + 1} - \sqrt{x}\frac{1}{\left(\left|\sqrt[3]{x + 1}\right| \cdot \sqrt{\sqrt{\sqrt[3]{x + 1}}}\right) \cdot \sqrt{\sqrt{\sqrt[3]{x + 1}}} + \sqrt{x}}double code(double x) {
return (sqrt((x + 1.0)) - sqrt(x));
}
double code(double x) {
return (1.0 / (((fabs(cbrt((x + 1.0))) * sqrt(sqrt(cbrt((x + 1.0))))) * sqrt(sqrt(cbrt((x + 1.0))))) + sqrt(x)));
}




Bits error versus x
Results
| Original | 29.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 29.8
rmApplied flip--29.6
Simplified0.2
rmApplied add-cube-cbrt0.3
Applied sqrt-prod0.3
Simplified0.3
rmApplied add-sqr-sqrt0.3
Applied sqrt-prod0.3
Applied associate-*r*0.3
Final simplification0.3
herbie shell --seed 2020058
(FPCore (x)
:name "Main:bigenough3 from C"
:precision binary64
:herbie-target
(/ 1 (+ (sqrt (+ x 1)) (sqrt x)))
(- (sqrt (+ x 1)) (sqrt x)))