Average Error: 10.4 → 0.3
Time: 12.5s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
\[x \cdot \left(\left(y \cdot 3.0\right) \cdot x\right)\]
\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y
x \cdot \left(\left(y \cdot 3.0\right) \cdot x\right)
double f(double x, double y) {
        double r34411387 = x;
        double r34411388 = 3.0;
        double r34411389 = r34411387 * r34411388;
        double r34411390 = r34411389 * r34411387;
        double r34411391 = y;
        double r34411392 = r34411390 * r34411391;
        return r34411392;
}

double f(double x, double y) {
        double r34411393 = x;
        double r34411394 = y;
        double r34411395 = 3.0;
        double r34411396 = r34411394 * r34411395;
        double r34411397 = r34411396 * r34411393;
        double r34411398 = r34411393 * r34411397;
        return r34411398;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.4
Target0.2
Herbie0.3
\[\left(x \cdot 3.0\right) \cdot \left(x \cdot y\right)\]

Derivation

  1. Initial program 10.4

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

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

    \[\leadsto \color{blue}{x \cdot \left(3.0 \cdot \left(x \cdot y\right)\right)}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt0.2

    \[\leadsto x \cdot \left(\color{blue}{\left(\left(\sqrt[3]{3.0} \cdot \sqrt[3]{3.0}\right) \cdot \sqrt[3]{3.0}\right)} \cdot \left(x \cdot y\right)\right)\]
  8. Applied associate-*l*0.4

    \[\leadsto x \cdot \color{blue}{\left(\left(\sqrt[3]{3.0} \cdot \sqrt[3]{3.0}\right) \cdot \left(\sqrt[3]{3.0} \cdot \left(x \cdot y\right)\right)\right)}\]
  9. Using strategy rm
  10. Applied pow10.4

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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

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

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