Average Error: 0.0 → 0.0
Time: 5.2s
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 r11114268 = x;
        double r11114269 = r11114268 * r11114268;
        double r11114270 = y;
        double r11114271 = r11114270 * r11114270;
        double r11114272 = r11114269 + r11114271;
        return r11114272;
}

double f(double x, double y) {
        double r11114273 = x;
        double r11114274 = r11114273 * r11114273;
        double r11114275 = y;
        double r11114276 = r11114275 * r11114275;
        double r11114277 = r11114274 + r11114276;
        double r11114278 = sqrt(r11114277);
        double r11114279 = r11114278 * r11114278;
        return r11114279;
}

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