Average Error: 0.0 → 0.0
Time: 544.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 r27701 = x;
        double r27702 = r27701 * r27701;
        double r27703 = y;
        double r27704 = r27703 * r27703;
        double r27705 = r27702 + r27704;
        return r27705;
}

double f(double x, double y) {
        double r27706 = x;
        double r27707 = r27706 * r27706;
        double r27708 = y;
        double r27709 = r27708 * r27708;
        double r27710 = r27707 + r27709;
        return r27710;
}

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