Average Error: 3.5 → 2.0
Time: 18.6s
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 r175055 = x;
        double r175056 = 1.0;
        double r175057 = y;
        double r175058 = z;
        double r175059 = r175057 * r175058;
        double r175060 = r175056 - r175059;
        double r175061 = r175055 * r175060;
        return r175061;
}

double f(double x, double y, double z) {
        double r175062 = y;
        double r175063 = z;
        double r175064 = r175062 * r175063;
        double r175065 = 1.5048280772392512e+159;
        bool r175066 = r175064 <= r175065;
        double r175067 = x;
        double r175068 = 1.0;
        double r175069 = r175067 * r175068;
        double r175070 = -r175064;
        double r175071 = r175070 * r175067;
        double r175072 = r175069 + r175071;
        double r175073 = -r175062;
        double r175074 = r175063 * r175067;
        double r175075 = r175073 * r175074;
        double r175076 = r175069 + r175075;
        double r175077 = r175066 ? r175072 : r175076;
        return r175077;
}

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))))