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 r252382 = x;
        double r252383 = 1.0;
        double r252384 = y;
        double r252385 = z;
        double r252386 = r252384 * r252385;
        double r252387 = r252383 - r252386;
        double r252388 = r252382 * r252387;
        return r252388;
}

double f(double x, double y, double z) {
        double r252389 = x;
        double r252390 = 1.0;
        double r252391 = r252389 * r252390;
        double r252392 = y;
        double r252393 = z;
        double r252394 = r252392 * r252393;
        double r252395 = -r252394;
        double r252396 = r252389 * r252395;
        double r252397 = r252391 + r252396;
        double r252398 = -r252393;
        double r252399 = r252393 * r252392;
        double r252400 = fma(r252398, r252392, r252399);
        double r252401 = r252389 * r252400;
        double r252402 = r252397 + r252401;
        return r252402;
}

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