Average Error: 0.0 → 0.0
Time: 1.5s
Precision: 64
\[x \cdot x - y \cdot y\]
\[\left(x - y\right) \cdot \left(x + y\right)\]
x \cdot x - y \cdot y
\left(x - y\right) \cdot \left(x + y\right)
double f(double x, double y) {
        double r21530 = x;
        double r21531 = r21530 * r21530;
        double r21532 = y;
        double r21533 = r21532 * r21532;
        double r21534 = r21531 - r21533;
        return r21534;
}

double f(double x, double y) {
        double r21535 = x;
        double r21536 = y;
        double r21537 = r21535 - r21536;
        double r21538 = r21535 + r21536;
        double r21539 = r21537 * r21538;
        return r21539;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\left(x - y\right) \cdot \left(x + y\right)}\]
  3. Final simplification0.0

    \[\leadsto \left(x - y\right) \cdot \left(x + y\right)\]

Reproduce

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