Average Error: 0.3 → 0.2
Time: 13.2s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[y \cdot \left(\left(3.0 \cdot y\right) \cdot x\right)\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
y \cdot \left(\left(3.0 \cdot y\right) \cdot x\right)
double f(double x, double y) {
        double r38974716 = x;
        double r38974717 = 3.0;
        double r38974718 = r38974716 * r38974717;
        double r38974719 = y;
        double r38974720 = r38974718 * r38974719;
        double r38974721 = r38974720 * r38974719;
        return r38974721;
}

double f(double x, double y) {
        double r38974722 = y;
        double r38974723 = 3.0;
        double r38974724 = r38974723 * r38974722;
        double r38974725 = x;
        double r38974726 = r38974724 * r38974725;
        double r38974727 = r38974722 * r38974726;
        return r38974727;
}

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.0 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.3

    \[\leadsto \left(\left(x \cdot 3.0\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.0\right) \cdot y\right) \cdot 1\right) \cdot y}\]
  5. Simplified0.2

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

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

Reproduce

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