Average Error: 3.4 → 3.4
Time: 2.7s
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 r261574 = x;
        double r261575 = 1.0;
        double r261576 = y;
        double r261577 = z;
        double r261578 = r261576 * r261577;
        double r261579 = r261575 - r261578;
        double r261580 = r261574 * r261579;
        return r261580;
}

double f(double x, double y, double z) {
        double r261581 = x;
        double r261582 = 1.0;
        double r261583 = r261581 * r261582;
        double r261584 = y;
        double r261585 = z;
        double r261586 = r261584 * r261585;
        double r261587 = -r261586;
        double r261588 = r261581 * r261587;
        double r261589 = r261583 + r261588;
        double r261590 = -r261585;
        double r261591 = r261585 * r261584;
        double r261592 = fma(r261590, r261584, r261591);
        double r261593 = r261581 * r261592;
        double r261594 = r261589 + r261593;
        return r261594;
}

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

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

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

    \[\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 2020018 +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))))