Average Error: 0.0 → 0.0
Time: 2.8s
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 r462430 = x;
        double r462431 = 2.0;
        double r462432 = r462430 * r462431;
        double r462433 = r462430 * r462430;
        double r462434 = r462432 + r462433;
        double r462435 = y;
        double r462436 = r462435 * r462435;
        double r462437 = r462434 + r462436;
        return r462437;
}

double f(double x, double y) {
        double r462438 = x;
        double r462439 = 2.0;
        double r462440 = r462439 + r462438;
        double r462441 = r462438 * r462440;
        double r462442 = y;
        double r462443 = r462442 * r462442;
        double r462444 = r462441 + r462443;
        return r462444;
}

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 +o rules:numerics
(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)))