Average Error: 0.0 → 0.0
Time: 11.4s
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 r549048 = x;
        double r549049 = r549048 * r549048;
        double r549050 = 2.0;
        double r549051 = r549048 * r549050;
        double r549052 = y;
        double r549053 = r549051 * r549052;
        double r549054 = r549049 + r549053;
        double r549055 = r549052 * r549052;
        double r549056 = r549054 + r549055;
        return r549056;
}

double f(double x, double y) {
        double r549057 = y;
        double r549058 = r549057 * r549057;
        double r549059 = x;
        double r549060 = 2.0;
        double r549061 = r549060 * r549057;
        double r549062 = r549061 + r549059;
        double r549063 = r549059 * r549062;
        double r549064 = r549058 + r549063;
        return r549064;
}

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