Average Error: 0.3 → 0.2
Time: 7.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot x\right) \cdot 3\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot x\right) \cdot 3\right) \cdot y
double f(double x, double y) {
        double r717822 = x;
        double r717823 = 3.0;
        double r717824 = r717822 * r717823;
        double r717825 = y;
        double r717826 = r717824 * r717825;
        double r717827 = r717826 * r717825;
        return r717827;
}

double f(double x, double y) {
        double r717828 = y;
        double r717829 = x;
        double r717830 = r717828 * r717829;
        double r717831 = 3.0;
        double r717832 = r717830 * r717831;
        double r717833 = r717832 * r717828;
        return r717833;
}

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

    \[\leadsto \color{blue}{\left(y \cdot 3\right) \cdot \left(y \cdot x\right)}\]
  3. Using strategy rm
  4. Applied associate-*l*0.2

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

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

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

Reproduce

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