Average Error: 3.2 → 0.1
Time: 11.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260} \lor \neg \left(y \cdot z \le 4.846810561336122803327637730521116709748 \cdot 10^{268}\right):\\ \;\;\;\;x \cdot 1 + z \cdot \left(-x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-\left(y \cdot z\right) \cdot x\right) + x \cdot 1\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260} \lor \neg \left(y \cdot z \le 4.846810561336122803327637730521116709748 \cdot 10^{268}\right):\\
\;\;\;\;x \cdot 1 + z \cdot \left(-x \cdot y\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r136942 = x;
        double r136943 = 1.0;
        double r136944 = y;
        double r136945 = z;
        double r136946 = r136944 * r136945;
        double r136947 = r136943 - r136946;
        double r136948 = r136942 * r136947;
        return r136948;
}

double f(double x, double y, double z) {
        double r136949 = y;
        double r136950 = z;
        double r136951 = r136949 * r136950;
        double r136952 = -7.045922148172358e+260;
        bool r136953 = r136951 <= r136952;
        double r136954 = 4.846810561336123e+268;
        bool r136955 = r136951 <= r136954;
        double r136956 = !r136955;
        bool r136957 = r136953 || r136956;
        double r136958 = x;
        double r136959 = 1.0;
        double r136960 = r136958 * r136959;
        double r136961 = r136958 * r136949;
        double r136962 = -r136961;
        double r136963 = r136950 * r136962;
        double r136964 = r136960 + r136963;
        double r136965 = r136951 * r136958;
        double r136966 = -r136965;
        double r136967 = r136966 + r136960;
        double r136968 = r136957 ? r136964 : r136967;
        return r136968;
}

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) < -7.045922148172358e+260 or 4.846810561336123e+268 < (* y z)

    1. Initial program 40.7

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

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

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

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

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

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

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

    if -7.045922148172358e+260 < (* y z) < 4.846810561336123e+268

    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}\]
    5. Simplified0.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260} \lor \neg \left(y \cdot z \le 4.846810561336122803327637730521116709748 \cdot 10^{268}\right):\\ \;\;\;\;x \cdot 1 + z \cdot \left(-x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-\left(y \cdot z\right) \cdot x\right) + x \cdot 1\\ \end{array}\]

Reproduce

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