Average Error: 0.3 → 0.3
Time: 14.5s
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 r27725123 = x;
        double r27725124 = 3.0;
        double r27725125 = r27725123 * r27725124;
        double r27725126 = y;
        double r27725127 = r27725125 * r27725126;
        double r27725128 = r27725127 * r27725126;
        return r27725128;
}

double f(double x, double y) {
        double r27725129 = y;
        double r27725130 = 3.0;
        double r27725131 = r27725129 * r27725130;
        double r27725132 = x;
        double r27725133 = r27725131 * r27725132;
        double r27725134 = r27725133 * r27725129;
        return r27725134;
}

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.3
Herbie0.3
\[\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.3

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

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

Reproduce

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