Average Error: 0.1 → 0.1
Time: 14.9s
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 r29336126 = x;
        double r29336127 = r29336126 * r29336126;
        double r29336128 = y;
        double r29336129 = r29336128 * r29336128;
        double r29336130 = r29336127 + r29336129;
        double r29336131 = r29336130 + r29336129;
        double r29336132 = r29336131 + r29336129;
        return r29336132;
}

double f(double x, double y) {
        double r29336133 = 3.0;
        double r29336134 = y;
        double r29336135 = r29336134 * r29336134;
        double r29336136 = r29336133 * r29336135;
        double r29336137 = x;
        double r29336138 = r29336137 * r29336137;
        double r29336139 = r29336136 + r29336138;
        return r29336139;
}

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}{3 \cdot \left(y \cdot y\right) + x \cdot x}\]
  3. Final simplification0.1

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

Reproduce

herbie shell --seed 2019169 
(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)))