Average Error: 0.3 → 0.3
Time: 5.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 r815348 = x;
        double r815349 = 3.0;
        double r815350 = r815348 * r815349;
        double r815351 = y;
        double r815352 = r815350 * r815351;
        double r815353 = r815352 * r815351;
        return r815353;
}

double f(double x, double y) {
        double r815354 = 3.0;
        double r815355 = y;
        double r815356 = r815354 * r815355;
        double r815357 = x;
        double r815358 = r815355 * r815357;
        double r815359 = r815356 * r815358;
        return r815359;
}

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020046 +o rules:numerics
(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))