Average Error: 0.3 → 0.3
Time: 22.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[y \cdot \left(\left(x \cdot 3\right) \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
y \cdot \left(\left(x \cdot 3\right) \cdot y\right)
double f(double x, double y) {
        double r655987 = x;
        double r655988 = 3.0;
        double r655989 = r655987 * r655988;
        double r655990 = y;
        double r655991 = r655989 * r655990;
        double r655992 = r655991 * r655990;
        return r655992;
}

double f(double x, double y) {
        double r655993 = y;
        double r655994 = x;
        double r655995 = 3.0;
        double r655996 = r655994 * r655995;
        double r655997 = r655996 * r655993;
        double r655998 = r655993 * r655997;
        return r655998;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.3

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

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

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

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"
  :precision binary64

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

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