Average Error: 0.0 → 0.0
Time: 5.5s
Precision: 64
\[x \cdot x + y \cdot y\]
\[\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}\]
x \cdot x + y \cdot y
\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}
double f(double x, double y) {
        double r143974 = x;
        double r143975 = r143974 * r143974;
        double r143976 = y;
        double r143977 = r143976 * r143976;
        double r143978 = r143975 + r143977;
        return r143978;
}

double f(double x, double y) {
        double r143979 = x;
        double r143980 = r143979 * r143979;
        double r143981 = y;
        double r143982 = r143981 * r143981;
        double r143983 = r143980 + r143982;
        double r143984 = sqrt(r143983);
        double r143985 = r143984 * r143984;
        return r143985;
}

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. Using strategy rm
  3. Applied add-sqr-sqrt0.0

    \[\leadsto \color{blue}{\sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}}\]
  4. Final simplification0.0

    \[\leadsto \sqrt{x \cdot x + y \cdot y} \cdot \sqrt{x \cdot x + y \cdot y}\]

Reproduce

herbie shell --seed 2019235 
(FPCore (x y)
  :name "Graphics.Rasterific.Linear:$cquadrance from Rasterific-0.6.1"
  :precision binary64
  (+ (* x x) (* y y)))