Average Error: 0.0 → 0.0
Time: 815.0ms
Precision: 64
\[x \cdot x - y \cdot y\]
\[\mathsf{fma}\left(x, x, -y \cdot y\right)\]
x \cdot x - y \cdot y
\mathsf{fma}\left(x, x, -y \cdot y\right)
double f(double x, double y) {
        double r153896 = x;
        double r153897 = r153896 * r153896;
        double r153898 = y;
        double r153899 = r153898 * r153898;
        double r153900 = r153897 - r153899;
        return r153900;
}

double f(double x, double y) {
        double r153901 = x;
        double r153902 = y;
        double r153903 = r153902 * r153902;
        double r153904 = -r153903;
        double r153905 = fma(r153901, r153901, r153904);
        return r153905;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[x \cdot x - y \cdot y\]
  2. Using strategy rm
  3. Applied fma-neg0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, -y \cdot y\right)}\]
  4. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(x, x, -y \cdot y\right)\]

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f2 from sbv-4.4"
  :precision binary64
  (- (* x x) (* y y)))