Average Error: 0.0 → 0.0
Time: 1.2s
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 r149687 = x;
        double r149688 = r149687 * r149687;
        double r149689 = y;
        double r149690 = r149689 * r149689;
        double r149691 = r149688 + r149690;
        return r149691;
}

double f(double x, double y) {
        double r149692 = x;
        double r149693 = r149692 * r149692;
        double r149694 = y;
        double r149695 = r149694 * r149694;
        double r149696 = r149693 + r149695;
        return r149696;
}

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