Average Error: 0.3 → 0.2
Time: 9.6s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y
double f(double x, double y) {
        double r39944643 = x;
        double r39944644 = 3.0;
        double r39944645 = r39944643 * r39944644;
        double r39944646 = y;
        double r39944647 = r39944645 * r39944646;
        double r39944648 = r39944647 * r39944646;
        return r39944648;
}

double f(double x, double y) {
        double r39944649 = y;
        double r39944650 = 3.0;
        double r39944651 = r39944649 * r39944650;
        double r39944652 = x;
        double r39944653 = r39944651 * r39944652;
        double r39944654 = r39944653 * r39944649;
        return r39944654;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.2
\[\left(x \cdot \left(3.0 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

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

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

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

Reproduce

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

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

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