Average Error: 0.0 → 0.0
Time: 770.0ms
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 r186881 = x;
        double r186882 = r186881 * r186881;
        double r186883 = y;
        double r186884 = r186883 * r186883;
        double r186885 = r186882 - r186884;
        return r186885;
}

double f(double x, double y) {
        double r186886 = x;
        double r186887 = y;
        double r186888 = r186886 + r186887;
        double r186889 = r186886 - r186887;
        double r186890 = r186888 * r186889;
        return r186890;
}

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 difference-of-squares0.0

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

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

Reproduce

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