Average Error: 3.3 → 3.3
Time: 3.2s
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 r286560 = x;
        double r286561 = 1.0;
        double r286562 = y;
        double r286563 = z;
        double r286564 = r286562 * r286563;
        double r286565 = r286561 - r286564;
        double r286566 = r286560 * r286565;
        return r286566;
}

double f(double x, double y, double z) {
        double r286567 = x;
        double r286568 = 1.0;
        double r286569 = y;
        double r286570 = z;
        double r286571 = r286569 * r286570;
        double r286572 = r286568 - r286571;
        double r286573 = r286567 * r286572;
        double r286574 = -r286570;
        double r286575 = r286570 * r286569;
        double r286576 = fma(r286574, r286569, r286575);
        double r286577 = r286567 * r286576;
        double r286578 = r286573 + r286577;
        return r286578;
}

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 2020027 +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))))