Average Error: 0.3 → 0.2
Time: 17.6s
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 r30584533 = x;
        double r30584534 = 3.0;
        double r30584535 = r30584533 * r30584534;
        double r30584536 = y;
        double r30584537 = r30584535 * r30584536;
        double r30584538 = r30584537 * r30584536;
        return r30584538;
}

double f(double x, double y) {
        double r30584539 = y;
        double r30584540 = 3.0;
        double r30584541 = r30584539 * r30584540;
        double r30584542 = x;
        double r30584543 = r30584541 * r30584542;
        double r30584544 = r30584543 * r30584539;
        return r30584544;
}

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 2019172 +o rules:numerics
(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))