Average Error: 3.6 → 0.3
Time: 2.7s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z = -\infty \lor \neg \left(y \cdot z \le 2.669129644743586370097185904379114062632 \cdot 10^{138}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \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 = -\infty \lor \neg \left(y \cdot z \le 2.669129644743586370097185904379114062632 \cdot 10^{138}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r262764 = x;
        double r262765 = 1.0;
        double r262766 = y;
        double r262767 = z;
        double r262768 = r262766 * r262767;
        double r262769 = r262765 - r262768;
        double r262770 = r262764 * r262769;
        return r262770;
}

double f(double x, double y, double z) {
        double r262771 = y;
        double r262772 = z;
        double r262773 = r262771 * r262772;
        double r262774 = -inf.0;
        bool r262775 = r262773 <= r262774;
        double r262776 = 2.6691296447435864e+138;
        bool r262777 = r262773 <= r262776;
        double r262778 = !r262777;
        bool r262779 = r262775 || r262778;
        double r262780 = x;
        double r262781 = 1.0;
        double r262782 = r262780 * r262781;
        double r262783 = -r262771;
        double r262784 = r262780 * r262783;
        double r262785 = r262784 * r262772;
        double r262786 = r262782 + r262785;
        double r262787 = -r262773;
        double r262788 = r262780 * r262787;
        double r262789 = r262782 + r262788;
        double r262790 = r262779 ? r262786 : r262789;
        return r262790;
}

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) < -inf.0 or 2.6691296447435864e+138 < (* y z)

    1. Initial program 27.8

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

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

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

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

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

    if -inf.0 < (* y z) < 2.6691296447435864e+138

    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.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z = -\infty \lor \neg \left(y \cdot z \le 2.669129644743586370097185904379114062632 \cdot 10^{138}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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