Average Error: 6.3 → 1.1
Time: 6.6s
Precision: 64
\[\frac{x \cdot y}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y \le -1.22339906662382536 \cdot 10^{222}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;x \cdot y \le -1.069208047172407 \cdot 10^{-169}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;x \cdot y \le 3.2229979735477995 \cdot 10^{-194} \lor \neg \left(x \cdot y \le 3.93264918688121786 \cdot 10^{88}\right):\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \end{array}\]
\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y \le -1.22339906662382536 \cdot 10^{222}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

\mathbf{elif}\;x \cdot y \le -1.069208047172407 \cdot 10^{-169}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\

\mathbf{elif}\;x \cdot y \le 3.2229979735477995 \cdot 10^{-194} \lor \neg \left(x \cdot y \le 3.93264918688121786 \cdot 10^{88}\right):\\
\;\;\;\;\frac{y}{z} \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r64510 = x;
        double r64511 = y;
        double r64512 = r64510 * r64511;
        double r64513 = z;
        double r64514 = r64512 / r64513;
        return r64514;
}

double f(double x, double y, double z) {
        double r64515 = x;
        double r64516 = y;
        double r64517 = r64515 * r64516;
        double r64518 = -1.2233990666238254e+222;
        bool r64519 = r64517 <= r64518;
        double r64520 = z;
        double r64521 = r64516 / r64520;
        double r64522 = r64521 * r64515;
        double r64523 = -1.069208047172407e-169;
        bool r64524 = r64517 <= r64523;
        double r64525 = 1.0;
        double r64526 = r64520 / r64517;
        double r64527 = r64525 / r64526;
        double r64528 = 3.2229979735477995e-194;
        bool r64529 = r64517 <= r64528;
        double r64530 = 3.932649186881218e+88;
        bool r64531 = r64517 <= r64530;
        double r64532 = !r64531;
        bool r64533 = r64529 || r64532;
        double r64534 = r64525 / r64520;
        double r64535 = r64517 * r64534;
        double r64536 = r64533 ? r64522 : r64535;
        double r64537 = r64524 ? r64527 : r64536;
        double r64538 = r64519 ? r64522 : r64537;
        return r64538;
}

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 3 regimes
  2. if (* x y) < -1.2233990666238254e+222 or -1.069208047172407e-169 < (* x y) < 3.2229979735477995e-194 or 3.932649186881218e+88 < (* x y)

    1. Initial program 12.9

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied div-inv13.0

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    4. Using strategy rm
    5. Applied pow113.0

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{{\left(\frac{1}{z}\right)}^{1}}\]
    6. Applied pow113.0

      \[\leadsto \left(x \cdot \color{blue}{{y}^{1}}\right) \cdot {\left(\frac{1}{z}\right)}^{1}\]
    7. Applied pow113.0

      \[\leadsto \left(\color{blue}{{x}^{1}} \cdot {y}^{1}\right) \cdot {\left(\frac{1}{z}\right)}^{1}\]
    8. Applied pow-prod-down13.0

      \[\leadsto \color{blue}{{\left(x \cdot y\right)}^{1}} \cdot {\left(\frac{1}{z}\right)}^{1}\]
    9. Applied pow-prod-down13.0

      \[\leadsto \color{blue}{{\left(\left(x \cdot y\right) \cdot \frac{1}{z}\right)}^{1}}\]
    10. Simplified1.8

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

    if -1.2233990666238254e+222 < (* x y) < -1.069208047172407e-169

    1. Initial program 0.2

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied clear-num0.7

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot y}}}\]

    if 3.2229979735477995e-194 < (* x y) < 3.932649186881218e+88

    1. Initial program 0.2

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied div-inv0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \le -1.22339906662382536 \cdot 10^{222}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;x \cdot y \le -1.069208047172407 \cdot 10^{-169}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;x \cdot y \le 3.2229979735477995 \cdot 10^{-194} \lor \neg \left(x \cdot y \le 3.93264918688121786 \cdot 10^{88}\right):\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (x y z)
  :name "x*y/z"
  (/ (* x y) z))