Average Error: 0.3 → 0.2
Time: 13.4s
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 r38807058 = x;
        double r38807059 = 3.0;
        double r38807060 = r38807058 * r38807059;
        double r38807061 = y;
        double r38807062 = r38807060 * r38807061;
        double r38807063 = r38807062 * r38807061;
        return r38807063;
}

double f(double x, double y) {
        double r38807064 = y;
        double r38807065 = 3.0;
        double r38807066 = r38807065 * r38807064;
        double r38807067 = x;
        double r38807068 = r38807066 * r38807067;
        double r38807069 = r38807064 * r38807068;
        return r38807069;
}

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))