Average Error: 3.2 → 1.6
Time: 2.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 4.30022941649237138853414655979230834519 \cdot 10^{181}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 4.30022941649237138853414655979230834519 \cdot 10^{181}:\\
\;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r178491 = x;
        double r178492 = 1.0;
        double r178493 = y;
        double r178494 = z;
        double r178495 = r178493 * r178494;
        double r178496 = r178492 - r178495;
        double r178497 = r178491 * r178496;
        return r178497;
}

double f(double x, double y, double z) {
        double r178498 = y;
        double r178499 = z;
        double r178500 = r178498 * r178499;
        double r178501 = 4.3002294164923714e+181;
        bool r178502 = r178500 <= r178501;
        double r178503 = x;
        double r178504 = 1.0;
        double r178505 = r178503 * r178504;
        double r178506 = -r178500;
        double r178507 = r178503 * r178506;
        double r178508 = r178505 + r178507;
        double r178509 = -r178498;
        double r178510 = r178503 * r178509;
        double r178511 = r178510 * r178499;
        double r178512 = r178505 + r178511;
        double r178513 = r178502 ? r178508 : r178512;
        return r178513;
}

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) < 4.3002294164923714e+181

    1. Initial program 1.7

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

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

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

    if 4.3002294164923714e+181 < (* y z)

    1. Initial program 23.0

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

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

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

      \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(\left(-y\right) \cdot z\right)}\]
    7. Applied associate-*r*1.2

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

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

Reproduce

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