Average Error: 3.2 → 0.5
Time: 13.5s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.345039036328034 \cdot 10^{+161}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \mathbf{elif}\;y \cdot z \le 2.6037039701027763 \cdot 10^{+110}:\\ \;\;\;\;\left(-x\right) \cdot \left(y \cdot z\right) + 1.0 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -2.345039036328034 \cdot 10^{+161}:\\
\;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r12286814 = x;
        double r12286815 = 1.0;
        double r12286816 = y;
        double r12286817 = z;
        double r12286818 = r12286816 * r12286817;
        double r12286819 = r12286815 - r12286818;
        double r12286820 = r12286814 * r12286819;
        return r12286820;
}

double f(double x, double y, double z) {
        double r12286821 = y;
        double r12286822 = z;
        double r12286823 = r12286821 * r12286822;
        double r12286824 = -2.345039036328034e+161;
        bool r12286825 = r12286823 <= r12286824;
        double r12286826 = 1.0;
        double r12286827 = x;
        double r12286828 = r12286826 * r12286827;
        double r12286829 = -r12286827;
        double r12286830 = r12286829 * r12286822;
        double r12286831 = r12286830 * r12286821;
        double r12286832 = r12286828 + r12286831;
        double r12286833 = 2.6037039701027763e+110;
        bool r12286834 = r12286823 <= r12286833;
        double r12286835 = r12286829 * r12286823;
        double r12286836 = r12286835 + r12286828;
        double r12286837 = r12286834 ? r12286836 : r12286832;
        double r12286838 = r12286825 ? r12286832 : r12286837;
        return r12286838;
}

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.345039036328034e+161 or 2.6037039701027763e+110 < (* y z)

    1. Initial program 16.4

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

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

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

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

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

    if -2.345039036328034e+161 < (* y z) < 2.6037039701027763e+110

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -2.345039036328034 \cdot 10^{+161}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \mathbf{elif}\;y \cdot z \le 2.6037039701027763 \cdot 10^{+110}:\\ \;\;\;\;\left(-x\right) \cdot \left(y \cdot z\right) + 1.0 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \end{array}\]

Reproduce

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