Average Error: 0.0 → 0.0
Time: 6.5s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[x \cdot \left(2 \cdot y + x\right) + {y}^{2}\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
x \cdot \left(2 \cdot y + x\right) + {y}^{2}
double f(double x, double y) {
        double r379163 = x;
        double r379164 = r379163 * r379163;
        double r379165 = 2.0;
        double r379166 = r379163 * r379165;
        double r379167 = y;
        double r379168 = r379166 * r379167;
        double r379169 = r379164 + r379168;
        double r379170 = r379167 * r379167;
        double r379171 = r379169 + r379170;
        return r379171;
}

double f(double x, double y) {
        double r379172 = x;
        double r379173 = 2.0;
        double r379174 = y;
        double r379175 = r379173 * r379174;
        double r379176 = r379175 + r379172;
        double r379177 = r379172 * r379176;
        double r379178 = 2.0;
        double r379179 = pow(r379174, r379178);
        double r379180 = r379177 + r379179;
        return r379180;
}

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

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

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

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

Reproduce

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