Average Error: 0.3 → 0.2
Time: 7.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[y \cdot \left(\left(3 \cdot y\right) \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
y \cdot \left(\left(3 \cdot y\right) \cdot x\right)
double f(double x, double y) {
        double r37860078 = x;
        double r37860079 = 3.0;
        double r37860080 = r37860078 * r37860079;
        double r37860081 = y;
        double r37860082 = r37860080 * r37860081;
        double r37860083 = r37860082 * r37860081;
        return r37860083;
}

double f(double x, double y) {
        double r37860084 = y;
        double r37860085 = 3.0;
        double r37860086 = r37860085 * r37860084;
        double r37860087 = x;
        double r37860088 = r37860086 * r37860087;
        double r37860089 = r37860084 * r37860088;
        return r37860089;
}

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 *-un-lft-identity0.3

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

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

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

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

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

Reproduce

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