Average Error: 0.0 → 0.0
Time: 3.3s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
double f(double x, double y) {
        double r822750 = x;
        double r822751 = r822750 * r822750;
        double r822752 = 2.0;
        double r822753 = r822750 * r822752;
        double r822754 = y;
        double r822755 = r822753 * r822754;
        double r822756 = r822751 + r822755;
        double r822757 = r822754 * r822754;
        double r822758 = r822756 + r822757;
        return r822758;
}

double f(double x, double y) {
        double r822759 = x;
        double r822760 = r822759 * r822759;
        double r822761 = 2.0;
        double r822762 = r822759 * r822761;
        double r822763 = y;
        double r822764 = r822762 * r822763;
        double r822765 = r822760 + r822764;
        double r822766 = r822763 * r822763;
        double r822767 = r822765 + r822766;
        return r822767;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(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)))