Average Error: 0.0 → 0.0
Time: 10.0s
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 r496178 = x;
        double r496179 = r496178 * r496178;
        double r496180 = 2.0;
        double r496181 = r496178 * r496180;
        double r496182 = y;
        double r496183 = r496181 * r496182;
        double r496184 = r496179 + r496183;
        double r496185 = r496182 * r496182;
        double r496186 = r496184 + r496185;
        return r496186;
}

double f(double x, double y) {
        double r496187 = y;
        double r496188 = x;
        double r496189 = 2.0;
        double r496190 = r496188 * r496189;
        double r496191 = r496190 + r496187;
        double r496192 = r496187 * r496191;
        double r496193 = r496188 * r496188;
        double r496194 = r496192 + r496193;
        return r496194;
}

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. Using strategy rm
  4. Applied distribute-lft-in0.0

    \[\leadsto y \cdot y + \color{blue}{\left(x \cdot \left(2 \cdot y\right) + x \cdot x\right)}\]
  5. Applied associate-+r+0.0

    \[\leadsto \color{blue}{\left(y \cdot y + x \cdot \left(2 \cdot y\right)\right) + x \cdot x}\]
  6. Simplified0.0

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

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

Reproduce

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

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

  (+ (+ (* x x) (* (* x 2.0) y)) (* y y)))