Average Error: 0.0 → 0.0
Time: 4.1s
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 r758723 = x;
        double r758724 = r758723 * r758723;
        double r758725 = 2.0;
        double r758726 = r758723 * r758725;
        double r758727 = y;
        double r758728 = r758726 * r758727;
        double r758729 = r758724 + r758728;
        double r758730 = r758727 * r758727;
        double r758731 = r758729 + r758730;
        return r758731;
}

double f(double x, double y) {
        double r758732 = y;
        double r758733 = x;
        double r758734 = 2.0;
        double r758735 = r758733 * r758734;
        double r758736 = r758735 + r758732;
        double r758737 = r758732 * r758736;
        double r758738 = r758733 * r758733;
        double r758739 = r758737 + r758738;
        return r758739;
}

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 2020060 
(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)))