Average Error: 9.9 → 0.3
Time: 12.0s
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 r790856 = x;
        double r790857 = 3.0;
        double r790858 = r790856 * r790857;
        double r790859 = r790858 * r790856;
        double r790860 = y;
        double r790861 = r790859 * r790860;
        return r790861;
}

double f(double x, double y) {
        double r790862 = x;
        double r790863 = 3.0;
        double r790864 = r790862 * r790863;
        double r790865 = y;
        double r790866 = r790862 * r790865;
        double r790867 = r790864 * r790866;
        return r790867;
}

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

Derivation

  1. Initial program 9.9

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

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

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

Reproduce

herbie shell --seed 2020045 +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))