Average Error: 0.3 → 0.2
Time: 13.6s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(x \cdot y\right) \cdot \left(y \cdot 3\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot y\right) \cdot \left(y \cdot 3\right)
double f(double x, double y) {
        double r38561656 = x;
        double r38561657 = 3.0;
        double r38561658 = r38561656 * r38561657;
        double r38561659 = y;
        double r38561660 = r38561658 * r38561659;
        double r38561661 = r38561660 * r38561659;
        return r38561661;
}

double f(double x, double y) {
        double r38561662 = x;
        double r38561663 = y;
        double r38561664 = r38561662 * r38561663;
        double r38561665 = 3.0;
        double r38561666 = r38561663 * r38561665;
        double r38561667 = r38561664 * r38561666;
        return r38561667;
}

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. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{\left(3 \cdot \left(x \cdot y\right)\right)} \cdot y\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.2

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

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

    \[\leadsto \color{blue}{\left(\left(y \cdot x\right) \cdot 3\right)} \cdot y\]
  7. Taylor expanded around 0 10.1

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

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

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

Reproduce

herbie shell --seed 2019172 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"

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

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