Average Error: 3.2 → 0.1
Time: 15.3s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -4.669421891352288613719777613748852304779 \cdot 10^{254}:\\ \;\;\;\;x \cdot 1 + z \cdot \left(y \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \cdot z \le 5.755978675212138066765801917754853343075 \cdot 10^{280}:\\ \;\;\;\;\left(-y \cdot z\right) \cdot x + x \cdot 1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + y \cdot \left(\left(-x\right) \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -4.669421891352288613719777613748852304779 \cdot 10^{254}:\\
\;\;\;\;x \cdot 1 + z \cdot \left(y \cdot \left(-x\right)\right)\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r12801674 = x;
        double r12801675 = 1.0;
        double r12801676 = y;
        double r12801677 = z;
        double r12801678 = r12801676 * r12801677;
        double r12801679 = r12801675 - r12801678;
        double r12801680 = r12801674 * r12801679;
        return r12801680;
}

double f(double x, double y, double z) {
        double r12801681 = y;
        double r12801682 = z;
        double r12801683 = r12801681 * r12801682;
        double r12801684 = -4.6694218913522886e+254;
        bool r12801685 = r12801683 <= r12801684;
        double r12801686 = x;
        double r12801687 = 1.0;
        double r12801688 = r12801686 * r12801687;
        double r12801689 = -r12801686;
        double r12801690 = r12801681 * r12801689;
        double r12801691 = r12801682 * r12801690;
        double r12801692 = r12801688 + r12801691;
        double r12801693 = 5.755978675212138e+280;
        bool r12801694 = r12801683 <= r12801693;
        double r12801695 = -r12801683;
        double r12801696 = r12801695 * r12801686;
        double r12801697 = r12801696 + r12801688;
        double r12801698 = r12801689 * r12801682;
        double r12801699 = r12801681 * r12801698;
        double r12801700 = r12801688 + r12801699;
        double r12801701 = r12801694 ? r12801697 : r12801700;
        double r12801702 = r12801685 ? r12801692 : r12801701;
        return r12801702;
}

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) < -4.6694218913522886e+254

    1. Initial program 39.3

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

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

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

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

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

    if -4.6694218913522886e+254 < (* y z) < 5.755978675212138e+280

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

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

    if 5.755978675212138e+280 < (* y z)

    1. Initial program 50.4

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

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

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

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

      \[\leadsto x \cdot 1 + \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(-y \cdot z\right)\right)}\]
    8. Using strategy rm
    9. Applied distribute-rgt-neg-out50.7

      \[\leadsto x \cdot 1 + \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(-\sqrt[3]{x} \cdot \left(y \cdot z\right)\right)}\]
    10. Applied distribute-rgt-neg-out50.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -4.669421891352288613719777613748852304779 \cdot 10^{254}:\\ \;\;\;\;x \cdot 1 + z \cdot \left(y \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \cdot z \le 5.755978675212138066765801917754853343075 \cdot 10^{280}:\\ \;\;\;\;\left(-y \cdot z\right) \cdot x + x \cdot 1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + y \cdot \left(\left(-x\right) \cdot z\right)\\ \end{array}\]

Reproduce

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