Average Error: 10.3 → 0.2
Time: 1.5s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(x \cdot 3\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r753969 = x;
        double r753970 = 3.0;
        double r753971 = r753969 * r753970;
        double r753972 = r753971 * r753969;
        double r753973 = y;
        double r753974 = r753972 * r753973;
        return r753974;
}

double f(double x, double y) {
        double r753975 = x;
        double r753976 = 3.0;
        double r753977 = r753975 * r753976;
        double r753978 = y;
        double r753979 = r753975 * r753978;
        double r753980 = r753977 * r753979;
        return r753980;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 10.3

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

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

Reproduce

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