Average Error: 0.0 → 0.0
Time: 1.2s
Precision: binary64
\[x \cdot x + y \cdot y \]
\[{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} \]
(FPCore (x y) :precision binary64 (+ (* x x) (* y y)))
(FPCore (x y) :precision binary64 (pow (hypot x y) 2.0))
double code(double x, double y) {
	return (x * x) + (y * y);
}
double code(double x, double y) {
	return pow(hypot(x, y), 2.0);
}
public static double code(double x, double y) {
	return (x * x) + (y * y);
}
public static double code(double x, double y) {
	return Math.pow(Math.hypot(x, y), 2.0);
}
def code(x, y):
	return (x * x) + (y * y)
def code(x, y):
	return math.pow(math.hypot(x, y), 2.0)
function code(x, y)
	return Float64(Float64(x * x) + Float64(y * y))
end
function code(x, y)
	return hypot(x, y) ^ 2.0
end
function tmp = code(x, y)
	tmp = (x * x) + (y * y);
end
function tmp = code(x, y)
	tmp = hypot(x, y) ^ 2.0;
end
code[x_, y_] := N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[Power[N[Sqrt[x ^ 2 + y ^ 2], $MachinePrecision], 2.0], $MachinePrecision]
x \cdot x + y \cdot y
{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x \cdot x + y \cdot y \]
  2. Applied egg-rr0.0

    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x, y\right)\right)}^{2}} \]
  3. Final simplification0.0

    \[\leadsto {\left(\mathsf{hypot}\left(x, y\right)\right)}^{2} \]

Reproduce

herbie shell --seed 2022150 
(FPCore (x y)
  :name "Graphics.Rasterific.Linear:$cquadrance from Rasterific-0.6.1"
  :precision binary64
  (+ (* x x) (* y y)))