Average Error: 0.3 → 0.2
Time: 40.4s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y
double f(double x, double y) {
        double r35001036 = x;
        double r35001037 = 3.0;
        double r35001038 = r35001036 * r35001037;
        double r35001039 = y;
        double r35001040 = r35001038 * r35001039;
        double r35001041 = r35001040 * r35001039;
        return r35001041;
}

double f(double x, double y) {
        double r35001042 = y;
        double r35001043 = 3.0;
        double r35001044 = r35001042 * r35001043;
        double r35001045 = x;
        double r35001046 = r35001044 * r35001045;
        double r35001047 = r35001046 * r35001042;
        return r35001047;
}

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

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto \color{blue}{\left(x \cdot \left(3.0 \cdot y\right)\right)} \cdot y\]
  4. Final simplification0.2

    \[\leadsto \left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y\]

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"

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

  (* (* (* x 3.0) y) y))