Average Error: 0.0 → 0.0
Time: 1.4s
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 r146404 = x;
        double r146405 = r146404 * r146404;
        double r146406 = y;
        double r146407 = r146406 * r146406;
        double r146408 = r146405 + r146407;
        return r146408;
}

double f(double x, double y) {
        double r146409 = x;
        double r146410 = r146409 * r146409;
        double r146411 = y;
        double r146412 = r146411 * r146411;
        double r146413 = r146410 + r146412;
        return r146413;
}

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 2020089 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rasterific.Linear:$cquadrance from Rasterific-0.6.1"
  :precision binary64
  (+ (* x x) (* y y)))