Average Error: 0.0 → 0.0
Time: 3.9s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[y \cdot \left(x \cdot 2 + y\right) + x \cdot x\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
y \cdot \left(x \cdot 2 + y\right) + x \cdot x
double f(double x, double y) {
        double r497926 = x;
        double r497927 = r497926 * r497926;
        double r497928 = 2.0;
        double r497929 = r497926 * r497928;
        double r497930 = y;
        double r497931 = r497929 * r497930;
        double r497932 = r497927 + r497931;
        double r497933 = r497930 * r497930;
        double r497934 = r497932 + r497933;
        return r497934;
}

double f(double x, double y) {
        double r497935 = y;
        double r497936 = x;
        double r497937 = 2.0;
        double r497938 = r497936 * r497937;
        double r497939 = r497938 + r497935;
        double r497940 = r497935 * r497939;
        double r497941 = r497936 * r497936;
        double r497942 = r497940 + r497941;
        return r497942;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[x \cdot x + \left(y \cdot y + \left(x \cdot y\right) \cdot 2\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2020089 
(FPCore (x y)
  :name "Examples.Basics.ProofTests:f4 from sbv-4.4"
  :precision binary64

  :herbie-target
  (+ (* x x) (+ (* y y) (* (* x y) 2)))

  (+ (+ (* x x) (* (* x 2) y)) (* y y)))