Average Error: 0.3 → 0.3
Time: 15.9s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(x \cdot y\right) \cdot y\right) \cdot 3\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(x \cdot y\right) \cdot y\right) \cdot 3
double f(double x, double y) {
        double r985116 = x;
        double r985117 = 3.0;
        double r985118 = r985116 * r985117;
        double r985119 = y;
        double r985120 = r985118 * r985119;
        double r985121 = r985120 * r985119;
        return r985121;
}

double f(double x, double y) {
        double r985122 = x;
        double r985123 = y;
        double r985124 = r985122 * r985123;
        double r985125 = r985124 * r985123;
        double r985126 = 3.0;
        double r985127 = r985125 * r985126;
        return r985127;
}

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 pow10.3

    \[\leadsto \left(\left(x \cdot 3\right) \cdot \color{blue}{{y}^{1}}\right) \cdot y\]
  4. Applied pow10.3

    \[\leadsto \left(\left(x \cdot \color{blue}{{3}^{1}}\right) \cdot {y}^{1}\right) \cdot y\]
  5. Applied pow10.3

    \[\leadsto \left(\left(\color{blue}{{x}^{1}} \cdot {3}^{1}\right) \cdot {y}^{1}\right) \cdot y\]
  6. Applied pow-prod-down0.3

    \[\leadsto \left(\color{blue}{{\left(x \cdot 3\right)}^{1}} \cdot {y}^{1}\right) \cdot y\]
  7. Applied pow-prod-down0.3

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

    \[\leadsto {\color{blue}{\left(3 \cdot \left(x \cdot y\right)\right)}}^{1} \cdot y\]
  9. Using strategy rm
  10. Applied unpow-prod-down0.2

    \[\leadsto \color{blue}{\left({3}^{1} \cdot {\left(x \cdot y\right)}^{1}\right)} \cdot y\]
  11. Applied associate-*l*0.3

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

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

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

Reproduce

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