Average Error: 9.7 → 0.3
Time: 11.9s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
\[\left(x \cdot \left(x \cdot y\right)\right) \cdot 3.0\]
\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y
\left(x \cdot \left(x \cdot y\right)\right) \cdot 3.0
double f(double x, double y) {
        double r34234244 = x;
        double r34234245 = 3.0;
        double r34234246 = r34234244 * r34234245;
        double r34234247 = r34234246 * r34234244;
        double r34234248 = y;
        double r34234249 = r34234247 * r34234248;
        return r34234249;
}

double f(double x, double y) {
        double r34234250 = x;
        double r34234251 = y;
        double r34234252 = r34234250 * r34234251;
        double r34234253 = r34234250 * r34234252;
        double r34234254 = 3.0;
        double r34234255 = r34234253 * r34234254;
        return r34234255;
}

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.7
Target0.2
Herbie0.3
\[\left(x \cdot 3.0\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 9.7

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

    \[\leadsto \color{blue}{\left(x \cdot 3.0\right) \cdot \left(x \cdot y\right)}\]
  4. Using strategy rm
  5. Applied associate-*l*0.3

    \[\leadsto \color{blue}{x \cdot \left(3.0 \cdot \left(x \cdot y\right)\right)}\]
  6. Taylor expanded around 0 9.7

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

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

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

Reproduce

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

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

  (* (* (* x 3.0) x) y))