Average Error: 3.5 → 2.0
Time: 17.2s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 1.504828077239251210599676853555794383052 \cdot 10^{159}:\\ \;\;\;\;x \cdot 1 + \left(-y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(-y\right) \cdot \left(z \cdot x\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 1.504828077239251210599676853555794383052 \cdot 10^{159}:\\
\;\;\;\;x \cdot 1 + \left(-y \cdot z\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r177769 = x;
        double r177770 = 1.0;
        double r177771 = y;
        double r177772 = z;
        double r177773 = r177771 * r177772;
        double r177774 = r177770 - r177773;
        double r177775 = r177769 * r177774;
        return r177775;
}

double f(double x, double y, double z) {
        double r177776 = y;
        double r177777 = z;
        double r177778 = r177776 * r177777;
        double r177779 = 1.5048280772392512e+159;
        bool r177780 = r177778 <= r177779;
        double r177781 = x;
        double r177782 = 1.0;
        double r177783 = r177781 * r177782;
        double r177784 = -r177778;
        double r177785 = r177784 * r177781;
        double r177786 = r177783 + r177785;
        double r177787 = -r177776;
        double r177788 = r177777 * r177781;
        double r177789 = r177787 * r177788;
        double r177790 = r177783 + r177789;
        double r177791 = r177780 ? r177786 : r177790;
        return r177791;
}

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) < 1.5048280772392512e+159

    1. Initial program 1.9

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

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

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

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

    if 1.5048280772392512e+159 < (* y z)

    1. Initial program 22.7

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

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

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

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

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

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

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

Reproduce

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