Average Error: 10.3 → 0.2
Time: 12.1s
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 r32578048 = x;
        double r32578049 = 3.0;
        double r32578050 = r32578048 * r32578049;
        double r32578051 = r32578050 * r32578048;
        double r32578052 = y;
        double r32578053 = r32578051 * r32578052;
        return r32578053;
}

double f(double x, double y) {
        double r32578054 = y;
        double r32578055 = x;
        double r32578056 = r32578054 * r32578055;
        double r32578057 = 3.0;
        double r32578058 = r32578055 * r32578057;
        double r32578059 = r32578056 * r32578058;
        return r32578059;
}

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 
(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))