Average Error: 14.8 → 0.5
Time: 1.9s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.6183489977482823 \cdot 10^{236}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -6.8792362608384231 \cdot 10^{-264}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.06689610291439 \cdot 10^{-310}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 8.69850988828769301 \cdot 10^{221}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -4.6183489977482823 \cdot 10^{236}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 8.69850988828769301 \cdot 10^{221}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r69144 = x;
        double r69145 = y;
        double r69146 = z;
        double r69147 = r69145 / r69146;
        double r69148 = t;
        double r69149 = r69147 * r69148;
        double r69150 = r69149 / r69148;
        double r69151 = r69144 * r69150;
        return r69151;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r69152 = y;
        double r69153 = z;
        double r69154 = r69152 / r69153;
        double r69155 = -4.618348997748282e+236;
        bool r69156 = r69154 <= r69155;
        double r69157 = x;
        double r69158 = r69157 * r69152;
        double r69159 = 1.0;
        double r69160 = r69159 / r69153;
        double r69161 = r69158 * r69160;
        double r69162 = -6.879236260838423e-264;
        bool r69163 = r69154 <= r69162;
        double r69164 = r69157 * r69154;
        double r69165 = 1.0668961029144e-310;
        bool r69166 = r69154 <= r69165;
        double r69167 = r69153 / r69158;
        double r69168 = r69159 / r69167;
        double r69169 = 8.698509888287693e+221;
        bool r69170 = r69154 <= r69169;
        double r69171 = r69153 / r69152;
        double r69172 = r69157 / r69171;
        double r69173 = r69170 ? r69172 : r69161;
        double r69174 = r69166 ? r69168 : r69173;
        double r69175 = r69163 ? r69164 : r69174;
        double r69176 = r69156 ? r69161 : r69175;
        return r69176;
}

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) < -4.618348997748282e+236 or 8.698509888287693e+221 < (/ y z)

    1. Initial program 45.8

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

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

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

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

    if -4.618348997748282e+236 < (/ y z) < -6.879236260838423e-264

    1. Initial program 9.7

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

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

    if -6.879236260838423e-264 < (/ y z) < 1.0668961029144e-310

    1. Initial program 19.2

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

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

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

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

    if 1.0668961029144e-310 < (/ y z) < 8.698509888287693e+221

    1. Initial program 9.0

      \[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.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.6183489977482823 \cdot 10^{236}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -6.8792362608384231 \cdot 10^{-264}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.06689610291439 \cdot 10^{-310}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 8.69850988828769301 \cdot 10^{221}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020064 +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)))