Average Error: 10.5 → 0.3
Time: 6.0s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(y \cdot x\right) \cdot \left(x \cdot 3\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(y \cdot x\right) \cdot \left(x \cdot 3\right)
double f(double x, double y) {
        double r35563083 = x;
        double r35563084 = 3.0;
        double r35563085 = r35563083 * r35563084;
        double r35563086 = r35563085 * r35563083;
        double r35563087 = y;
        double r35563088 = r35563086 * r35563087;
        return r35563088;
}

double f(double x, double y) {
        double r35563089 = y;
        double r35563090 = x;
        double r35563091 = r35563089 * r35563090;
        double r35563092 = 3.0;
        double r35563093 = r35563090 * r35563092;
        double r35563094 = r35563091 * r35563093;
        return r35563094;
}

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

Derivation

  1. Initial program 10.5

    \[\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. Final simplification0.3

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

Reproduce

herbie shell --seed 2019192 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"

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

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