Average Error: 3.4 → 0.9
Time: 11.5s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.6429161822787508 \cdot 10^{58} \lor \neg \left(y \cdot z \le 1.1216381272031817 \cdot 10^{279}\right):\\ \;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\ \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 -1.6429161822787508 \cdot 10^{58} \lor \neg \left(y \cdot z \le 1.1216381272031817 \cdot 10^{279}\right):\\
\;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r325130 = x;
        double r325131 = 1.0;
        double r325132 = y;
        double r325133 = z;
        double r325134 = r325132 * r325133;
        double r325135 = r325131 - r325134;
        double r325136 = r325130 * r325135;
        return r325136;
}

double f(double x, double y, double z) {
        double r325137 = y;
        double r325138 = z;
        double r325139 = r325137 * r325138;
        double r325140 = -1.6429161822787508e+58;
        bool r325141 = r325139 <= r325140;
        double r325142 = 1.1216381272031817e+279;
        bool r325143 = r325139 <= r325142;
        double r325144 = !r325143;
        bool r325145 = r325141 || r325144;
        double r325146 = 1.0;
        double r325147 = x;
        double r325148 = r325146 * r325147;
        double r325149 = r325147 * r325137;
        double r325150 = -r325149;
        double r325151 = r325150 * r325138;
        double r325152 = r325148 + r325151;
        double r325153 = -r325139;
        double r325154 = r325147 * r325153;
        double r325155 = r325148 + r325154;
        double r325156 = r325145 ? r325152 : r325155;
        return r325156;
}

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) < -1.6429161822787508e+58 or 1.1216381272031817e+279 < (* y z)

    1. Initial program 18.1

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

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

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

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

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

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

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

    if -1.6429161822787508e+58 < (* y z) < 1.1216381272031817e+279

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.6429161822787508 \cdot 10^{58} \lor \neg \left(y \cdot z \le 1.1216381272031817 \cdot 10^{279}\right):\\ \;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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