Average Error: 0.3 → 0.2
Time: 23.3s
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 r574719 = x;
        double r574720 = 3.0;
        double r574721 = r574719 * r574720;
        double r574722 = y;
        double r574723 = r574721 * r574722;
        double r574724 = r574723 * r574722;
        return r574724;
}

double f(double x, double y) {
        double r574725 = 3.0;
        double r574726 = x;
        double r574727 = y;
        double r574728 = r574726 * r574727;
        double r574729 = r574725 * r574728;
        double r574730 = r574729 * r574727;
        return r574730;
}

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(\color{blue}{\left(1 \cdot x\right)} \cdot \left(y \cdot 3\right)\right) \cdot y\]
  7. Applied associate-*l*0.2

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

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

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

Reproduce

herbie shell --seed 2019304 
(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))