Average Error: 0.0 → 0.0
Time: 1.0s
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 r140378 = x;
        double r140379 = r140378 * r140378;
        double r140380 = y;
        double r140381 = r140380 * r140380;
        double r140382 = r140379 + r140381;
        return r140382;
}

double f(double x, double y) {
        double r140383 = x;
        double r140384 = r140383 * r140383;
        double r140385 = y;
        double r140386 = r140385 * r140385;
        double r140387 = r140384 + r140386;
        double r140388 = sqrt(r140387);
        double r140389 = r140388 * r140388;
        return r140389;
}

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