Average Error: 0.0 → 0.0
Time: 848.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 r154803 = x;
        double r154804 = r154803 * r154803;
        double r154805 = y;
        double r154806 = r154805 * r154805;
        double r154807 = r154804 - r154806;
        return r154807;
}

double f(double x, double y) {
        double r154808 = x;
        double r154809 = y;
        double r154810 = r154809 * r154809;
        double r154811 = -r154810;
        double r154812 = fma(r154808, r154808, r154811);
        return r154812;
}

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