Average Error: 0.0 → 0.0
Time: 3.6s
Precision: 64
\[\left(x \cdot 2 + x \cdot x\right) + y \cdot y\]
\[x \cdot \left(2 + x\right) + y \cdot y\]
\left(x \cdot 2 + x \cdot x\right) + y \cdot y
x \cdot \left(2 + x\right) + y \cdot y
double f(double x, double y) {
        double r494613 = x;
        double r494614 = 2.0;
        double r494615 = r494613 * r494614;
        double r494616 = r494613 * r494613;
        double r494617 = r494615 + r494616;
        double r494618 = y;
        double r494619 = r494618 * r494618;
        double r494620 = r494617 + r494619;
        return r494620;
}

double f(double x, double y) {
        double r494621 = x;
        double r494622 = 2.0;
        double r494623 = r494622 + r494621;
        double r494624 = r494621 * r494623;
        double r494625 = y;
        double r494626 = r494625 * r494625;
        double r494627 = r494624 + r494626;
        return r494627;
}

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. Using strategy rm
  3. Applied distribute-lft-out0.0

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

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

Reproduce

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

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

  (+ (+ (* x 2) (* x x)) (* y y)))