Average Error: 3.2 → 3.2
Time: 5.7s
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 r1032 = x;
        double r1033 = 1.0;
        double r1034 = y;
        double r1035 = z;
        double r1036 = r1034 * r1035;
        double r1037 = r1033 - r1036;
        double r1038 = r1032 * r1037;
        return r1038;
}

double f(double x, double y, double z) {
        double r1039 = x;
        double r1040 = 1.0;
        double r1041 = y;
        double r1042 = z;
        double r1043 = r1041 * r1042;
        double r1044 = r1040 - r1043;
        double r1045 = r1039 * r1044;
        double r1046 = -r1042;
        double r1047 = r1042 * r1041;
        double r1048 = fma(r1046, r1041, r1047);
        double r1049 = r1039 * r1048;
        double r1050 = r1045 + r1049;
        return r1050;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 3.2

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

    \[\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.2

    \[\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.2

    \[\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.2

    \[\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.2

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

Reproduce

herbie shell --seed 2020025 +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))))