Average Error: 9.8 → 0.2
Time: 13.2s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot x\]
\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot x
double f(double x, double y) {
        double r32227378 = x;
        double r32227379 = 3.0;
        double r32227380 = r32227378 * r32227379;
        double r32227381 = r32227380 * r32227378;
        double r32227382 = y;
        double r32227383 = r32227381 * r32227382;
        return r32227383;
}

double f(double x, double y) {
        double r32227384 = x;
        double r32227385 = 3.0;
        double r32227386 = r32227384 * r32227385;
        double r32227387 = y;
        double r32227388 = r32227386 * r32227387;
        double r32227389 = r32227388 * r32227384;
        return r32227389;
}

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

Derivation

  1. Initial program 9.8

    \[\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.2

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

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

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

Reproduce

herbie shell --seed 2019158 +o rules:numerics
(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))