Average Error: 3.3 → 0.4
Time: 12.7s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.663668317372582301288343887836903554171 \cdot 10^{152} \lor \neg \left(y \cdot z \le 6.405637489662265506315898471125838856153 \cdot 10^{172}\right):\\ \;\;\;\;1 \cdot x + z \cdot \left(\left(-y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-z \cdot y\right) \cdot x\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -2.663668317372582301288343887836903554171 \cdot 10^{152} \lor \neg \left(y \cdot z \le 6.405637489662265506315898471125838856153 \cdot 10^{172}\right):\\
\;\;\;\;1 \cdot x + z \cdot \left(\left(-y\right) \cdot x\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r219842 = x;
        double r219843 = 1.0;
        double r219844 = y;
        double r219845 = z;
        double r219846 = r219844 * r219845;
        double r219847 = r219843 - r219846;
        double r219848 = r219842 * r219847;
        return r219848;
}

double f(double x, double y, double z) {
        double r219849 = y;
        double r219850 = z;
        double r219851 = r219849 * r219850;
        double r219852 = -2.6636683173725823e+152;
        bool r219853 = r219851 <= r219852;
        double r219854 = 6.405637489662266e+172;
        bool r219855 = r219851 <= r219854;
        double r219856 = !r219855;
        bool r219857 = r219853 || r219856;
        double r219858 = 1.0;
        double r219859 = x;
        double r219860 = r219858 * r219859;
        double r219861 = -r219849;
        double r219862 = r219861 * r219859;
        double r219863 = r219850 * r219862;
        double r219864 = r219860 + r219863;
        double r219865 = r219850 * r219849;
        double r219866 = -r219865;
        double r219867 = r219866 * r219859;
        double r219868 = r219860 + r219867;
        double r219869 = r219857 ? r219864 : r219868;
        return r219869;
}

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) < -2.6636683173725823e+152 or 6.405637489662266e+172 < (* y z)

    1. Initial program 21.3

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

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

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

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

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

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

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

    if -2.6636683173725823e+152 < (* y z) < 6.405637489662266e+172

    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(-z \cdot y\right) \cdot x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -2.663668317372582301288343887836903554171 \cdot 10^{152} \lor \neg \left(y \cdot z \le 6.405637489662265506315898471125838856153 \cdot 10^{172}\right):\\ \;\;\;\;1 \cdot x + z \cdot \left(\left(-y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-z \cdot y\right) \cdot x\\ \end{array}\]

Reproduce

herbie shell --seed 2019208 +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))))