Average Error: 3.1 → 3.1
Time: 4.0s
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 r276248 = x;
        double r276249 = 1.0;
        double r276250 = y;
        double r276251 = z;
        double r276252 = r276250 * r276251;
        double r276253 = r276249 - r276252;
        double r276254 = r276248 * r276253;
        return r276254;
}

double f(double x, double y, double z) {
        double r276255 = x;
        double r276256 = 1.0;
        double r276257 = y;
        double r276258 = z;
        double r276259 = r276257 * r276258;
        double r276260 = r276256 - r276259;
        double r276261 = r276255 * r276260;
        double r276262 = -r276258;
        double r276263 = r276258 * r276257;
        double r276264 = fma(r276262, r276257, r276263);
        double r276265 = r276255 * r276264;
        double r276266 = r276261 + r276265;
        return r276266;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 3.1

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

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

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

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

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

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

Reproduce

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