Average Error: 3.5 → 2.0
Time: 14.0s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 1.504828077239251210599676853555794383052 \cdot 10^{159}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\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}:\\
\;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r162961 = x;
        double r162962 = 1.0;
        double r162963 = y;
        double r162964 = z;
        double r162965 = r162963 * r162964;
        double r162966 = r162962 - r162965;
        double r162967 = r162961 * r162966;
        return r162967;
}

double f(double x, double y, double z) {
        double r162968 = y;
        double r162969 = z;
        double r162970 = r162968 * r162969;
        double r162971 = 1.5048280772392512e+159;
        bool r162972 = r162970 <= r162971;
        double r162973 = 1.0;
        double r162974 = x;
        double r162975 = r162973 * r162974;
        double r162976 = -r162970;
        double r162977 = r162976 * r162974;
        double r162978 = r162975 + r162977;
        double r162979 = -r162974;
        double r162980 = r162969 * r162979;
        double r162981 = r162968 * r162980;
        double r162982 = r162975 + r162981;
        double r162983 = r162972 ? r162978 : r162982;
        return r162983;
}

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 \color{blue}{1 \cdot x} + x \cdot \left(-y \cdot z\right)\]
    6. Simplified1.9

      \[\leadsto 1 \cdot x + \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 \color{blue}{1 \cdot x} + x \cdot \left(-y \cdot z\right)\]
    6. Simplified22.7

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

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

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

      \[\leadsto 1 \cdot x + y \cdot \color{blue}{\left(z \cdot \left(-x\right)\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}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019323 +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))))