Average Error: 0.0 → 0.0
Time: 3.2s
Precision: binary64
\[x \cdot x + y \cdot y\]
\[{\left(\sqrt{y \cdot y + x \cdot x}\right)}^{2}\]
x \cdot x + y \cdot y
{\left(\sqrt{y \cdot y + x \cdot x}\right)}^{2}
(FPCore (x y) :precision binary64 (+ (* x x) (* y y)))
(FPCore (x y) :precision binary64 (pow (sqrt (+ (* y y) (* x x))) 2.0))
double code(double x, double y) {
	return (x * x) + (y * y);
}
double code(double x, double y) {
	return pow(sqrt((y * y) + (x * x)), 2.0);
}

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. Using strategy rm
  3. Applied add-sqr-sqrt_binary64_35100.0

    \[\leadsto \color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\sqrt{y \cdot y + x \cdot x}} \cdot \sqrt{x \cdot x + y \cdot y}\]
  5. Simplified0.0

    \[\leadsto \sqrt{y \cdot y + x \cdot x} \cdot \color{blue}{\sqrt{y \cdot y + x \cdot x}}\]
  6. Using strategy rm
  7. Applied pow2_binary64_35690.0

    \[\leadsto \color{blue}{{\left(\sqrt{y \cdot y + x \cdot x}\right)}^{2}}\]
  8. Final simplification0.0

    \[\leadsto {\left(\sqrt{y \cdot y + x \cdot x}\right)}^{2}\]

Reproduce

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