Average Error: 14.1 → 0.5
Time: 15.8s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.866510888004296 \cdot 10^{+182}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.378460893183651 \cdot 10^{-220}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.3295321152449 \cdot 10^{-313}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 7.69896986350915 \cdot 10^{+178}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -3.866510888004296 \cdot 10^{+182}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 7.69896986350915 \cdot 10^{+178}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r20384488 = x;
        double r20384489 = y;
        double r20384490 = z;
        double r20384491 = r20384489 / r20384490;
        double r20384492 = t;
        double r20384493 = r20384491 * r20384492;
        double r20384494 = r20384493 / r20384492;
        double r20384495 = r20384488 * r20384494;
        return r20384495;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r20384496 = y;
        double r20384497 = z;
        double r20384498 = r20384496 / r20384497;
        double r20384499 = -3.866510888004296e+182;
        bool r20384500 = r20384498 <= r20384499;
        double r20384501 = x;
        double r20384502 = r20384501 * r20384496;
        double r20384503 = 1.0;
        double r20384504 = r20384503 / r20384497;
        double r20384505 = r20384502 * r20384504;
        double r20384506 = -3.378460893183651e-220;
        bool r20384507 = r20384498 <= r20384506;
        double r20384508 = r20384498 * r20384501;
        double r20384509 = 1.3295321152449e-313;
        bool r20384510 = r20384498 <= r20384509;
        double r20384511 = r20384497 / r20384502;
        double r20384512 = r20384503 / r20384511;
        double r20384513 = 7.69896986350915e+178;
        bool r20384514 = r20384498 <= r20384513;
        double r20384515 = r20384502 / r20384497;
        double r20384516 = r20384514 ? r20384508 : r20384515;
        double r20384517 = r20384510 ? r20384512 : r20384516;
        double r20384518 = r20384507 ? r20384508 : r20384517;
        double r20384519 = r20384500 ? r20384505 : r20384518;
        return r20384519;
}

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 4 regimes
  2. if (/ y z) < -3.866510888004296e+182

    1. Initial program 38.4

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity1.3

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    5. Applied times-frac22.0

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
    6. Simplified22.0

      \[\leadsto \color{blue}{x} \cdot \frac{y}{z}\]
    7. Using strategy rm
    8. Applied div-inv22.0

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

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

    if -3.866510888004296e+182 < (/ y z) < -3.378460893183651e-220 or 1.3295321152449e-313 < (/ y z) < 7.69896986350915e+178

    1. Initial program 8.4

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity8.3

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    5. Applied times-frac0.2

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
    6. Simplified0.2

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

    if -3.378460893183651e-220 < (/ y z) < 1.3295321152449e-313

    1. Initial program 16.9

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    3. Using strategy rm
    4. Applied clear-num0.8

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

    if 7.69896986350915e+178 < (/ y z)

    1. Initial program 34.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.866510888004296 \cdot 10^{+182}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.378460893183651 \cdot 10^{-220}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.3295321152449 \cdot 10^{-313}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 7.69896986350915 \cdot 10^{+178}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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