Average Error: 0.0 → 0.0
Time: 5.5s
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 r9885812 = x;
        double r9885813 = r9885812 * r9885812;
        double r9885814 = y;
        double r9885815 = r9885814 * r9885814;
        double r9885816 = r9885813 + r9885815;
        return r9885816;
}

double f(double x, double y) {
        double r9885817 = x;
        double r9885818 = r9885817 * r9885817;
        double r9885819 = y;
        double r9885820 = r9885819 * r9885819;
        double r9885821 = r9885818 + r9885820;
        double r9885822 = sqrt(r9885821);
        double r9885823 = r9885822 * r9885822;
        return r9885823;
}

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