Average Error: 0.0 → 0.0
Time: 7.7s
Precision: 64
\[x \cdot y + \left(x - 1\right) \cdot z\]
\[\left(x \cdot y + z \cdot x\right) - z \cdot 1\]
x \cdot y + \left(x - 1\right) \cdot z
\left(x \cdot y + z \cdot x\right) - z \cdot 1
double f(double x, double y, double z) {
        double r128187 = x;
        double r128188 = y;
        double r128189 = r128187 * r128188;
        double r128190 = 1.0;
        double r128191 = r128187 - r128190;
        double r128192 = z;
        double r128193 = r128191 * r128192;
        double r128194 = r128189 + r128193;
        return r128194;
}

double f(double x, double y, double z) {
        double r128195 = x;
        double r128196 = y;
        double r128197 = r128195 * r128196;
        double r128198 = z;
        double r128199 = r128198 * r128195;
        double r128200 = r128197 + r128199;
        double r128201 = 1.0;
        double r128202 = r128198 * r128201;
        double r128203 = r128200 - r128202;
        return r128203;
}

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

    \[x \cdot y + \left(x - 1\right) \cdot z\]
  2. Simplified0.0

    \[\leadsto \color{blue}{x \cdot \left(y + z\right) - 1 \cdot z}\]
  3. Using strategy rm
  4. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{\left(x \cdot y + x \cdot z\right)} - 1 \cdot z\]
  5. Final simplification0.0

    \[\leadsto \left(x \cdot y + z \cdot x\right) - z \cdot 1\]

Reproduce

herbie shell --seed 2019196 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Drawing:drawTextsR from Chart-1.5.3"
  (+ (* x y) (* (- x 1.0) z)))