Average Error: 0.0 → 0.0
Time: 5.1s
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 r426052 = x;
        double r426053 = r426052 * r426052;
        double r426054 = 2.0;
        double r426055 = r426052 * r426054;
        double r426056 = y;
        double r426057 = r426055 * r426056;
        double r426058 = r426053 + r426057;
        double r426059 = r426056 * r426056;
        double r426060 = r426058 + r426059;
        return r426060;
}

double f(double x, double y) {
        double r426061 = y;
        double r426062 = r426061 * r426061;
        double r426063 = x;
        double r426064 = 2.0;
        double r426065 = r426064 * r426061;
        double r426066 = r426065 + r426063;
        double r426067 = r426063 * r426066;
        double r426068 = r426062 + r426067;
        return r426068;
}

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