Average Error: 0.0 → 0.0
Time: 4.9s
Precision: 64
\[x - \left(y \cdot 4\right) \cdot z\]
\[\mathsf{fma}\left(y, -4 \cdot z, x\right) + \left(4 - 4\right) \cdot \left(z \cdot y\right)\]
x - \left(y \cdot 4\right) \cdot z
\mathsf{fma}\left(y, -4 \cdot z, x\right) + \left(4 - 4\right) \cdot \left(z \cdot y\right)
double f(double x, double y, double z) {
        double r209823 = x;
        double r209824 = y;
        double r209825 = 4.0;
        double r209826 = r209824 * r209825;
        double r209827 = z;
        double r209828 = r209826 * r209827;
        double r209829 = r209823 - r209828;
        return r209829;
}

double f(double x, double y, double z) {
        double r209830 = y;
        double r209831 = 4.0;
        double r209832 = z;
        double r209833 = r209831 * r209832;
        double r209834 = -r209833;
        double r209835 = x;
        double r209836 = fma(r209830, r209834, r209835);
        double r209837 = r209831 - r209831;
        double r209838 = r209832 * r209830;
        double r209839 = r209837 * r209838;
        double r209840 = r209836 + r209839;
        return r209840;
}

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(y, -4 \cdot z, {\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(y, -4 \cdot z, {\left(\sqrt[3]{x}\right)}^{3}\right) + \color{blue}{\left(4 - 4\right) \cdot \left(z \cdot y\right)}\]
  7. Using strategy rm
  8. Applied pow1/334.1

    \[\leadsto \mathsf{fma}\left(y, -4 \cdot z, {\color{blue}{\left({x}^{\frac{1}{3}}\right)}}^{3}\right) + \left(4 - 4\right) \cdot \left(z \cdot y\right)\]
  9. Applied pow-pow0.0

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

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

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

Reproduce

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