Average Error: 0.0 → 0.0
Time: 2.7s
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 r587531 = x;
        double r587532 = 2.0;
        double r587533 = r587531 * r587532;
        double r587534 = r587531 * r587531;
        double r587535 = r587533 + r587534;
        double r587536 = y;
        double r587537 = r587536 * r587536;
        double r587538 = r587535 + r587537;
        return r587538;
}

double f(double x, double y) {
        double r587539 = x;
        double r587540 = 2.0;
        double r587541 = r587540 + r587539;
        double r587542 = r587539 * r587541;
        double r587543 = y;
        double r587544 = r587543 * r587543;
        double r587545 = r587542 + r587544;
        return r587545;
}

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 2020047 
(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)))