Average Error: 10.3 → 0.2
Time: 14.7s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
\[\left(y \cdot x\right) \cdot \left(x \cdot 3.0\right)\]
\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y
\left(y \cdot x\right) \cdot \left(x \cdot 3.0\right)
double f(double x, double y) {
        double r33423148 = x;
        double r33423149 = 3.0;
        double r33423150 = r33423148 * r33423149;
        double r33423151 = r33423150 * r33423148;
        double r33423152 = y;
        double r33423153 = r33423151 * r33423152;
        return r33423153;
}

double f(double x, double y) {
        double r33423154 = y;
        double r33423155 = x;
        double r33423156 = r33423154 * r33423155;
        double r33423157 = 3.0;
        double r33423158 = r33423155 * r33423157;
        double r33423159 = r33423156 * r33423158;
        return r33423159;
}

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

Derivation

  1. Initial program 10.3

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

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

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(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))