Average Error: 3.3 → 3.3
Time: 4.4s
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 r304174 = x;
        double r304175 = 1.0;
        double r304176 = y;
        double r304177 = z;
        double r304178 = r304176 * r304177;
        double r304179 = r304175 - r304178;
        double r304180 = r304174 * r304179;
        return r304180;
}

double f(double x, double y, double z) {
        double r304181 = x;
        double r304182 = 1.0;
        double r304183 = y;
        double r304184 = z;
        double r304185 = r304183 * r304184;
        double r304186 = r304182 - r304185;
        double r304187 = r304181 * r304186;
        double r304188 = -r304184;
        double r304189 = r304184 * r304183;
        double r304190 = fma(r304188, r304183, r304189);
        double r304191 = r304181 * r304190;
        double r304192 = r304187 + r304191;
        return r304192;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 3.3

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

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

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

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

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

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

Reproduce

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