Average Error: 0.3 → 0.2
Time: 28.9s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot 3\right) \cdot x\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot 3\right) \cdot x\right) \cdot y
double f(double x, double y) {
        double r33819816 = x;
        double r33819817 = 3.0;
        double r33819818 = r33819816 * r33819817;
        double r33819819 = y;
        double r33819820 = r33819818 * r33819819;
        double r33819821 = r33819820 * r33819819;
        return r33819821;
}

double f(double x, double y) {
        double r33819822 = y;
        double r33819823 = 3.0;
        double r33819824 = r33819822 * r33819823;
        double r33819825 = x;
        double r33819826 = r33819824 * r33819825;
        double r33819827 = r33819826 * r33819822;
        return r33819827;
}

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. Using strategy rm
  3. Applied *-un-lft-identity0.3

    \[\leadsto \left(\left(x \cdot 3\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\right) \cdot y\right) \cdot 1\right) \cdot y}\]
  5. Simplified0.2

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

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

Reproduce

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