Average Error: 3.2 → 0.1
Time: 17.2s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -4.669421891352288613719777613748852304779 \cdot 10^{254}:\\ \;\;\;\;1 \cdot x + \left(-\left(y \cdot x\right) \cdot z\right)\\ \mathbf{elif}\;y \cdot z \le 5.755978675212138066765801917754853343075 \cdot 10^{280}:\\ \;\;\;\;\left(y \cdot \left(-z\right)\right) \cdot x + 1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -4.669421891352288613719777613748852304779 \cdot 10^{254}:\\
\;\;\;\;1 \cdot x + \left(-\left(y \cdot x\right) \cdot z\right)\\

\mathbf{elif}\;y \cdot z \le 5.755978675212138066765801917754853343075 \cdot 10^{280}:\\
\;\;\;\;\left(y \cdot \left(-z\right)\right) \cdot x + 1 \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r13610750 = x;
        double r13610751 = 1.0;
        double r13610752 = y;
        double r13610753 = z;
        double r13610754 = r13610752 * r13610753;
        double r13610755 = r13610751 - r13610754;
        double r13610756 = r13610750 * r13610755;
        return r13610756;
}

double f(double x, double y, double z) {
        double r13610757 = y;
        double r13610758 = z;
        double r13610759 = r13610757 * r13610758;
        double r13610760 = -4.6694218913522886e+254;
        bool r13610761 = r13610759 <= r13610760;
        double r13610762 = 1.0;
        double r13610763 = x;
        double r13610764 = r13610762 * r13610763;
        double r13610765 = r13610757 * r13610763;
        double r13610766 = r13610765 * r13610758;
        double r13610767 = -r13610766;
        double r13610768 = r13610764 + r13610767;
        double r13610769 = 5.755978675212138e+280;
        bool r13610770 = r13610759 <= r13610769;
        double r13610771 = -r13610758;
        double r13610772 = r13610757 * r13610771;
        double r13610773 = r13610772 * r13610763;
        double r13610774 = r13610773 + r13610764;
        double r13610775 = r13610763 * r13610758;
        double r13610776 = -r13610757;
        double r13610777 = r13610775 * r13610776;
        double r13610778 = r13610764 + r13610777;
        double r13610779 = r13610770 ? r13610774 : r13610778;
        double r13610780 = r13610761 ? r13610768 : r13610779;
        return r13610780;
}

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 3 regimes
  2. if (* y z) < -4.6694218913522886e+254

    1. Initial program 39.3

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

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

      \[\leadsto \color{blue}{1 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Taylor expanded around inf 39.3

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

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

    if -4.6694218913522886e+254 < (* y z) < 5.755978675212138e+280

    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-rgt-in0.1

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

    if 5.755978675212138e+280 < (* y z)

    1. Initial program 50.4

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

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

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

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

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

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

Reproduce

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