Average Error: 0.3 → 0.3
Time: 8.4s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(x \cdot y\right) \cdot y\right) \cdot 3\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(x \cdot y\right) \cdot y\right) \cdot 3
double f(double x, double y) {
        double r30592353 = x;
        double r30592354 = 3.0;
        double r30592355 = r30592353 * r30592354;
        double r30592356 = y;
        double r30592357 = r30592355 * r30592356;
        double r30592358 = r30592357 * r30592356;
        return r30592358;
}

double f(double x, double y) {
        double r30592359 = x;
        double r30592360 = y;
        double r30592361 = r30592359 * r30592360;
        double r30592362 = r30592361 * r30592360;
        double r30592363 = 3.0;
        double r30592364 = r30592362 * r30592363;
        return r30592364;
}

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.3
\[\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. Using strategy rm
  5. Applied *-un-lft-identity0.2

    \[\leadsto \left(x \cdot \left(3 \cdot y\right)\right) \cdot \color{blue}{\left(1 \cdot y\right)}\]
  6. Applied associate-*r*0.2

    \[\leadsto \color{blue}{\left(\left(x \cdot \left(3 \cdot y\right)\right) \cdot 1\right) \cdot y}\]
  7. Simplified0.2

    \[\leadsto \color{blue}{\left(3 \cdot \left(y \cdot x\right)\right)} \cdot y\]
  8. Using strategy rm
  9. Applied associate-*l*0.3

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

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

Reproduce

herbie shell --seed 2019179 +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))