Average Error: 3.2 → 2.3
Time: 2.8s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.84689544374018339 \cdot 10^{-224} \lor \neg \left(x \le 1.3866717898654844 \cdot 10^{65}\right):\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;x \le -2.84689544374018339 \cdot 10^{-224} \lor \neg \left(x \le 1.3866717898654844 \cdot 10^{65}\right):\\
\;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r225809 = x;
        double r225810 = 1.0;
        double r225811 = y;
        double r225812 = z;
        double r225813 = r225811 * r225812;
        double r225814 = r225810 - r225813;
        double r225815 = r225809 * r225814;
        return r225815;
}

double f(double x, double y, double z) {
        double r225816 = x;
        double r225817 = -2.8468954437401834e-224;
        bool r225818 = r225816 <= r225817;
        double r225819 = 1.3866717898654844e+65;
        bool r225820 = r225816 <= r225819;
        double r225821 = !r225820;
        bool r225822 = r225818 || r225821;
        double r225823 = 1.0;
        double r225824 = r225816 * r225823;
        double r225825 = y;
        double r225826 = z;
        double r225827 = r225825 * r225826;
        double r225828 = -r225827;
        double r225829 = r225816 * r225828;
        double r225830 = r225824 + r225829;
        double r225831 = -r225825;
        double r225832 = r225816 * r225831;
        double r225833 = r225832 * r225826;
        double r225834 = r225824 + r225833;
        double r225835 = r225822 ? r225830 : r225834;
        return r225835;
}

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 x < -2.8468954437401834e-224 or 1.3866717898654844e+65 < x

    1. Initial program 1.5

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

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

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

    if -2.8468954437401834e-224 < x < 1.3866717898654844e+65

    1. Initial program 5.6

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.84689544374018339 \cdot 10^{-224} \lor \neg \left(x \le 1.3866717898654844 \cdot 10^{65}\right):\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]

Reproduce

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