Average Error: 14.7 → 0.8
Time: 30.1s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.777824700739059504027072604237357294271 \cdot 10^{-189}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 6.194701076531514820787324531303599279908 \cdot 10^{-141}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 4.487328446405641062208224523193589026226 \cdot 10^{149}:\\ \;\;\;\;\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:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 4.487328446405641062208224523193589026226 \cdot 10^{149}:\\
\;\;\;\;\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 r75280 = x;
        double r75281 = y;
        double r75282 = z;
        double r75283 = r75281 / r75282;
        double r75284 = t;
        double r75285 = r75283 * r75284;
        double r75286 = r75285 / r75284;
        double r75287 = r75280 * r75286;
        return r75287;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r75288 = y;
        double r75289 = z;
        double r75290 = r75288 / r75289;
        double r75291 = -inf.0;
        bool r75292 = r75290 <= r75291;
        double r75293 = x;
        double r75294 = r75293 / r75289;
        double r75295 = r75288 * r75294;
        double r75296 = -1.7778247007390595e-189;
        bool r75297 = r75290 <= r75296;
        double r75298 = r75290 * r75293;
        double r75299 = 6.194701076531515e-141;
        bool r75300 = r75290 <= r75299;
        double r75301 = r75293 * r75288;
        double r75302 = r75301 / r75289;
        double r75303 = 4.487328446405641e+149;
        bool r75304 = r75290 <= r75303;
        double r75305 = r75304 ? r75298 : r75295;
        double r75306 = r75300 ? r75302 : r75305;
        double r75307 = r75297 ? r75298 : r75306;
        double r75308 = r75292 ? r75295 : r75307;
        return r75308;
}

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) < -inf.0 or 4.487328446405641e+149 < (/ y z)

    1. Initial program 41.5

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

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

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

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

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

    if -inf.0 < (/ y z) < -1.7778247007390595e-189 or 6.194701076531515e-141 < (/ y z) < 4.487328446405641e+149

    1. Initial program 7.9

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

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

    if -1.7778247007390595e-189 < (/ y z) < 6.194701076531515e-141

    1. Initial program 17.3

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

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

      \[\leadsto \frac{y}{z} \cdot \color{blue}{{x}^{1}}\]
    5. Applied pow19.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.777824700739059504027072604237357294271 \cdot 10^{-189}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 6.194701076531514820787324531303599279908 \cdot 10^{-141}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 4.487328446405641062208224523193589026226 \cdot 10^{149}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(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)))