Average Error: 0.1 → 0.0
Time: 5.7s
Precision: 64
\[x - \left(y \cdot 4\right) \cdot z\]
\[x + \left(y \cdot z\right) \cdot \left(-4\right)\]
x - \left(y \cdot 4\right) \cdot z
x + \left(y \cdot z\right) \cdot \left(-4\right)
double f(double x, double y, double z) {
        double r142247 = x;
        double r142248 = y;
        double r142249 = 4.0;
        double r142250 = r142248 * r142249;
        double r142251 = z;
        double r142252 = r142250 * r142251;
        double r142253 = r142247 - r142252;
        return r142253;
}

double f(double x, double y, double z) {
        double r142254 = x;
        double r142255 = y;
        double r142256 = z;
        double r142257 = r142255 * r142256;
        double r142258 = 4.0;
        double r142259 = -r142258;
        double r142260 = r142257 * r142259;
        double r142261 = r142254 + r142260;
        return r142261;
}

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

    \[x - \left(y \cdot 4\right) \cdot z\]
  2. Using strategy rm
  3. Applied sub-neg0.1

    \[\leadsto \color{blue}{x + \left(-\left(y \cdot 4\right) \cdot z\right)}\]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019195 
(FPCore (x y z)
  :name "Diagrams.Solve.Polynomial:quadForm from diagrams-solve-0.1, A"
  (- x (* (* y 4.0) z)))