Average Error: 3.2 → 0.2
Time: 11.0s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\ \;\;\;\;x \cdot 1 + \left(-x \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\
\;\;\;\;x \cdot 1 + \left(-x \cdot y\right) \cdot z\\

\mathbf{else}:\\
\;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\

\end{array}
double f(double x, double y, double z) {
        double r216344 = x;
        double r216345 = 1.0;
        double r216346 = y;
        double r216347 = z;
        double r216348 = r216346 * r216347;
        double r216349 = r216345 - r216348;
        double r216350 = r216344 * r216349;
        return r216350;
}

double f(double x, double y, double z) {
        double r216351 = y;
        double r216352 = z;
        double r216353 = r216351 * r216352;
        double r216354 = -6.493405250404478e+306;
        bool r216355 = r216353 <= r216354;
        double r216356 = 3.0707001026583607e+167;
        bool r216357 = r216353 <= r216356;
        double r216358 = !r216357;
        bool r216359 = r216355 || r216358;
        double r216360 = x;
        double r216361 = 1.0;
        double r216362 = r216360 * r216361;
        double r216363 = r216360 * r216351;
        double r216364 = -r216363;
        double r216365 = r216364 * r216352;
        double r216366 = r216362 + r216365;
        double r216367 = -r216353;
        double r216368 = r216360 * r216367;
        double r216369 = r216362 + r216368;
        double r216370 = r216359 ? r216366 : r216369;
        return r216370;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (* y z) < -6.493405250404478e+306 or 3.0707001026583607e+167 < (* y z)

    1. Initial program 32.9

      \[x \cdot \left(1 - y \cdot z\right)\]
    2. Using strategy rm
    3. Applied sub-neg32.9

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)}\]
    4. Applied distribute-lft-in32.9

      \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-y \cdot z\right)}\]
    5. Using strategy rm
    6. Applied distribute-lft-neg-in32.9

      \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(\left(-y\right) \cdot z\right)}\]
    7. Applied associate-*r*1.1

      \[\leadsto x \cdot 1 + \color{blue}{\left(x \cdot \left(-y\right)\right) \cdot z}\]
    8. Simplified1.1

      \[\leadsto x \cdot 1 + \color{blue}{\left(-x \cdot y\right)} \cdot z\]

    if -6.493405250404478e+306 < (* y z) < 3.0707001026583607e+167

    1. Initial program 0.1

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

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)}\]
    4. Applied distribute-lft-in0.1

      \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-y \cdot z\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\ \;\;\;\;x \cdot 1 + \left(-x \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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