Average Error: 3.3 → 0.2
Time: 14.3s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.17685647831489084453456189150995397973 \cdot 10^{221} \lor \neg \left(y \cdot z \le 7.312372482130218940754485960634465779355 \cdot 10^{187}\right):\\ \;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -1.17685647831489084453456189150995397973 \cdot 10^{221} \lor \neg \left(y \cdot z \le 7.312372482130218940754485960634465779355 \cdot 10^{187}\right):\\
\;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r149239 = x;
        double r149240 = 1.0;
        double r149241 = y;
        double r149242 = z;
        double r149243 = r149241 * r149242;
        double r149244 = r149240 - r149243;
        double r149245 = r149239 * r149244;
        return r149245;
}

double f(double x, double y, double z) {
        double r149246 = y;
        double r149247 = z;
        double r149248 = r149246 * r149247;
        double r149249 = -1.1768564783148908e+221;
        bool r149250 = r149248 <= r149249;
        double r149251 = 7.312372482130219e+187;
        bool r149252 = r149248 <= r149251;
        double r149253 = !r149252;
        bool r149254 = r149250 || r149253;
        double r149255 = 1.0;
        double r149256 = x;
        double r149257 = r149255 * r149256;
        double r149258 = -r149256;
        double r149259 = r149247 * r149258;
        double r149260 = r149246 * r149259;
        double r149261 = r149257 + r149260;
        double r149262 = -r149248;
        double r149263 = r149262 * r149256;
        double r149264 = r149257 + r149263;
        double r149265 = r149254 ? r149261 : r149264;
        return r149265;
}

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.1768564783148908e+221 or 7.312372482130219e+187 < (* y z)

    1. Initial program 27.5

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

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

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

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

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

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

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

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

    if -1.1768564783148908e+221 < (* y z) < 7.312372482130219e+187

    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)\]
    6. Simplified0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.17685647831489084453456189150995397973 \cdot 10^{221} \lor \neg \left(y \cdot z \le 7.312372482130218940754485960634465779355 \cdot 10^{187}\right):\\ \;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \end{array}\]

Reproduce

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