Average Error: 0.3 → 0.2
Time: 14.8s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot y\right) \cdot \left(y \cdot 3\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot y\right) \cdot \left(y \cdot 3\right)
double f(double x, double y) {
        double r33564846 = x;
        double r33564847 = 3.0;
        double r33564848 = r33564846 * r33564847;
        double r33564849 = y;
        double r33564850 = r33564848 * r33564849;
        double r33564851 = r33564850 * r33564849;
        return r33564851;
}

double f(double x, double y) {
        double r33564852 = x;
        double r33564853 = y;
        double r33564854 = r33564852 * r33564853;
        double r33564855 = 3.0;
        double r33564856 = r33564853 * r33564855;
        double r33564857 = r33564854 * r33564856;
        return r33564857;
}

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

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

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

Reproduce

herbie shell --seed 2019169 
(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))