Average Error: 3.2 → 1.5
Time: 14.2s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1038197589371032.2:\\ \;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{elif}\;y \cdot z \le 3.6724500887043685 \cdot 10^{+126}:\\ \;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + x \cdot 1.0\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -1038197589371032.2:\\
\;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r11422942 = x;
        double r11422943 = 1.0;
        double r11422944 = y;
        double r11422945 = z;
        double r11422946 = r11422944 * r11422945;
        double r11422947 = r11422943 - r11422946;
        double r11422948 = r11422942 * r11422947;
        return r11422948;
}

double f(double x, double y, double z) {
        double r11422949 = y;
        double r11422950 = z;
        double r11422951 = r11422949 * r11422950;
        double r11422952 = -1038197589371032.2;
        bool r11422953 = r11422951 <= r11422952;
        double r11422954 = x;
        double r11422955 = 1.0;
        double r11422956 = r11422954 * r11422955;
        double r11422957 = r11422954 * r11422949;
        double r11422958 = -r11422950;
        double r11422959 = r11422957 * r11422958;
        double r11422960 = r11422956 + r11422959;
        double r11422961 = 3.6724500887043685e+126;
        bool r11422962 = r11422951 <= r11422961;
        double r11422963 = r11422958 * r11422949;
        double r11422964 = r11422963 * r11422954;
        double r11422965 = r11422964 + r11422956;
        double r11422966 = r11422962 ? r11422965 : r11422960;
        double r11422967 = r11422953 ? r11422960 : r11422966;
        return r11422967;
}

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) < -1038197589371032.2 or 3.6724500887043685e+126 < (* y z)

    1. Initial program 11.2

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

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

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

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

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

    if -1038197589371032.2 < (* y z) < 3.6724500887043685e+126

    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 simplification1.5

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

Reproduce

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