Average Error: 0.0 → 0.0
Time: 2.8s
Precision: 64
\[x - \left(y \cdot 4\right) \cdot z\]
\[\mathsf{fma}\left(-4 \cdot z, y, x\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4\]
x - \left(y \cdot 4\right) \cdot z
\mathsf{fma}\left(-4 \cdot z, y, x\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4
double f(double x, double y, double z) {
        double r232426 = x;
        double r232427 = y;
        double r232428 = 4.0;
        double r232429 = r232427 * r232428;
        double r232430 = z;
        double r232431 = r232429 * r232430;
        double r232432 = r232426 - r232431;
        return r232432;
}

double f(double x, double y, double z) {
        double r232433 = 4.0;
        double r232434 = z;
        double r232435 = r232433 * r232434;
        double r232436 = -r232435;
        double r232437 = y;
        double r232438 = x;
        double r232439 = fma(r232436, r232437, r232438);
        double r232440 = r232434 - r232434;
        double r232441 = r232440 * r232437;
        double r232442 = r232441 * r232433;
        double r232443 = r232439 + r232442;
        return r232443;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.0

    \[x - \left(y \cdot 4\right) \cdot z\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.8

    \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} - \left(y \cdot 4\right) \cdot z\]
  4. Applied prod-diff0.8

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -z \cdot \left(y \cdot 4\right)\right) + \mathsf{fma}\left(-z, y \cdot 4, z \cdot \left(y \cdot 4\right)\right)}\]
  5. Simplified0.8

    \[\leadsto \color{blue}{\mathsf{fma}\left(-4 \cdot z, y, {\left(\sqrt[3]{x}\right)}^{3}\right)} + \mathsf{fma}\left(-z, y \cdot 4, z \cdot \left(y \cdot 4\right)\right)\]
  6. Simplified0.8

    \[\leadsto \mathsf{fma}\left(-4 \cdot z, y, {\left(\sqrt[3]{x}\right)}^{3}\right) + \color{blue}{\left(\left(z - z\right) \cdot y\right) \cdot 4}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.8

    \[\leadsto \mathsf{fma}\left(-4 \cdot z, y, {\left(\sqrt[3]{\color{blue}{1 \cdot x}}\right)}^{3}\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4\]
  9. Applied cbrt-prod0.8

    \[\leadsto \mathsf{fma}\left(-4 \cdot z, y, {\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{x}\right)}}^{3}\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4\]
  10. Applied unpow-prod-down0.8

    \[\leadsto \mathsf{fma}\left(-4 \cdot z, y, \color{blue}{{\left(\sqrt[3]{1}\right)}^{3} \cdot {\left(\sqrt[3]{x}\right)}^{3}}\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4\]
  11. Simplified0.8

    \[\leadsto \mathsf{fma}\left(-4 \cdot z, y, \color{blue}{1} \cdot {\left(\sqrt[3]{x}\right)}^{3}\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4\]
  12. Simplified0.0

    \[\leadsto \mathsf{fma}\left(-4 \cdot z, y, 1 \cdot \color{blue}{x}\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4\]
  13. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(-4 \cdot z, y, x\right) + \left(\left(z - z\right) \cdot y\right) \cdot 4\]

Reproduce

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