Average Error: 10.1 → 0.2
Time: 11.2s
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 r36308014 = x;
        double r36308015 = 3.0;
        double r36308016 = r36308014 * r36308015;
        double r36308017 = r36308016 * r36308014;
        double r36308018 = y;
        double r36308019 = r36308017 * r36308018;
        return r36308019;
}

double f(double x, double y) {
        double r36308020 = y;
        double r36308021 = x;
        double r36308022 = r36308020 * r36308021;
        double r36308023 = 3.0;
        double r36308024 = r36308021 * r36308023;
        double r36308025 = r36308022 * r36308024;
        return r36308025;
}

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

Derivation

  1. Initial program 10.1

    \[\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 2019168 
(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))