Average Error: 0.0 → 0.0
Time: 9.1s
Precision: 64
\[\left(x \cdot 2 + x \cdot x\right) + y \cdot y\]
\[\left(y \cdot y + x \cdot 2\right) + x \cdot x\]
\left(x \cdot 2 + x \cdot x\right) + y \cdot y
\left(y \cdot y + x \cdot 2\right) + x \cdot x
double f(double x, double y) {
        double r20422175 = x;
        double r20422176 = 2.0;
        double r20422177 = r20422175 * r20422176;
        double r20422178 = r20422175 * r20422175;
        double r20422179 = r20422177 + r20422178;
        double r20422180 = y;
        double r20422181 = r20422180 * r20422180;
        double r20422182 = r20422179 + r20422181;
        return r20422182;
}

double f(double x, double y) {
        double r20422183 = y;
        double r20422184 = r20422183 * r20422183;
        double r20422185 = x;
        double r20422186 = 2.0;
        double r20422187 = r20422185 * r20422186;
        double r20422188 = r20422184 + r20422187;
        double r20422189 = r20422185 * r20422185;
        double r20422190 = r20422188 + r20422189;
        return r20422190;
}

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
\[y \cdot y + \left(2 \cdot x + x \cdot x\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x \cdot 2 + x \cdot x\right) + y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot y + x \cdot \left(2 + x\right)}\]
  3. Using strategy rm
  4. Applied distribute-lft-in0.0

    \[\leadsto y \cdot y + \color{blue}{\left(x \cdot 2 + x \cdot x\right)}\]
  5. Applied associate-+r+0.0

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

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

Reproduce

herbie shell --seed 2019172 
(FPCore (x y)
  :name "Numeric.Log:$clog1p from log-domain-0.10.2.1, A"

  :herbie-target
  (+ (* y y) (+ (* 2.0 x) (* x x)))

  (+ (+ (* x 2.0) (* x x)) (* y y)))