Average Error: 3.4 → 3.4
Time: 3.2s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[x \cdot \left(1 - y \cdot z\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
x \cdot \left(1 - y \cdot z\right)
x \cdot \left(1 - y \cdot z\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)
double f(double x, double y, double z) {
        double r195937 = x;
        double r195938 = 1.0;
        double r195939 = y;
        double r195940 = z;
        double r195941 = r195939 * r195940;
        double r195942 = r195938 - r195941;
        double r195943 = r195937 * r195942;
        return r195943;
}

double f(double x, double y, double z) {
        double r195944 = x;
        double r195945 = 1.0;
        double r195946 = y;
        double r195947 = z;
        double r195948 = r195946 * r195947;
        double r195949 = r195945 - r195948;
        double r195950 = r195944 * r195949;
        double r195951 = -r195947;
        double r195952 = r195947 * r195946;
        double r195953 = fma(r195951, r195946, r195952);
        double r195954 = r195944 * r195953;
        double r195955 = r195950 + r195954;
        return r195955;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 3.4

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

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

    \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + \mathsf{fma}\left(-z, y, z \cdot y\right)\right)}\]
  5. Applied distribute-lft-in3.4

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

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

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

Reproduce

herbie shell --seed 2020034 +o rules:numerics
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))