Average Error: 0.0 → 0.0
Time: 1.6s
Precision: 64
\[x \cdot x + y \cdot y\]
\[x \cdot x + y \cdot y\]
x \cdot x + y \cdot y
x \cdot x + y \cdot y
double f(double x, double y) {
        double r178369 = x;
        double r178370 = r178369 * r178369;
        double r178371 = y;
        double r178372 = r178371 * r178371;
        double r178373 = r178370 + r178372;
        return r178373;
}

double f(double x, double y) {
        double r178374 = x;
        double r178375 = r178374 * r178374;
        double r178376 = y;
        double r178377 = r178376 * r178376;
        double r178378 = r178375 + r178377;
        return r178378;
}

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. Final simplification0.0

    \[\leadsto x \cdot x + y \cdot y\]

Reproduce

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