Average Error: 0.3 → 0.3
Time: 6.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[y \cdot \left(3 \cdot \left(x \cdot y\right)\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
y \cdot \left(3 \cdot \left(x \cdot y\right)\right)
double f(double x, double y) {
        double r534347 = x;
        double r534348 = 3.0;
        double r534349 = r534347 * r534348;
        double r534350 = y;
        double r534351 = r534349 * r534350;
        double r534352 = r534351 * r534350;
        return r534352;
}

double f(double x, double y) {
        double r534353 = y;
        double r534354 = 3.0;
        double r534355 = x;
        double r534356 = r534355 * r534353;
        double r534357 = r534354 * r534356;
        double r534358 = r534353 * r534357;
        return r534358;
}

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 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.3

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

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

Reproduce

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