Average Error: 0.0 → 0.0
Time: 31.8s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y\]
\[y \cdot y + x \cdot \left(x + 2.0 \cdot y\right)\]
\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y
y \cdot y + x \cdot \left(x + 2.0 \cdot y\right)
double f(double x, double y) {
        double r31057977 = x;
        double r31057978 = r31057977 * r31057977;
        double r31057979 = 2.0;
        double r31057980 = r31057977 * r31057979;
        double r31057981 = y;
        double r31057982 = r31057980 * r31057981;
        double r31057983 = r31057978 + r31057982;
        double r31057984 = r31057981 * r31057981;
        double r31057985 = r31057983 + r31057984;
        return r31057985;
}

double f(double x, double y) {
        double r31057986 = y;
        double r31057987 = r31057986 * r31057986;
        double r31057988 = x;
        double r31057989 = 2.0;
        double r31057990 = r31057989 * r31057986;
        double r31057991 = r31057988 + r31057990;
        double r31057992 = r31057988 * r31057991;
        double r31057993 = r31057987 + r31057992;
        return r31057993;
}

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. Simplified0.0

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

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

Reproduce

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