\sqrt{\left(2 \cdot x\right) \cdot x}
\begin{array}{l}
t_0 := x \cdot \sqrt{2}\\
\mathbf{if}\;x \leq -2.45058024836507 \cdot 10^{-310}:\\
\;\;\;\;-t_0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
(FPCore (x) :precision binary64 (sqrt (* (* 2.0 x) x)))
(FPCore (x) :precision binary64 (let* ((t_0 (* x (sqrt 2.0)))) (if (<= x -2.45058024836507e-310) (- t_0) t_0)))
double code(double x) {
return sqrt((2.0 * x) * x);
}
double code(double x) {
double t_0 = x * sqrt(2.0);
double tmp;
if (x <= -2.45058024836507e-310) {
tmp = -t_0;
} else {
tmp = t_0;
}
return tmp;
}



Bits error versus x
Results
if x < -2.45058024836507e-310Initial program 29.5
Taylor expanded in x around -inf 0.4
Simplified0.4
if -2.45058024836507e-310 < x Initial program 29.5
Taylor expanded in x around 0 0.4
Final simplification0.4
herbie shell --seed 2022067
(FPCore (x)
:name "sqrt B"
:precision binary64
(sqrt (* (* 2.0 x) x)))