Average Error: 0.0 → 0.0
Time: 1.2s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[\left(y \cdot \left(x \cdot 2\right) + {y}^{2}\right) + x \cdot x\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
\left(y \cdot \left(x \cdot 2\right) + {y}^{2}\right) + x \cdot x
double f(double x, double y) {
        double r697752 = x;
        double r697753 = r697752 * r697752;
        double r697754 = 2.0;
        double r697755 = r697752 * r697754;
        double r697756 = y;
        double r697757 = r697755 * r697756;
        double r697758 = r697753 + r697757;
        double r697759 = r697756 * r697756;
        double r697760 = r697758 + r697759;
        return r697760;
}

double f(double x, double y) {
        double r697761 = y;
        double r697762 = x;
        double r697763 = 2.0;
        double r697764 = r697762 * r697763;
        double r697765 = r697761 * r697764;
        double r697766 = 2.0;
        double r697767 = pow(r697761, r697766);
        double r697768 = r697765 + r697767;
        double r697769 = r697762 * r697762;
        double r697770 = r697768 + r697769;
        return r697770;
}

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 \left(y \cdot \left(x \cdot 2\right) + {y}^{2}\right) + x \cdot x\]

Reproduce

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