Average Error: 0.0 → 0.0
Time: 4.6s
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 r156932 = x;
        double r156933 = r156932 * r156932;
        double r156934 = y;
        double r156935 = r156934 * r156934;
        double r156936 = r156933 + r156935;
        return r156936;
}

double f(double x, double y) {
        double r156937 = x;
        double r156938 = r156937 * r156937;
        double r156939 = y;
        double r156940 = r156939 * r156939;
        double r156941 = r156938 + r156940;
        double r156942 = sqrt(r156941);
        double r156943 = r156942 * r156942;
        return r156943;
}

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