Average Error: 0.3 → 0.2
Time: 16.5s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot \left(3 \cdot y\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot \left(3 \cdot y\right)\right) \cdot y
double f(double x, double y) {
        double r842002 = x;
        double r842003 = 3.0;
        double r842004 = r842002 * r842003;
        double r842005 = y;
        double r842006 = r842004 * r842005;
        double r842007 = r842006 * r842005;
        return r842007;
}

double f(double x, double y) {
        double r842008 = x;
        double r842009 = 3.0;
        double r842010 = y;
        double r842011 = r842009 * r842010;
        double r842012 = r842008 * r842011;
        double r842013 = r842012 * r842010;
        return r842013;
}

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. Final simplification0.2

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

Reproduce

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