Average Error: 0.3 → 0.2
Time: 3.8s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot \left(3 \cdot y\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot \left(3 \cdot y\right)\right) \cdot y
double f(double x, double y) {
        double r961050 = x;
        double r961051 = 3.0;
        double r961052 = r961050 * r961051;
        double r961053 = y;
        double r961054 = r961052 * r961053;
        double r961055 = r961054 * r961053;
        return r961055;
}

double f(double x, double y) {
        double r961056 = x;
        double r961057 = 3.0;
        double r961058 = y;
        double r961059 = r961057 * r961058;
        double r961060 = r961056 * r961059;
        double r961061 = r961060 * r961058;
        return r961061;
}

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(x \cdot \left(3 \cdot y\right)\right) \cdot y\]

Reproduce

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

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

  (* (* (* x 3) y) y))