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

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

\end{array}
double f(double x, double y, double z) {
        double r318161 = x;
        double r318162 = 1.0;
        double r318163 = y;
        double r318164 = z;
        double r318165 = r318163 * r318164;
        double r318166 = r318162 - r318165;
        double r318167 = r318161 * r318166;
        return r318167;
}

double f(double x, double y, double z) {
        double r318168 = y;
        double r318169 = z;
        double r318170 = r318168 * r318169;
        double r318171 = -6.493405250404478e+306;
        bool r318172 = r318170 <= r318171;
        double r318173 = 3.0707001026583607e+167;
        bool r318174 = r318170 <= r318173;
        double r318175 = !r318174;
        bool r318176 = r318172 || r318175;
        double r318177 = 1.0;
        double r318178 = x;
        double r318179 = r318177 * r318178;
        double r318180 = r318178 * r318168;
        double r318181 = -r318169;
        double r318182 = r318180 * r318181;
        double r318183 = r318179 + r318182;
        double r318184 = -r318170;
        double r318185 = r318178 * r318184;
        double r318186 = r318179 + r318185;
        double r318187 = r318176 ? r318183 : r318186;
        return r318187;
}

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. Simplified32.9

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

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

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

    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. Simplified0.1

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

Reproduce

herbie shell --seed 2020047 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))