Average Error: 3.4 → 0.2
Time: 12.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.01053877729367452 \cdot 10^{256} \lor \neg \left(y \cdot z \le 8.8081894731625367 \cdot 10^{223}\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.01053877729367452 \cdot 10^{256} \lor \neg \left(y \cdot z \le 8.8081894731625367 \cdot 10^{223}\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 r314686 = x;
        double r314687 = 1.0;
        double r314688 = y;
        double r314689 = z;
        double r314690 = r314688 * r314689;
        double r314691 = r314687 - r314690;
        double r314692 = r314686 * r314691;
        return r314692;
}

double f(double x, double y, double z) {
        double r314693 = y;
        double r314694 = z;
        double r314695 = r314693 * r314694;
        double r314696 = -1.0105387772936745e+256;
        bool r314697 = r314695 <= r314696;
        double r314698 = 8.808189473162537e+223;
        bool r314699 = r314695 <= r314698;
        double r314700 = !r314699;
        bool r314701 = r314697 || r314700;
        double r314702 = 1.0;
        double r314703 = x;
        double r314704 = r314702 * r314703;
        double r314705 = r314703 * r314693;
        double r314706 = -r314705;
        double r314707 = r314706 * r314694;
        double r314708 = r314704 + r314707;
        double r314709 = -r314695;
        double r314710 = r314703 * r314709;
        double r314711 = r314704 + r314710;
        double r314712 = r314701 ? r314708 : r314711;
        return r314712;
}

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.0105387772936745e+256 or 8.808189473162537e+223 < (* y z)

    1. Initial program 35.4

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

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

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

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

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

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

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

    if -1.0105387772936745e+256 < (* y z) < 8.808189473162537e+223

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.01053877729367452 \cdot 10^{256} \lor \neg \left(y \cdot z \le 8.8081894731625367 \cdot 10^{223}\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 2020042 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))