Average Error: 0.0 → 0.0
Time: 7.9s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[\left(x \cdot x + {y}^{2}\right) + \left(2 \cdot x\right) \cdot y\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
\left(x \cdot x + {y}^{2}\right) + \left(2 \cdot x\right) \cdot y
double f(double x, double y) {
        double r597047 = x;
        double r597048 = r597047 * r597047;
        double r597049 = 2.0;
        double r597050 = r597047 * r597049;
        double r597051 = y;
        double r597052 = r597050 * r597051;
        double r597053 = r597048 + r597052;
        double r597054 = r597051 * r597051;
        double r597055 = r597053 + r597054;
        return r597055;
}

double f(double x, double y) {
        double r597056 = x;
        double r597057 = r597056 * r597056;
        double r597058 = y;
        double r597059 = 2.0;
        double r597060 = pow(r597058, r597059);
        double r597061 = r597057 + r597060;
        double r597062 = 2.0;
        double r597063 = r597062 * r597056;
        double r597064 = r597063 * r597058;
        double r597065 = r597061 + r597064;
        return r597065;
}

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 y + x \cdot \left(x + y \cdot 2\right)}\]
  3. Taylor expanded around 0 0.0

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

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

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

Reproduce

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