Average Error: 0.0 → 0.0
Time: 14.1s
Precision: 64
\[\left(x + y\right) \cdot z\]
\[z \cdot y + x \cdot z\]
\left(x + y\right) \cdot z
z \cdot y + x \cdot z
double f(double x, double y, double z) {
        double r954118 = x;
        double r954119 = y;
        double r954120 = r954118 + r954119;
        double r954121 = z;
        double r954122 = r954120 * r954121;
        return r954122;
}

double f(double x, double y, double z) {
        double r954123 = z;
        double r954124 = y;
        double r954125 = r954123 * r954124;
        double r954126 = x;
        double r954127 = r954126 * r954123;
        double r954128 = r954125 + r954127;
        return r954128;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) \cdot z\]
  2. Using strategy rm
  3. Applied flip-+25.3

    \[\leadsto \color{blue}{\frac{x \cdot x - y \cdot y}{x - y}} \cdot z\]
  4. Applied associate-*l/30.3

    \[\leadsto \color{blue}{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\]
  5. Simplified20.1

    \[\leadsto \frac{\color{blue}{\left(z \cdot \left(x - y\right)\right) \cdot \left(x + y\right)}}{x - y}\]
  6. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{z \cdot y + x \cdot z}\]
  7. Final simplification0.0

    \[\leadsto z \cdot y + x \cdot z\]

Reproduce

herbie shell --seed 2019174 
(FPCore (x y z)
  :name "Text.Parsec.Token:makeTokenParser from parsec-3.1.9, B"
  (* (+ x y) z))