Average Error: 0.0 → 0.0
Time: 7.6s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y\]
\[y \cdot y + \left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right)\]
\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y
y \cdot y + \left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right)
double f(double x, double y) {
        double r25429045 = x;
        double r25429046 = r25429045 * r25429045;
        double r25429047 = 2.0;
        double r25429048 = r25429045 * r25429047;
        double r25429049 = y;
        double r25429050 = r25429048 * r25429049;
        double r25429051 = r25429046 + r25429050;
        double r25429052 = r25429049 * r25429049;
        double r25429053 = r25429051 + r25429052;
        return r25429053;
}

double f(double x, double y) {
        double r25429054 = y;
        double r25429055 = r25429054 * r25429054;
        double r25429056 = x;
        double r25429057 = r25429056 * r25429056;
        double r25429058 = 2.0;
        double r25429059 = r25429056 * r25429058;
        double r25429060 = r25429059 * r25429054;
        double r25429061 = r25429057 + r25429060;
        double r25429062 = r25429055 + r25429061;
        return r25429062;
}

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.0\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y\]
  2. Final simplification0.0

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

Reproduce

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