Average Error: 3.5 → 0.4
Time: 38.2s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -4.6061225907911574 \cdot 10^{+111}:\\ \;\;\;\;x \cdot 1.0 + z \cdot \left(y \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \cdot z \le 1.7446271795325757 \cdot 10^{+271}:\\ \;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + x \cdot 1.0\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + z \cdot \left(y \cdot \left(-x\right)\right)\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -4.6061225907911574 \cdot 10^{+111}:\\
\;\;\;\;x \cdot 1.0 + z \cdot \left(y \cdot \left(-x\right)\right)\\

\mathbf{elif}\;y \cdot z \le 1.7446271795325757 \cdot 10^{+271}:\\
\;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + x \cdot 1.0\\

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

\end{array}
double f(double x, double y, double z) {
        double r9988196 = x;
        double r9988197 = 1.0;
        double r9988198 = y;
        double r9988199 = z;
        double r9988200 = r9988198 * r9988199;
        double r9988201 = r9988197 - r9988200;
        double r9988202 = r9988196 * r9988201;
        return r9988202;
}

double f(double x, double y, double z) {
        double r9988203 = y;
        double r9988204 = z;
        double r9988205 = r9988203 * r9988204;
        double r9988206 = -4.6061225907911574e+111;
        bool r9988207 = r9988205 <= r9988206;
        double r9988208 = x;
        double r9988209 = 1.0;
        double r9988210 = r9988208 * r9988209;
        double r9988211 = -r9988208;
        double r9988212 = r9988203 * r9988211;
        double r9988213 = r9988204 * r9988212;
        double r9988214 = r9988210 + r9988213;
        double r9988215 = 1.7446271795325757e+271;
        bool r9988216 = r9988205 <= r9988215;
        double r9988217 = -r9988204;
        double r9988218 = r9988217 * r9988203;
        double r9988219 = r9988218 * r9988208;
        double r9988220 = r9988219 + r9988210;
        double r9988221 = r9988216 ? r9988220 : r9988214;
        double r9988222 = r9988207 ? r9988214 : r9988221;
        return r9988222;
}

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) < -4.6061225907911574e+111 or 1.7446271795325757e+271 < (* y z)

    1. Initial program 23.5

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

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

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

      \[\leadsto x \cdot 1.0 + x \cdot \color{blue}{\left(y \cdot \left(-z\right)\right)}\]
    7. Applied associate-*r*2.2

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

    if -4.6061225907911574e+111 < (* y z) < 1.7446271795325757e+271

    1. Initial program 0.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -4.6061225907911574 \cdot 10^{+111}:\\ \;\;\;\;x \cdot 1.0 + z \cdot \left(y \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \cdot z \le 1.7446271795325757 \cdot 10^{+271}:\\ \;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + x \cdot 1.0\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + z \cdot \left(y \cdot \left(-x\right)\right)\\ \end{array}\]

Reproduce

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