Average Error: 0.3 → 0.2
Time: 31.8s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(3 \cdot y\right) \cdot \left(y \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(3 \cdot y\right) \cdot \left(y \cdot x\right)
double f(double x, double y) {
        double r36514816 = x;
        double r36514817 = 3.0;
        double r36514818 = r36514816 * r36514817;
        double r36514819 = y;
        double r36514820 = r36514818 * r36514819;
        double r36514821 = r36514820 * r36514819;
        return r36514821;
}

double f(double x, double y) {
        double r36514822 = 3.0;
        double r36514823 = y;
        double r36514824 = r36514822 * r36514823;
        double r36514825 = x;
        double r36514826 = r36514823 * r36514825;
        double r36514827 = r36514824 * r36514826;
        return r36514827;
}

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.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(y \cdot x\right) \cdot 3\right)} \cdot y\]
  6. Using strategy rm
  7. Applied associate-*l*0.2

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

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

Reproduce

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