Average Error: 30.5 → 0.4
Time: 1.9s
Precision: binary64
\[\sqrt{2 \cdot {x}^{2}} \]
\[\left|{2}^{0.25} \cdot \left({2}^{0.25} \cdot x\right)\right| \]
(FPCore (x) :precision binary64 (sqrt (* 2.0 (pow x 2.0))))
(FPCore (x) :precision binary64 (fabs (* (pow 2.0 0.25) (* (pow 2.0 0.25) x))))
double code(double x) {
	return sqrt((2.0 * pow(x, 2.0)));
}
double code(double x) {
	return fabs((pow(2.0, 0.25) * (pow(2.0, 0.25) * x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = sqrt((2.0d0 * (x ** 2.0d0)))
end function
real(8) function code(x)
    real(8), intent (in) :: x
    code = abs(((2.0d0 ** 0.25d0) * ((2.0d0 ** 0.25d0) * x)))
end function
public static double code(double x) {
	return Math.sqrt((2.0 * Math.pow(x, 2.0)));
}
public static double code(double x) {
	return Math.abs((Math.pow(2.0, 0.25) * (Math.pow(2.0, 0.25) * x)));
}
def code(x):
	return math.sqrt((2.0 * math.pow(x, 2.0)))
def code(x):
	return math.fabs((math.pow(2.0, 0.25) * (math.pow(2.0, 0.25) * x)))
function code(x)
	return sqrt(Float64(2.0 * (x ^ 2.0)))
end
function code(x)
	return abs(Float64((2.0 ^ 0.25) * Float64((2.0 ^ 0.25) * x)))
end
function tmp = code(x)
	tmp = sqrt((2.0 * (x ^ 2.0)));
end
function tmp = code(x)
	tmp = abs(((2.0 ^ 0.25) * ((2.0 ^ 0.25) * x)));
end
code[x_] := N[Sqrt[N[(2.0 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := N[Abs[N[(N[Power[2.0, 0.25], $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{2 \cdot {x}^{2}}
\left|{2}^{0.25} \cdot \left({2}^{0.25} \cdot x\right)\right|

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.5

    \[\sqrt{2 \cdot {x}^{2}} \]
  2. Applied egg-rr0.4

    \[\leadsto \color{blue}{\left|x \cdot \sqrt{2}\right|} \]
  3. Applied egg-rr1.4

    \[\leadsto \left|\color{blue}{{\left(\sqrt[3]{x \cdot \sqrt{2}}\right)}^{3}}\right| \]
  4. Applied egg-rr0.4

    \[\leadsto \left|\color{blue}{{2}^{0.25} \cdot \left({2}^{0.25} \cdot x\right)}\right| \]
  5. Final simplification0.4

    \[\leadsto \left|{2}^{0.25} \cdot \left({2}^{0.25} \cdot x\right)\right| \]

Reproduce

herbie shell --seed 2022210 
(FPCore (x)
  :name "sqrt D"
  :precision binary64
  (sqrt (* 2.0 (pow x 2.0))))