Average Error: 0.1 → 0.1
Time: 6.9s
Precision: 64
\[x - \left(y \cdot 4.0\right) \cdot z\]
\[\left(\left(4.0 \cdot y\right) \cdot z + x\right) \cdot \frac{x - \left(4.0 \cdot y\right) \cdot z}{\left(4.0 \cdot y\right) \cdot z + x}\]
x - \left(y \cdot 4.0\right) \cdot z
\left(\left(4.0 \cdot y\right) \cdot z + x\right) \cdot \frac{x - \left(4.0 \cdot y\right) \cdot z}{\left(4.0 \cdot y\right) \cdot z + x}
double f(double x, double y, double z) {
        double r3296301 = x;
        double r3296302 = y;
        double r3296303 = 4.0;
        double r3296304 = r3296302 * r3296303;
        double r3296305 = z;
        double r3296306 = r3296304 * r3296305;
        double r3296307 = r3296301 - r3296306;
        return r3296307;
}

double f(double x, double y, double z) {
        double r3296308 = 4.0;
        double r3296309 = y;
        double r3296310 = r3296308 * r3296309;
        double r3296311 = z;
        double r3296312 = r3296310 * r3296311;
        double r3296313 = x;
        double r3296314 = r3296312 + r3296313;
        double r3296315 = r3296313 - r3296312;
        double r3296316 = r3296315 / r3296314;
        double r3296317 = r3296314 * r3296316;
        return r3296317;
}

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.0\right) \cdot z\]
  2. Using strategy rm
  3. Applied flip--27.7

    \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(y \cdot 4.0\right) \cdot z\right) \cdot \left(\left(y \cdot 4.0\right) \cdot z\right)}{x + \left(y \cdot 4.0\right) \cdot z}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity27.7

    \[\leadsto \frac{x \cdot x - \left(\left(y \cdot 4.0\right) \cdot z\right) \cdot \left(\left(y \cdot 4.0\right) \cdot z\right)}{\color{blue}{1 \cdot \left(x + \left(y \cdot 4.0\right) \cdot z\right)}}\]
  6. Applied difference-of-squares27.6

    \[\leadsto \frac{\color{blue}{\left(x + \left(y \cdot 4.0\right) \cdot z\right) \cdot \left(x - \left(y \cdot 4.0\right) \cdot z\right)}}{1 \cdot \left(x + \left(y \cdot 4.0\right) \cdot z\right)}\]
  7. Applied times-frac0.1

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

    \[\leadsto \left(\left(4.0 \cdot y\right) \cdot z + x\right) \cdot \frac{x - \left(4.0 \cdot y\right) \cdot z}{\left(4.0 \cdot y\right) \cdot z + x}\]

Reproduce

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