Average Error: 0.0 → 0.0
Time: 2.4s
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 r211724 = x;
        double r211725 = r211724 * r211724;
        double r211726 = y;
        double r211727 = r211726 * r211726;
        double r211728 = r211725 + r211727;
        return r211728;
}

double f(double x, double y) {
        double r211729 = x;
        double r211730 = r211729 * r211729;
        double r211731 = y;
        double r211732 = r211731 * r211731;
        double r211733 = r211730 + r211732;
        double r211734 = sqrt(r211733);
        double r211735 = r211734 * r211734;
        return r211735;
}

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