Average Error: 3.2 → 0.2
Time: 5.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 \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - 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 \left(-y\right)\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r288335 = x;
        double r288336 = 1.0;
        double r288337 = y;
        double r288338 = z;
        double r288339 = r288337 * r288338;
        double r288340 = r288336 - r288339;
        double r288341 = r288335 * r288340;
        return r288341;
}

double f(double x, double y, double z) {
        double r288342 = y;
        double r288343 = z;
        double r288344 = r288342 * r288343;
        double r288345 = -6.493405250404478e+306;
        bool r288346 = r288344 <= r288345;
        double r288347 = 3.0707001026583607e+167;
        bool r288348 = r288344 <= r288347;
        double r288349 = !r288348;
        bool r288350 = r288346 || r288349;
        double r288351 = x;
        double r288352 = 1.0;
        double r288353 = r288351 * r288352;
        double r288354 = -r288342;
        double r288355 = r288351 * r288354;
        double r288356 = r288355 * r288343;
        double r288357 = r288353 + r288356;
        double r288358 = r288352 - r288344;
        double r288359 = r288351 * r288358;
        double r288360 = r288350 ? r288357 : r288359;
        return r288360;
}

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}\]

    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)}\]
    5. Using strategy rm
    6. Applied distribute-lft-out0.1

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

      \[\leadsto x \cdot \color{blue}{\left(1 - 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 \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - 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))))