Average Error: 0.0 → 0.0
Time: 5.8s
Precision: 64
\[\left(x \cdot x + y\right) + y\]
\[x \cdot x + 2 \cdot y\]
\left(x \cdot x + y\right) + y
x \cdot x + 2 \cdot y
double f(double x, double y) {
        double r618607 = x;
        double r618608 = r618607 * r618607;
        double r618609 = y;
        double r618610 = r618608 + r618609;
        double r618611 = r618610 + r618609;
        return r618611;
}

double f(double x, double y) {
        double r618612 = x;
        double r618613 = r618612 * r618612;
        double r618614 = 2.0;
        double r618615 = y;
        double r618616 = r618614 * r618615;
        double r618617 = r618613 + r618616;
        return r618617;
}

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

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x + y\right) + y\]
  2. Using strategy rm
  3. Applied associate-+l+0.0

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

    \[\leadsto x \cdot x + \color{blue}{2 \cdot y}\]
  5. Final simplification0.0

    \[\leadsto x \cdot x + 2 \cdot y\]

Reproduce

herbie shell --seed 2019195 
(FPCore (x y)
  :name "Data.Random.Distribution.Normal:normalTail from random-fu-0.2.6.2"

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

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