Average Error: 0.3 → 0.2
Time: 21.7s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(3 \cdot \left(x \cdot y\right)\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(3 \cdot \left(x \cdot y\right)\right) \cdot y
double f(double x, double y) {
        double r708956 = x;
        double r708957 = 3.0;
        double r708958 = r708956 * r708957;
        double r708959 = y;
        double r708960 = r708958 * r708959;
        double r708961 = r708960 * r708959;
        return r708961;
}

double f(double x, double y) {
        double r708962 = 3.0;
        double r708963 = x;
        double r708964 = y;
        double r708965 = r708963 * r708964;
        double r708966 = r708962 * r708965;
        double r708967 = r708966 * r708964;
        return r708967;
}

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(3 \cdot \left(x \cdot y\right)\right)} \cdot y\]
  6. Final simplification0.2

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

Reproduce

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