Average Error: 10.2 → 0.2
Time: 1.6s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot 3\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r1037167 = x;
        double r1037168 = 3.0;
        double r1037169 = r1037167 * r1037168;
        double r1037170 = r1037169 * r1037167;
        double r1037171 = y;
        double r1037172 = r1037170 * r1037171;
        return r1037172;
}

double f(double x, double y) {
        double r1037173 = x;
        double r1037174 = 3.0;
        double r1037175 = r1037173 * r1037174;
        double r1037176 = y;
        double r1037177 = r1037173 * r1037176;
        double r1037178 = r1037175 * r1037177;
        return r1037178;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.2
Target0.2
Herbie0.2
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.2

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

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

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

Reproduce

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

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

  (* (* (* x 3) x) y))