Average Error: 30.5 → 0.4
Time: 1.4s
Precision: binary64
\[\sqrt{\left(2 \cdot x\right) \cdot x} \]
\[\left|{2}^{0.25} \cdot \left(x \cdot {2}^{0.25}\right)\right| \]
(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|

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.5

    \[\sqrt{\left(2 \cdot x\right) \cdot x} \]
  2. Applied egg-rr0.4

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

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

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

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

Reproduce

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