Average Error: 0.0 → 0.0
Time: 1.1s
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 r100962 = x;
        double r100963 = r100962 * r100962;
        double r100964 = y;
        double r100965 = r100964 * r100964;
        double r100966 = r100963 + r100965;
        return r100966;
}

double f(double x, double y) {
        double r100967 = x;
        double r100968 = r100967 * r100967;
        double r100969 = y;
        double r100970 = r100969 * r100969;
        double r100971 = r100968 + r100970;
        return r100971;
}

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