Average Error: 3.2 → 0.1
Time: 10.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{elif}\;y \cdot z \le 4.846810561336122803327637730521116709748 \cdot 10^{268}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260}:\\
\;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\

\mathbf{elif}\;y \cdot z \le 4.846810561336122803327637730521116709748 \cdot 10^{268}:\\
\;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r17905058 = x;
        double r17905059 = 1.0;
        double r17905060 = y;
        double r17905061 = z;
        double r17905062 = r17905060 * r17905061;
        double r17905063 = r17905059 - r17905062;
        double r17905064 = r17905058 * r17905063;
        return r17905064;
}

double f(double x, double y, double z) {
        double r17905065 = y;
        double r17905066 = z;
        double r17905067 = r17905065 * r17905066;
        double r17905068 = -7.045922148172358e+260;
        bool r17905069 = r17905067 <= r17905068;
        double r17905070 = x;
        double r17905071 = 1.0;
        double r17905072 = r17905070 * r17905071;
        double r17905073 = -r17905065;
        double r17905074 = r17905070 * r17905073;
        double r17905075 = r17905074 * r17905066;
        double r17905076 = r17905072 + r17905075;
        double r17905077 = 4.846810561336123e+268;
        bool r17905078 = r17905067 <= r17905077;
        double r17905079 = -r17905067;
        double r17905080 = r17905070 * r17905079;
        double r17905081 = r17905072 + r17905080;
        double r17905082 = r17905078 ? r17905081 : r17905076;
        double r17905083 = r17905069 ? r17905076 : r17905082;
        return r17905083;
}

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) < -7.045922148172358e+260 or 4.846810561336123e+268 < (* y z)

    1. Initial program 40.7

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

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

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

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

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

    if -7.045922148172358e+260 < (* y z) < 4.846810561336123e+268

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{elif}\;y \cdot z \le 4.846810561336122803327637730521116709748 \cdot 10^{268}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]

Reproduce

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