Average Error: 9.8 → 0.2
Time: 18.5s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot 3\right) \cdot \left(y \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot 3\right) \cdot \left(y \cdot x\right)
double f(double x, double y) {
        double r520066 = x;
        double r520067 = 3.0;
        double r520068 = r520066 * r520067;
        double r520069 = r520068 * r520066;
        double r520070 = y;
        double r520071 = r520069 * r520070;
        return r520071;
}

double f(double x, double y) {
        double r520072 = x;
        double r520073 = 3.0;
        double r520074 = r520072 * r520073;
        double r520075 = y;
        double r520076 = r520075 * r520072;
        double r520077 = r520074 * r520076;
        return r520077;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.8
Target0.2
Herbie0.2
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 9.8

    \[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

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

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

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

Reproduce

herbie shell --seed 2019303 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (* (* x 3) (* x y))

  (* (* (* x 3) x) y))