Average Error: 0.3 → 0.2
Time: 40.4s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot 3\right) \cdot x\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot 3\right) \cdot x\right) \cdot y
double f(double x, double y) {
        double r40617761 = x;
        double r40617762 = 3.0;
        double r40617763 = r40617761 * r40617762;
        double r40617764 = y;
        double r40617765 = r40617763 * r40617764;
        double r40617766 = r40617765 * r40617764;
        return r40617766;
}

double f(double x, double y) {
        double r40617767 = y;
        double r40617768 = 3.0;
        double r40617769 = r40617767 * r40617768;
        double r40617770 = x;
        double r40617771 = r40617769 * r40617770;
        double r40617772 = r40617771 * r40617767;
        return r40617772;
}

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 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

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

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

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

Reproduce

herbie shell --seed 2019200 
(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))