Average Error: 3.6 → 1.9
Time: 13.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\ \;\;\;\;\left(-x \cdot \left(y \cdot z\right)\right) + 1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-x\right) \cdot z\right) \cdot y + 1 \cdot x\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\
\;\;\;\;\left(-x \cdot \left(y \cdot z\right)\right) + 1 \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r8174964 = x;
        double r8174965 = 1.0;
        double r8174966 = y;
        double r8174967 = z;
        double r8174968 = r8174966 * r8174967;
        double r8174969 = r8174965 - r8174968;
        double r8174970 = r8174964 * r8174969;
        return r8174970;
}

double f(double x, double y, double z) {
        double r8174971 = y;
        double r8174972 = z;
        double r8174973 = r8174971 * r8174972;
        double r8174974 = 9.523507907051805e+193;
        bool r8174975 = r8174973 <= r8174974;
        double r8174976 = x;
        double r8174977 = r8174976 * r8174973;
        double r8174978 = -r8174977;
        double r8174979 = 1.0;
        double r8174980 = r8174979 * r8174976;
        double r8174981 = r8174978 + r8174980;
        double r8174982 = -r8174976;
        double r8174983 = r8174982 * r8174972;
        double r8174984 = r8174983 * r8174971;
        double r8174985 = r8174984 + r8174980;
        double r8174986 = r8174975 ? r8174981 : r8174985;
        return r8174986;
}

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) < 9.523507907051805e+193

    1. Initial program 2.0

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

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

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

    if 9.523507907051805e+193 < (* y z)

    1. Initial program 26.6

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

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

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

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

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

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

Reproduce

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