Average Error: 0.0 → 0.0
Time: 4.3s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[y \cdot y + x \cdot \left(2 \cdot y + x\right)\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
y \cdot y + x \cdot \left(2 \cdot y + x\right)
double f(double x, double y) {
        double r508998 = x;
        double r508999 = r508998 * r508998;
        double r509000 = 2.0;
        double r509001 = r508998 * r509000;
        double r509002 = y;
        double r509003 = r509001 * r509002;
        double r509004 = r508999 + r509003;
        double r509005 = r509002 * r509002;
        double r509006 = r509004 + r509005;
        return r509006;
}

double f(double x, double y) {
        double r509007 = y;
        double r509008 = r509007 * r509007;
        double r509009 = x;
        double r509010 = 2.0;
        double r509011 = r509010 * r509007;
        double r509012 = r509011 + r509009;
        double r509013 = r509009 * r509012;
        double r509014 = r509008 + r509013;
        return r509014;
}

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 y + x \cdot \left(2 \cdot y + x\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019326 
(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)))