Average Error: 3.2 → 0.4
Time: 11.8s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260}:\\ \;\;\;\;1 \cdot x + \left(y \cdot x\right) \cdot \left(-z\right)\\ \mathbf{elif}\;y \cdot z \le 2.649559227460045009329263142923922493941 \cdot 10^{140}:\\ \;\;\;\;\left(-y \cdot z\right) \cdot x + 1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260}:\\
\;\;\;\;1 \cdot x + \left(y \cdot x\right) \cdot \left(-z\right)\\

\mathbf{elif}\;y \cdot z \le 2.649559227460045009329263142923922493941 \cdot 10^{140}:\\
\;\;\;\;\left(-y \cdot z\right) \cdot x + 1 \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r9850069 = x;
        double r9850070 = 1.0;
        double r9850071 = y;
        double r9850072 = z;
        double r9850073 = r9850071 * r9850072;
        double r9850074 = r9850070 - r9850073;
        double r9850075 = r9850069 * r9850074;
        return r9850075;
}

double f(double x, double y, double z) {
        double r9850076 = y;
        double r9850077 = z;
        double r9850078 = r9850076 * r9850077;
        double r9850079 = -7.045922148172358e+260;
        bool r9850080 = r9850078 <= r9850079;
        double r9850081 = 1.0;
        double r9850082 = x;
        double r9850083 = r9850081 * r9850082;
        double r9850084 = r9850076 * r9850082;
        double r9850085 = -r9850077;
        double r9850086 = r9850084 * r9850085;
        double r9850087 = r9850083 + r9850086;
        double r9850088 = 2.649559227460045e+140;
        bool r9850089 = r9850078 <= r9850088;
        double r9850090 = -r9850078;
        double r9850091 = r9850090 * r9850082;
        double r9850092 = r9850091 + r9850083;
        double r9850093 = r9850082 * r9850077;
        double r9850094 = -r9850076;
        double r9850095 = r9850093 * r9850094;
        double r9850096 = r9850083 + r9850095;
        double r9850097 = r9850089 ? r9850092 : r9850096;
        double r9850098 = r9850080 ? r9850087 : r9850097;
        return r9850098;
}

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 3 regimes
  2. if (* y z) < -7.045922148172358e+260

    1. Initial program 39.1

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

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

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

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(-y\right) \cdot \left(z \cdot x\right)}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt1.5

      \[\leadsto 1 \cdot x + \color{blue}{\left(\left(\sqrt[3]{-y} \cdot \sqrt[3]{-y}\right) \cdot \sqrt[3]{-y}\right)} \cdot \left(z \cdot x\right)\]
    10. Applied associate-*l*1.5

      \[\leadsto 1 \cdot x + \color{blue}{\left(\sqrt[3]{-y} \cdot \sqrt[3]{-y}\right) \cdot \left(\sqrt[3]{-y} \cdot \left(z \cdot x\right)\right)}\]
    11. Taylor expanded around inf 39.1

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

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

    if -7.045922148172358e+260 < (* y z) < 2.649559227460045e+140

    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}\]

    if 2.649559227460045e+140 < (* y z)

    1. Initial program 16.5

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -7.045922148172357582559991056998494780309 \cdot 10^{260}:\\ \;\;\;\;1 \cdot x + \left(y \cdot x\right) \cdot \left(-z\right)\\ \mathbf{elif}\;y \cdot z \le 2.649559227460045009329263142923922493941 \cdot 10^{140}:\\ \;\;\;\;\left(-y \cdot z\right) \cdot x + 1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\ \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))))