Average Error: 14.8 → 0.8
Time: 2.9s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.06893781831439348 \cdot 10^{259}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -9.6741057542884294 \cdot 10^{-296}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 3.1054900882765682 \cdot 10^{-293}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 3.9706404122678694 \cdot 10^{93}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -3.06893781831439348 \cdot 10^{259}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\

\mathbf{elif}\;\frac{y}{z} \le -9.6741057542884294 \cdot 10^{-296}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

\mathbf{elif}\;\frac{y}{z} \le 3.1054900882765682 \cdot 10^{-293}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\

\mathbf{elif}\;\frac{y}{z} \le 3.9706404122678694 \cdot 10^{93}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r137408 = x;
        double r137409 = y;
        double r137410 = z;
        double r137411 = r137409 / r137410;
        double r137412 = t;
        double r137413 = r137411 * r137412;
        double r137414 = r137413 / r137412;
        double r137415 = r137408 * r137414;
        return r137415;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r137416 = y;
        double r137417 = z;
        double r137418 = r137416 / r137417;
        double r137419 = -3.0689378183143935e+259;
        bool r137420 = r137418 <= r137419;
        double r137421 = x;
        double r137422 = r137421 * r137416;
        double r137423 = 1.0;
        double r137424 = r137423 / r137417;
        double r137425 = r137422 * r137424;
        double r137426 = -9.674105754288429e-296;
        bool r137427 = r137418 <= r137426;
        double r137428 = r137417 / r137416;
        double r137429 = r137421 / r137428;
        double r137430 = 3.105490088276568e-293;
        bool r137431 = r137418 <= r137430;
        double r137432 = 3.9706404122678694e+93;
        bool r137433 = r137418 <= r137432;
        double r137434 = r137417 / r137422;
        double r137435 = r137423 / r137434;
        double r137436 = r137433 ? r137429 : r137435;
        double r137437 = r137431 ? r137425 : r137436;
        double r137438 = r137427 ? r137429 : r137437;
        double r137439 = r137420 ? r137425 : r137438;
        return r137439;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -3.0689378183143935e+259 or -9.674105754288429e-296 < (/ y z) < 3.105490088276568e-293

    1. Initial program 25.8

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified22.1

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied div-inv22.1

      \[\leadsto x \cdot \color{blue}{\left(y \cdot \frac{1}{z}\right)}\]
    5. Applied associate-*r*0.2

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

    if -3.0689378183143935e+259 < (/ y z) < -9.674105754288429e-296 or 3.105490088276568e-293 < (/ y z) < 3.9706404122678694e+93

    1. Initial program 9.4

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified0.2

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/8.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    5. Using strategy rm
    6. Applied associate-/l*0.2

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

    if 3.9706404122678694e+93 < (/ y z)

    1. Initial program 27.5

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified13.7

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/4.8

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    5. Using strategy rm
    6. Applied clear-num4.9

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot y}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.06893781831439348 \cdot 10^{259}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -9.6741057542884294 \cdot 10^{-296}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 3.1054900882765682 \cdot 10^{-293}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 3.9706404122678694 \cdot 10^{93}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020035 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
  :precision binary64
  (* x (/ (* (/ y z) t) t)))