Average Error: 0.1 → 0.1
Time: 3.2s
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 r430966 = x;
        double r430967 = r430966 * r430966;
        double r430968 = y;
        double r430969 = r430968 * r430968;
        double r430970 = r430967 + r430969;
        double r430971 = r430970 + r430969;
        double r430972 = r430971 + r430969;
        return r430972;
}

double f(double x, double y) {
        double r430973 = x;
        double r430974 = r430973 * r430973;
        double r430975 = 3.0;
        double r430976 = y;
        double r430977 = r430975 * r430976;
        double r430978 = r430977 * r430976;
        double r430979 = r430974 + r430978;
        return r430979;
}

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. Using strategy rm
  3. Applied associate-+l+0.1

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

    \[\leadsto \left(x \cdot x + y \cdot y\right) + \color{blue}{y \cdot \left(y + y\right)}\]
  5. Using strategy rm
  6. Applied associate-+l+0.1

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

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

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

Reproduce

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

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

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