Average Error: 0.1 → 0.1
Time: 10.0s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[3 \cdot \left(y \cdot y\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
3 \cdot \left(y \cdot y\right) + x \cdot x
double f(double x, double y) {
        double r449805 = x;
        double r449806 = r449805 * r449805;
        double r449807 = y;
        double r449808 = r449807 * r449807;
        double r449809 = r449806 + r449808;
        double r449810 = r449809 + r449808;
        double r449811 = r449810 + r449808;
        return r449811;
}

double f(double x, double y) {
        double r449812 = 3.0;
        double r449813 = y;
        double r449814 = r449813 * r449813;
        double r449815 = r449812 * r449814;
        double r449816 = x;
        double r449817 = r449816 * r449816;
        double r449818 = r449815 + r449817;
        return r449818;
}

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

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 3 + x \cdot x}\]
  3. Final simplification0.1

    \[\leadsto 3 \cdot \left(y \cdot y\right) + x \cdot x\]

Reproduce

herbie shell --seed 2019174 
(FPCore (x y)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"

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

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