Average Error: 0.3 → 0.2
Time: 7.5s
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 r39831873 = x;
        double r39831874 = 3.0;
        double r39831875 = r39831873 * r39831874;
        double r39831876 = y;
        double r39831877 = r39831875 * r39831876;
        double r39831878 = r39831877 * r39831876;
        return r39831878;
}

double f(double x, double y) {
        double r39831879 = y;
        double r39831880 = 3.0;
        double r39831881 = r39831879 * r39831880;
        double r39831882 = x;
        double r39831883 = r39831881 * r39831882;
        double r39831884 = r39831883 * r39831879;
        return r39831884;
}

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