Average Error: 0.0 → 0.0
Time: 3.3s
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 r101113 = x;
        double r101114 = r101113 * r101113;
        double r101115 = y;
        double r101116 = r101115 * r101115;
        double r101117 = r101114 + r101116;
        return r101117;
}

double f(double x, double y) {
        double r101118 = x;
        double r101119 = r101118 * r101118;
        double r101120 = y;
        double r101121 = r101120 * r101120;
        double r101122 = r101119 + r101121;
        return r101122;
}

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