Average Error: 0.3 → 0.2
Time: 15.5s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(3 \cdot \left(x \cdot y\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(3 \cdot \left(x \cdot y\right)\right) \cdot y
double f(double x, double y) {
        double r833700 = x;
        double r833701 = 3.0;
        double r833702 = r833700 * r833701;
        double r833703 = y;
        double r833704 = r833702 * r833703;
        double r833705 = r833704 * r833703;
        return r833705;
}

double f(double x, double y) {
        double r833706 = 3.0;
        double r833707 = x;
        double r833708 = y;
        double r833709 = r833707 * r833708;
        double r833710 = r833706 * r833709;
        double r833711 = r833710 * r833708;
        return r833711;
}

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. Simplified0.2

    \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot 3\right)}\right) \cdot y\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.2

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

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

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

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

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(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))