Average Error: 3.0 → 1.6
Time: 9.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 1.85128359392994435305280291229333409072 \cdot 10^{218}:\\ \;\;\;\;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.85128359392994435305280291229333409072 \cdot 10^{218}:\\
\;\;\;\;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 r294182 = x;
        double r294183 = 1.0;
        double r294184 = y;
        double r294185 = z;
        double r294186 = r294184 * r294185;
        double r294187 = r294183 - r294186;
        double r294188 = r294182 * r294187;
        return r294188;
}

double f(double x, double y, double z) {
        double r294189 = y;
        double r294190 = z;
        double r294191 = r294189 * r294190;
        double r294192 = 1.8512835939299444e+218;
        bool r294193 = r294191 <= r294192;
        double r294194 = 1.0;
        double r294195 = x;
        double r294196 = r294194 * r294195;
        double r294197 = -r294191;
        double r294198 = r294197 * r294195;
        double r294199 = r294196 + r294198;
        double r294200 = -r294195;
        double r294201 = r294190 * r294200;
        double r294202 = r294189 * r294201;
        double r294203 = r294196 + r294202;
        double r294204 = r294193 ? r294199 : r294203;
        return r294204;
}

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.8512835939299444e+218

    1. Initial program 1.6

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

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

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

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

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

    if 1.8512835939299444e+218 < (* y z)

    1. Initial program 28.4

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le 1.85128359392994435305280291229333409072 \cdot 10^{218}:\\ \;\;\;\;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 2019350 +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))))