Average Error: 0.0 → 0.0
Time: 974.0ms
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 r174151 = x;
        double r174152 = r174151 * r174151;
        double r174153 = y;
        double r174154 = r174153 * r174153;
        double r174155 = r174152 + r174154;
        return r174155;
}

double f(double x, double y) {
        double r174156 = x;
        double r174157 = r174156 * r174156;
        double r174158 = y;
        double r174159 = r174158 * r174158;
        double r174160 = r174157 + r174159;
        double r174161 = sqrt(r174160);
        double r174162 = r174161 * r174161;
        return r174162;
}

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)))