Average Error: 3.3 → 0.3
Time: 2.8s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + 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.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r244179 = x;
        double r244180 = 1.0;
        double r244181 = y;
        double r244182 = z;
        double r244183 = r244181 * r244182;
        double r244184 = r244180 - r244183;
        double r244185 = r244179 * r244184;
        return r244185;
}

double f(double x, double y, double z) {
        double r244186 = y;
        double r244187 = z;
        double r244188 = r244186 * r244187;
        double r244189 = -1.8511185685143662e+157;
        bool r244190 = r244188 <= r244189;
        double r244191 = 7.089590365379835e+176;
        bool r244192 = r244188 <= r244191;
        double r244193 = !r244192;
        bool r244194 = r244190 || r244193;
        double r244195 = x;
        double r244196 = 1.0;
        double r244197 = r244195 * r244196;
        double r244198 = -r244186;
        double r244199 = r244195 * r244198;
        double r244200 = r244199 * r244187;
        double r244201 = r244197 + r244200;
        double r244202 = -r244188;
        double r244203 = r244195 * r244202;
        double r244204 = r244197 + r244203;
        double r244205 = r244194 ? r244201 : r244204;
        return r244205;
}

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.8511185685143662e+157 or 7.089590365379835e+176 < (* y z)

    1. Initial program 20.5

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

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

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

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

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

    if -1.8511185685143662e+157 < (* y z) < 7.089590365379835e+176

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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