Average Error: 0.3 → 0.3
Time: 21.2s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[y \cdot \left(x \cdot \left(3 \cdot y\right)\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
y \cdot \left(x \cdot \left(3 \cdot y\right)\right)
double f(double x, double y) {
        double r599751 = x;
        double r599752 = 3.0;
        double r599753 = r599751 * r599752;
        double r599754 = y;
        double r599755 = r599753 * r599754;
        double r599756 = r599755 * r599754;
        return r599756;
}

double f(double x, double y) {
        double r599757 = y;
        double r599758 = x;
        double r599759 = 3.0;
        double r599760 = r599759 * r599757;
        double r599761 = r599758 * r599760;
        double r599762 = r599757 * r599761;
        return r599762;
}

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.3
\[\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.3

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

    \[\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. Using strategy rm
  11. Applied associate-*l*0.3

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

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

Reproduce

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