Average Error: 0.1 → 0.1
Time: 8.9s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[x \cdot x + \left(3 \cdot y\right) \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
x \cdot x + \left(3 \cdot y\right) \cdot y
double f(double x, double y) {
        double r1244351 = x;
        double r1244352 = r1244351 * r1244351;
        double r1244353 = y;
        double r1244354 = r1244353 * r1244353;
        double r1244355 = r1244352 + r1244354;
        double r1244356 = r1244355 + r1244354;
        double r1244357 = r1244356 + r1244354;
        return r1244357;
}

double f(double x, double y) {
        double r1244358 = x;
        double r1244359 = r1244358 * r1244358;
        double r1244360 = 3.0;
        double r1244361 = y;
        double r1244362 = r1244360 * r1244361;
        double r1244363 = r1244362 * r1244361;
        double r1244364 = r1244359 + r1244363;
        return r1244364;
}

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}{x \cdot x + 3 \cdot \left(y \cdot y\right)}\]
  3. Using strategy rm
  4. Applied associate-*r*0.1

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

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

Reproduce

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