Average Error: 0.3 → 0.2
Time: 24.3s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(y \cdot x\right) \cdot \left(y \cdot 3\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(y \cdot x\right) \cdot \left(y \cdot 3\right)
double f(double x, double y) {
        double r399058 = x;
        double r399059 = 3.0;
        double r399060 = r399058 * r399059;
        double r399061 = y;
        double r399062 = r399060 * r399061;
        double r399063 = r399062 * r399061;
        return r399063;
}

double f(double x, double y) {
        double r399064 = y;
        double r399065 = x;
        double r399066 = r399064 * r399065;
        double r399067 = 3.0;
        double r399068 = r399064 * r399067;
        double r399069 = r399066 * r399068;
        return r399069;
}

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 associate-*l*0.2

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

    \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot 3\right)}\right) \cdot y\]
  5. Using strategy rm
  6. Applied associate-*r*0.3

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

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

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

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

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

Reproduce

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

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

  (* (* (* x 3) y) y))