Average Error: 3.6 → 0.5
Time: 2.5s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.47374276770246801 \cdot 10^{275} \lor \neg \left(y \cdot z \le 5.10649430386231042 \cdot 10^{115}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -2.47374276770246801 \cdot 10^{275} \lor \neg \left(y \cdot z \le 5.10649430386231042 \cdot 10^{115}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r203776 = x;
        double r203777 = 1.0;
        double r203778 = y;
        double r203779 = z;
        double r203780 = r203778 * r203779;
        double r203781 = r203777 - r203780;
        double r203782 = r203776 * r203781;
        return r203782;
}

double f(double x, double y, double z) {
        double r203783 = y;
        double r203784 = z;
        double r203785 = r203783 * r203784;
        double r203786 = -2.473742767702468e+275;
        bool r203787 = r203785 <= r203786;
        double r203788 = 5.10649430386231e+115;
        bool r203789 = r203785 <= r203788;
        double r203790 = !r203789;
        bool r203791 = r203787 || r203790;
        double r203792 = x;
        double r203793 = 1.0;
        double r203794 = r203792 * r203793;
        double r203795 = r203792 * r203783;
        double r203796 = -r203784;
        double r203797 = r203795 * r203796;
        double r203798 = r203794 + r203797;
        double r203799 = -r203785;
        double r203800 = r203792 * r203799;
        double r203801 = r203794 + r203800;
        double r203802 = r203791 ? r203798 : r203801;
        return r203802;
}

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) < -2.473742767702468e+275 or 5.10649430386231e+115 < (* y z)

    1. Initial program 24.7

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

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

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

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

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

    if -2.473742767702468e+275 < (* y z) < 5.10649430386231e+115

    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)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -2.47374276770246801 \cdot 10^{275} \lor \neg \left(y \cdot z \le 5.10649430386231042 \cdot 10^{115}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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