Average Error: 0.0 → 0.0
Time: 15.7s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y\]
\[\left(\left(2.0 \cdot y\right) \cdot x + x \cdot x\right) + y \cdot y\]
\left(x \cdot x + \left(x \cdot 2.0\right) \cdot y\right) + y \cdot y
\left(\left(2.0 \cdot y\right) \cdot x + x \cdot x\right) + y \cdot y
double f(double x, double y) {
        double r46152167 = x;
        double r46152168 = r46152167 * r46152167;
        double r46152169 = 2.0;
        double r46152170 = r46152167 * r46152169;
        double r46152171 = y;
        double r46152172 = r46152170 * r46152171;
        double r46152173 = r46152168 + r46152172;
        double r46152174 = r46152171 * r46152171;
        double r46152175 = r46152173 + r46152174;
        return r46152175;
}

double f(double x, double y) {
        double r46152176 = 2.0;
        double r46152177 = y;
        double r46152178 = r46152176 * r46152177;
        double r46152179 = x;
        double r46152180 = r46152178 * r46152179;
        double r46152181 = r46152179 * r46152179;
        double r46152182 = r46152180 + r46152181;
        double r46152183 = r46152177 * r46152177;
        double r46152184 = r46152182 + r46152183;
        return r46152184;
}

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. Taylor expanded around 0 0.0

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

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

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

Reproduce

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