Average Error: 3.2 → 0.1
Time: 6.5s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;1.0 - z \cdot y = -\infty:\\ \;\;\;\;x \cdot 1.0 + \left(-y\right) \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;1.0 - z \cdot y \le 2.083829262510471 \cdot 10^{+251}:\\ \;\;\;\;x \cdot 1.0 + \left(\left(-y\right) \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + \left(-y\right) \cdot \left(x \cdot z\right)\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;1.0 - z \cdot y = -\infty:\\
\;\;\;\;x \cdot 1.0 + \left(-y\right) \cdot \left(x \cdot z\right)\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r5409927 = x;
        double r5409928 = 1.0;
        double r5409929 = y;
        double r5409930 = z;
        double r5409931 = r5409929 * r5409930;
        double r5409932 = r5409928 - r5409931;
        double r5409933 = r5409927 * r5409932;
        return r5409933;
}

double f(double x, double y, double z) {
        double r5409934 = 1.0;
        double r5409935 = z;
        double r5409936 = y;
        double r5409937 = r5409935 * r5409936;
        double r5409938 = r5409934 - r5409937;
        double r5409939 = -inf.0;
        bool r5409940 = r5409938 <= r5409939;
        double r5409941 = x;
        double r5409942 = r5409941 * r5409934;
        double r5409943 = -r5409936;
        double r5409944 = r5409941 * r5409935;
        double r5409945 = r5409943 * r5409944;
        double r5409946 = r5409942 + r5409945;
        double r5409947 = 2.083829262510471e+251;
        bool r5409948 = r5409938 <= r5409947;
        double r5409949 = r5409943 * r5409935;
        double r5409950 = r5409949 * r5409941;
        double r5409951 = r5409942 + r5409950;
        double r5409952 = r5409948 ? r5409951 : r5409946;
        double r5409953 = r5409940 ? r5409946 : r5409952;
        return r5409953;
}

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 (- 1.0 (* y z)) < -inf.0 or 2.083829262510471e+251 < (- 1.0 (* y z))

    1. Initial program 45.6

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

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

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

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

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

    if -inf.0 < (- 1.0 (* y z)) < 2.083829262510471e+251

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;1.0 - z \cdot y = -\infty:\\ \;\;\;\;x \cdot 1.0 + \left(-y\right) \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;1.0 - z \cdot y \le 2.083829262510471 \cdot 10^{+251}:\\ \;\;\;\;x \cdot 1.0 + \left(\left(-y\right) \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + \left(-y\right) \cdot \left(x \cdot z\right)\\ \end{array}\]

Reproduce

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