Average Error: 3.6 → 1.9
Time: 10.5s
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}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right) + 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}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right) + 1 \cdot x\\

\end{array}
double f(double x, double y, double z) {
        double r9796797 = x;
        double r9796798 = 1.0;
        double r9796799 = y;
        double r9796800 = z;
        double r9796801 = r9796799 * r9796800;
        double r9796802 = r9796798 - r9796801;
        double r9796803 = r9796797 * r9796802;
        return r9796803;
}

double f(double x, double y, double z) {
        double r9796804 = y;
        double r9796805 = z;
        double r9796806 = r9796804 * r9796805;
        double r9796807 = 9.523507907051805e+193;
        bool r9796808 = r9796806 <= r9796807;
        double r9796809 = x;
        double r9796810 = r9796809 * r9796806;
        double r9796811 = -r9796810;
        double r9796812 = 1.0;
        double r9796813 = r9796812 * r9796809;
        double r9796814 = r9796811 + r9796813;
        double r9796815 = -r9796809;
        double r9796816 = r9796805 * r9796815;
        double r9796817 = r9796804 * r9796816;
        double r9796818 = r9796817 + r9796813;
        double r9796819 = r9796808 ? r9796814 : r9796818;
        return r9796819;
}

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-lft-neg-in26.6

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(-y\right) \cdot \left(z \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}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-x\right)\right) + 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))))