Average Error: 14.7 → 0.3
Time: 9.9s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -2.260559411855018598510891206887091885181 \cdot 10^{-253}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 3.757059281014894097749857788400547545613 \cdot 10^{-220}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.409130514825537046443418609777720419861 \cdot 10^{217}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} = -\infty:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 1.409130514825537046443418609777720419861 \cdot 10^{217}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r94498 = x;
        double r94499 = y;
        double r94500 = z;
        double r94501 = r94499 / r94500;
        double r94502 = t;
        double r94503 = r94501 * r94502;
        double r94504 = r94503 / r94502;
        double r94505 = r94498 * r94504;
        return r94505;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r94506 = y;
        double r94507 = z;
        double r94508 = r94506 / r94507;
        double r94509 = -inf.0;
        bool r94510 = r94508 <= r94509;
        double r94511 = x;
        double r94512 = r94511 * r94506;
        double r94513 = 1.0;
        double r94514 = r94513 / r94507;
        double r94515 = r94512 * r94514;
        double r94516 = -2.2605594118550186e-253;
        bool r94517 = r94508 <= r94516;
        double r94518 = r94508 * r94511;
        double r94519 = 3.757059281014894e-220;
        bool r94520 = r94508 <= r94519;
        double r94521 = r94512 / r94507;
        double r94522 = 1.409130514825537e+217;
        bool r94523 = r94508 <= r94522;
        double r94524 = r94511 / r94507;
        double r94525 = r94506 * r94524;
        double r94526 = r94523 ? r94518 : r94525;
        double r94527 = r94520 ? r94521 : r94526;
        double r94528 = r94517 ? r94518 : r94527;
        double r94529 = r94510 ? r94515 : r94528;
        return r94529;
}

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) < -inf.0

    1. Initial program 64.0

      \[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 div-inv0.3

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

    if -inf.0 < (/ y z) < -2.2605594118550186e-253 or 3.757059281014894e-220 < (/ y z) < 1.409130514825537e+217

    1. Initial program 9.5

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

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

      \[\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 -2.2605594118550186e-253 < (/ y z) < 3.757059281014894e-220

    1. Initial program 18.7

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    5. Using strategy rm
    6. Applied associate-*r/0.4

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

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

    if 1.409130514825537e+217 < (/ y z)

    1. Initial program 44.0

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    5. Taylor expanded around 0 1.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -2.260559411855018598510891206887091885181 \cdot 10^{-253}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 3.757059281014894097749857788400547545613 \cdot 10^{-220}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.409130514825537046443418609777720419861 \cdot 10^{217}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]

Reproduce

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