Average Error: 0.3 → 0.2
Time: 19.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(3 \cdot y\right) \cdot \left(y \cdot x\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(3 \cdot y\right) \cdot \left(y \cdot x\right)
double f(double x, double y) {
        double r493670 = x;
        double r493671 = 3.0;
        double r493672 = r493670 * r493671;
        double r493673 = y;
        double r493674 = r493672 * r493673;
        double r493675 = r493674 * r493673;
        return r493675;
}

double f(double x, double y) {
        double r493676 = 3.0;
        double r493677 = y;
        double r493678 = r493676 * r493677;
        double r493679 = x;
        double r493680 = r493677 * r493679;
        double r493681 = r493678 * r493680;
        return r493681;
}

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

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

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

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

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

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

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

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

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

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

Reproduce

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