Average Error: 0.0 → 0.0
Time: 1.6s
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 r810660 = x;
        double r810661 = r810660 * r810660;
        double r810662 = y;
        double r810663 = r810661 + r810662;
        double r810664 = r810663 + r810662;
        return r810664;
}

double f(double x, double y) {
        double r810665 = x;
        double r810666 = r810665 * r810665;
        double r810667 = 2.0;
        double r810668 = y;
        double r810669 = r810667 * r810668;
        double r810670 = r810666 + r810669;
        return r810670;
}

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 2019350 
(FPCore (x y)
  :name "Data.Random.Distribution.Normal:normalTail from random-fu-0.2.6.2"
  :precision binary64

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

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