Average Error: 0.0 → 0.0
Time: 530.0ms
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 r140581 = x;
        double r140582 = r140581 * r140581;
        double r140583 = y;
        double r140584 = r140583 * r140583;
        double r140585 = r140582 + r140584;
        return r140585;
}

double f(double x, double y) {
        double r140586 = x;
        double r140587 = r140586 * r140586;
        double r140588 = y;
        double r140589 = r140588 * r140588;
        double r140590 = r140587 + r140589;
        return r140590;
}

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