\sqrt{x \cdot x + x \cdot x}\sqrt{\left|x \cdot \sqrt{2}\right|} \cdot \sqrt{\left|x \cdot \sqrt{2}\right|}(FPCore (x) :precision binary64 (sqrt (+ (* x x) (* x x))))
(FPCore (x) :precision binary64 (* (sqrt (fabs (* x (sqrt 2.0)))) (sqrt (fabs (* x (sqrt 2.0))))))
double code(double x) {
return sqrt((x * x) + (x * x));
}
double code(double x) {
return sqrt(fabs(x * sqrt(2.0))) * sqrt(fabs(x * sqrt(2.0)));
}



Bits error versus x
Results
Initial program 30.6
Simplified30.6
rmApplied add-sqr-sqrt_binary6430.8
rmApplied add-exp-log_binary6432.5
rmApplied add-sqr-sqrt_binary6432.5
Simplified32.1
Simplified0.7
Final simplification0.7
herbie shell --seed 2020260
(FPCore (x)
:name "sqrt A"
:precision binary64
(sqrt (+ (* x x) (* x x))))