Average Error: 0.0 → 0.0
Time: 6.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 r613449 = x;
        double r613450 = 2.0;
        double r613451 = r613449 * r613450;
        double r613452 = r613449 * r613449;
        double r613453 = r613451 + r613452;
        double r613454 = y;
        double r613455 = r613454 * r613454;
        double r613456 = r613453 + r613455;
        return r613456;
}

double f(double x, double y) {
        double r613457 = x;
        double r613458 = 2.0;
        double r613459 = r613458 + r613457;
        double r613460 = r613457 * r613459;
        double r613461 = y;
        double r613462 = r613461 * r613461;
        double r613463 = r613460 + r613462;
        return r613463;
}

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