(FPCore (x) :precision binary64 (sqrt (* (* 2.0 x) x)))
(FPCore (x) :precision binary64 (fabs (* (pow 2.0 0.25) (* x (pow 2.0 0.25)))))
double code(double x) {
return sqrt(((2.0 * x) * x));
}
double code(double x) {
return fabs((pow(2.0, 0.25) * (x * pow(2.0, 0.25))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = sqrt(((2.0d0 * x) * x))
end function
real(8) function code(x)
real(8), intent (in) :: x
code = abs(((2.0d0 ** 0.25d0) * (x * (2.0d0 ** 0.25d0))))
end function
public static double code(double x) {
return Math.sqrt(((2.0 * x) * x));
}
public static double code(double x) {
return Math.abs((Math.pow(2.0, 0.25) * (x * Math.pow(2.0, 0.25))));
}
def code(x): return math.sqrt(((2.0 * x) * x))
def code(x): return math.fabs((math.pow(2.0, 0.25) * (x * math.pow(2.0, 0.25))))
function code(x) return sqrt(Float64(Float64(2.0 * x) * x)) end
function code(x) return abs(Float64((2.0 ^ 0.25) * Float64(x * (2.0 ^ 0.25)))) end
function tmp = code(x) tmp = sqrt(((2.0 * x) * x)); end
function tmp = code(x) tmp = abs(((2.0 ^ 0.25) * (x * (2.0 ^ 0.25)))); end
code[x_] := N[Sqrt[N[(N[(2.0 * x), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]
code[x_] := N[Abs[N[(N[Power[2.0, 0.25], $MachinePrecision] * N[(x * N[Power[2.0, 0.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{\left(2 \cdot x\right) \cdot x}
\left|{2}^{0.25} \cdot \left(x \cdot {2}^{0.25}\right)\right|
Results
Initial program 30.5
Applied egg-rr0.4
Applied egg-rr1.4
Applied egg-rr0.4
Final simplification0.4
herbie shell --seed 2022210
(FPCore (x)
:name "sqrt B"
:precision binary64
(sqrt (* (* 2.0 x) x)))