Average Error: 0.3 → 0.3
Time: 9.6s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot x\right) \cdot y\right) \cdot 3\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot x\right) \cdot y\right) \cdot 3
double f(double x, double y) {
        double r538479 = x;
        double r538480 = 3.0;
        double r538481 = r538479 * r538480;
        double r538482 = y;
        double r538483 = r538481 * r538482;
        double r538484 = r538483 * r538482;
        return r538484;
}

double f(double x, double y) {
        double r538485 = y;
        double r538486 = x;
        double r538487 = r538485 * r538486;
        double r538488 = r538487 * r538485;
        double r538489 = 3.0;
        double r538490 = r538488 * r538489;
        return r538490;
}

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.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 y\right) \cdot \color{blue}{{y}^{1}}\]
  4. Applied pow10.3

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"

  :herbie-target
  (* (* x (* 3.0 y)) y)

  (* (* (* x 3.0) y) y))