Average Error: 3.2 → 1.6
Time: 11.5s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.67076187437381618 \cdot 10^{51} \lor \neg \left(z \le 1.12156159715755164 \cdot 10^{83}\right):\\ \;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-x\right) \cdot \left(z \cdot y\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;z \le -4.67076187437381618 \cdot 10^{51} \lor \neg \left(z \le 1.12156159715755164 \cdot 10^{83}\right):\\
\;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r285136 = x;
        double r285137 = 1.0;
        double r285138 = y;
        double r285139 = z;
        double r285140 = r285138 * r285139;
        double r285141 = r285137 - r285140;
        double r285142 = r285136 * r285141;
        return r285142;
}

double f(double x, double y, double z) {
        double r285143 = z;
        double r285144 = -4.670761874373816e+51;
        bool r285145 = r285143 <= r285144;
        double r285146 = 1.1215615971575516e+83;
        bool r285147 = r285143 <= r285146;
        double r285148 = !r285147;
        bool r285149 = r285145 || r285148;
        double r285150 = 1.0;
        double r285151 = x;
        double r285152 = r285150 * r285151;
        double r285153 = y;
        double r285154 = r285151 * r285153;
        double r285155 = -r285154;
        double r285156 = r285155 * r285143;
        double r285157 = r285152 + r285156;
        double r285158 = -r285151;
        double r285159 = r285143 * r285153;
        double r285160 = r285158 * r285159;
        double r285161 = r285152 + r285160;
        double r285162 = r285149 ? r285157 : r285161;
        return r285162;
}

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 z < -4.670761874373816e+51 or 1.1215615971575516e+83 < z

    1. Initial program 9.9

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

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

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

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

      \[\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 -4.670761874373816e+51 < z < 1.1215615971575516e+83

    1. Initial program 0.4

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

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

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

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

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

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(-x \cdot y\right)} \cdot z\]
    10. Using strategy rm
    11. Applied distribute-lft-neg-in4.8

      \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-x\right) \cdot y\right)} \cdot z\]
    12. Applied associate-*l*0.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.67076187437381618 \cdot 10^{51} \lor \neg \left(z \le 1.12156159715755164 \cdot 10^{83}\right):\\ \;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-x\right) \cdot \left(z \cdot y\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))))