Average Error: 3.0 → 0.1
Time: 2.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.983535256655526095974514837068565131628 \cdot 10^{298} \lor \neg \left(y \cdot z \le 6.742726675378597874198360649478575871492 \cdot 10^{300}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -2.983535256655526095974514837068565131628 \cdot 10^{298} \lor \neg \left(y \cdot z \le 6.742726675378597874198360649478575871492 \cdot 10^{300}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r304432 = x;
        double r304433 = 1.0;
        double r304434 = y;
        double r304435 = z;
        double r304436 = r304434 * r304435;
        double r304437 = r304433 - r304436;
        double r304438 = r304432 * r304437;
        return r304438;
}

double f(double x, double y, double z) {
        double r304439 = y;
        double r304440 = z;
        double r304441 = r304439 * r304440;
        double r304442 = -2.983535256655526e+298;
        bool r304443 = r304441 <= r304442;
        double r304444 = 6.742726675378598e+300;
        bool r304445 = r304441 <= r304444;
        double r304446 = !r304445;
        bool r304447 = r304443 || r304446;
        double r304448 = x;
        double r304449 = 1.0;
        double r304450 = r304448 * r304449;
        double r304451 = -r304439;
        double r304452 = r304448 * r304451;
        double r304453 = r304452 * r304440;
        double r304454 = r304450 + r304453;
        double r304455 = -r304441;
        double r304456 = r304448 * r304455;
        double r304457 = r304450 + r304456;
        double r304458 = r304447 ? r304454 : r304457;
        return r304458;
}

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) < -2.983535256655526e+298 or 6.742726675378598e+300 < (* y z)

    1. Initial program 57.7

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

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

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

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

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

    if -2.983535256655526e+298 < (* y z) < 6.742726675378598e+300

    1. Initial program 0.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -2.983535256655526095974514837068565131628 \cdot 10^{298} \lor \neg \left(y \cdot z \le 6.742726675378597874198360649478575871492 \cdot 10^{300}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019356 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))