Average Error: 3.5 → 2.0
Time: 17.8s
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 r217061 = x;
        double r217062 = 1.0;
        double r217063 = y;
        double r217064 = z;
        double r217065 = r217063 * r217064;
        double r217066 = r217062 - r217065;
        double r217067 = r217061 * r217066;
        return r217067;
}

double f(double x, double y, double z) {
        double r217068 = y;
        double r217069 = z;
        double r217070 = r217068 * r217069;
        double r217071 = 1.5048280772392512e+159;
        bool r217072 = r217070 <= r217071;
        double r217073 = x;
        double r217074 = 1.0;
        double r217075 = r217073 * r217074;
        double r217076 = -r217070;
        double r217077 = r217076 * r217073;
        double r217078 = r217075 + r217077;
        double r217079 = -r217068;
        double r217080 = r217069 * r217073;
        double r217081 = r217079 * r217080;
        double r217082 = r217075 + r217081;
        double r217083 = r217072 ? r217078 : r217082;
        return r217083;
}

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