Average Error: 0.3 → 0.2
Time: 6.2s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(y \cdot 3\right) \cdot \left(x \cdot y\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(y \cdot 3\right) \cdot \left(x \cdot y\right)
double f(double x, double y) {
        double r584084 = x;
        double r584085 = 3.0;
        double r584086 = r584084 * r584085;
        double r584087 = y;
        double r584088 = r584086 * r584087;
        double r584089 = r584088 * r584087;
        return r584089;
}

double f(double x, double y) {
        double r584090 = y;
        double r584091 = 3.0;
        double r584092 = r584090 * r584091;
        double r584093 = x;
        double r584094 = r584093 * r584090;
        double r584095 = r584092 * r584094;
        return r584095;
}

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

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

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

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

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

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

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

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

    \[\leadsto {\color{blue}{\left(y \cdot \left(3 \cdot \left(x \cdot y\right)\right)\right)}}^{1}\]
  14. Using strategy rm
  15. Applied associate-*r*0.2

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

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

Reproduce

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