Average Error: 0.3 → 0.3
Time: 15.0s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot y
double f(double x, double y) {
        double r36876677 = x;
        double r36876678 = 3.0;
        double r36876679 = r36876677 * r36876678;
        double r36876680 = y;
        double r36876681 = r36876679 * r36876680;
        double r36876682 = r36876681 * r36876680;
        return r36876682;
}

double f(double x, double y) {
        double r36876683 = y;
        double r36876684 = 3.0;
        double r36876685 = r36876683 * r36876684;
        double r36876686 = x;
        double r36876687 = r36876685 * r36876686;
        double r36876688 = r36876687 * r36876683;
        return r36876688;
}

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

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.3

    \[\leadsto \left(\left(x \cdot 3.0\right) \cdot y\right) \cdot \color{blue}{\left(1 \cdot y\right)}\]
  4. Applied associate-*r*0.3

    \[\leadsto \color{blue}{\left(\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot 1\right) \cdot y}\]
  5. Simplified0.3

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

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

Reproduce

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

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

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