Average Error: 10.4 → 0.3
Time: 13.1s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y\]
\[\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot x\]
\left(\left(x \cdot 3.0\right) \cdot x\right) \cdot y
\left(\left(y \cdot 3.0\right) \cdot x\right) \cdot x
double f(double x, double y) {
        double r36957858 = x;
        double r36957859 = 3.0;
        double r36957860 = r36957858 * r36957859;
        double r36957861 = r36957860 * r36957858;
        double r36957862 = y;
        double r36957863 = r36957861 * r36957862;
        return r36957863;
}

double f(double x, double y) {
        double r36957864 = y;
        double r36957865 = 3.0;
        double r36957866 = r36957864 * r36957865;
        double r36957867 = x;
        double r36957868 = r36957866 * r36957867;
        double r36957869 = r36957868 * r36957867;
        return r36957869;
}

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

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

    \[\leadsto \color{blue}{\left(y \cdot \left(x \cdot 3.0\right)\right) \cdot x}\]
  4. Taylor expanded around 0 0.2

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

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

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

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

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

Reproduce

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