Average Error: 10.4 → 0.3
Time: 18.7s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot 3\right) \cdot \left(y \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot 3\right) \cdot \left(y \cdot x\right)
double f(double x, double y) {
        double r492242 = x;
        double r492243 = 3.0;
        double r492244 = r492242 * r492243;
        double r492245 = r492244 * r492242;
        double r492246 = y;
        double r492247 = r492245 * r492246;
        return r492247;
}

double f(double x, double y) {
        double r492248 = x;
        double r492249 = 3.0;
        double r492250 = r492248 * r492249;
        double r492251 = y;
        double r492252 = r492251 * r492248;
        double r492253 = r492250 * r492252;
        return r492253;
}

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

Derivation

  1. Initial program 10.4

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

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

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

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

Reproduce

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