Average Error: 3.2 → 3.2
Time: 2.6s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
x \cdot \left(1 - y \cdot z\right)
\left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)
double f(double x, double y, double z) {
        double r242350 = x;
        double r242351 = 1.0;
        double r242352 = y;
        double r242353 = z;
        double r242354 = r242352 * r242353;
        double r242355 = r242351 - r242354;
        double r242356 = r242350 * r242355;
        return r242356;
}

double f(double x, double y, double z) {
        double r242357 = x;
        double r242358 = 1.0;
        double r242359 = r242357 * r242358;
        double r242360 = y;
        double r242361 = z;
        double r242362 = r242360 * r242361;
        double r242363 = -r242362;
        double r242364 = r242357 * r242363;
        double r242365 = r242359 + r242364;
        double r242366 = -r242361;
        double r242367 = r242361 * r242360;
        double r242368 = fma(r242366, r242360, r242367);
        double r242369 = r242357 * r242368;
        double r242370 = r242365 + r242369;
        return r242370;
}

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. Using strategy rm
  8. Applied sub-neg3.2

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

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

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

Reproduce

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