\sqrt{{x}^{2} + {x}^{2}}\begin{array}{l}
\mathbf{if}\;x \leq -2.8491681377424 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{{x}^{2} \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot {x}^{1}\\
\end{array}(FPCore (x) :precision binary64 (sqrt (+ (pow x 2.0) (pow x 2.0))))
(FPCore (x) :precision binary64 (if (<= x -2.8491681377424e-310) (sqrt (* (pow x 2.0) 2.0)) (* (sqrt 2.0) (pow x 1.0))))
double code(double x) {
return ((double) sqrt(((double) (((double) pow(x, 2.0)) + ((double) pow(x, 2.0))))));
}
double code(double x) {
double tmp;
if ((x <= -2.8491681377424e-310)) {
tmp = ((double) sqrt(((double) (((double) pow(x, 2.0)) * 2.0))));
} else {
tmp = ((double) (((double) sqrt(2.0)) * ((double) pow(x, 1.0))));
}
return tmp;
}



Bits error versus x
Results
if x < -2.849168137742421e-310Initial program Error: 30.5 bits
SimplifiedError: 30.5 bits
if -2.849168137742421e-310 < x Initial program Error: 30.2 bits
SimplifiedError: 30.2 bits
Taylor expanded around 0 Error: 5.7 bits
SimplifiedError: 0.4 bits
Final simplificationError: 15.2 bits
herbie shell --seed 2020204
(FPCore (x)
:name "sqrt E"
:precision binary64
(sqrt (+ (pow x 2.0) (pow x 2.0))))