Average Error: 0.0 → 0.0
Time: 6.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 r188152 = x;
        double r188153 = r188152 * r188152;
        double r188154 = y;
        double r188155 = r188154 * r188154;
        double r188156 = r188153 - r188155;
        return r188156;
}

double f(double x, double y) {
        double r188157 = x;
        double r188158 = y;
        double r188159 = r188157 - r188158;
        double r188160 = r188157 + r188158;
        double r188161 = r188159 * r188160;
        return r188161;
}

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 2020042 +o rules:numerics
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f2 from sbv-4.4"
  :precision binary64
  (- (* x x) (* y y)))