(FPCore (x) :precision binary64 (sqrt (* (* 2.0 x) x)))
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (cbrt (sqrt 2.0)))))
(if (<= x 2.1786358791023e-310)
(- (* (pow t_0 8.0) (* x t_0)))
(* (sqrt (* x 2.0)) (sqrt x)))))double code(double x) {
return sqrt(((2.0 * x) * x));
}
double code(double x) {
double t_0 = cbrt(cbrt(sqrt(2.0)));
double tmp;
if (x <= 2.1786358791023e-310) {
tmp = -(pow(t_0, 8.0) * (x * t_0));
} else {
tmp = sqrt((x * 2.0)) * sqrt(x);
}
return tmp;
}
public static double code(double x) {
return Math.sqrt(((2.0 * x) * x));
}
public static double code(double x) {
double t_0 = Math.cbrt(Math.cbrt(Math.sqrt(2.0)));
double tmp;
if (x <= 2.1786358791023e-310) {
tmp = -(Math.pow(t_0, 8.0) * (x * t_0));
} else {
tmp = Math.sqrt((x * 2.0)) * Math.sqrt(x);
}
return tmp;
}
function code(x) return sqrt(Float64(Float64(2.0 * x) * x)) end
function code(x) t_0 = cbrt(cbrt(sqrt(2.0))) tmp = 0.0 if (x <= 2.1786358791023e-310) tmp = Float64(-Float64((t_0 ^ 8.0) * Float64(x * t_0))); else tmp = Float64(sqrt(Float64(x * 2.0)) * sqrt(x)); end return tmp end
code[x_] := N[Sqrt[N[(N[(2.0 * x), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Power[N[Power[N[Sqrt[2.0], $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[x, 2.1786358791023e-310], (-N[(N[Power[t$95$0, 8.0], $MachinePrecision] * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]), N[(N[Sqrt[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\sqrt{\left(2 \cdot x\right) \cdot x}
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt[3]{\sqrt{2}}}\\
\mathbf{if}\;x \leq 2.1786358791023 \cdot 10^{-310}:\\
\;\;\;\;-{t_0}^{8} \cdot \left(x \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 2} \cdot \sqrt{x}\\
\end{array}



Bits error versus x
Results
if x < 2.178635879102305e-310Initial program 31.3
Taylor expanded in x around -inf 0.4
Simplified0.4
Applied add-cube-cbrt_binary640.4
Applied associate-*l*_binary640.4
Applied add-cube-cbrt_binary640.4
Applied associate-*l*_binary640.4
Applied associate-*r*_binary640.3
Simplified0.3
if 2.178635879102305e-310 < x Initial program 30.7
Applied sqrt-prod_binary640.4
Final simplification0.3
herbie shell --seed 2022137
(FPCore (x)
:name "sqrt B"
:precision binary64
(sqrt (* (* 2.0 x) x)))