Average Error: 11.0 → 0.2
Time: 10.5s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot x\]
\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(\left(x \cdot 3\right) \cdot y\right) \cdot x
double f(double x, double y) {
        double r779235 = x;
        double r779236 = 3.0;
        double r779237 = r779235 * r779236;
        double r779238 = r779237 * r779235;
        double r779239 = y;
        double r779240 = r779238 * r779239;
        return r779240;
}

double f(double x, double y) {
        double r779241 = x;
        double r779242 = 3.0;
        double r779243 = r779241 * r779242;
        double r779244 = y;
        double r779245 = r779243 * r779244;
        double r779246 = r779245 * r779241;
        return r779246;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.0
Target0.3
Herbie0.2
\[\left(x \cdot 3\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 11.0

    \[\left(\left(x \cdot 3\right) \cdot x\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*0.3

    \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot \left(x \cdot y\right)}\]
  4. Using strategy rm
  5. Applied associate-*l*0.2

    \[\leadsto \color{blue}{x \cdot \left(3 \cdot \left(x \cdot y\right)\right)}\]
  6. Using strategy rm
  7. Applied pow10.2

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

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

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

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

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

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

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

Reproduce

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

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

  (* (* (* x 3) x) y))