Average Error: 15.2 → 1.0
Time: 27.6s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.35613759911877656476275151503320492094 \cdot 10^{280}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -8.828782166850766038005620975563547450989 \cdot 10^{-175}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 6.939139322974091469623957424428358865557 \cdot 10^{-194}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 2.459953299034684076090573649758520228965 \cdot 10^{86}:\\ \;\;\;\;\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} \le -1.35613759911877656476275151503320492094 \cdot 10^{280}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 2.459953299034684076090573649758520228965 \cdot 10^{86}:\\
\;\;\;\;\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 r78362 = x;
        double r78363 = y;
        double r78364 = z;
        double r78365 = r78363 / r78364;
        double r78366 = t;
        double r78367 = r78365 * r78366;
        double r78368 = r78367 / r78366;
        double r78369 = r78362 * r78368;
        return r78369;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r78370 = y;
        double r78371 = z;
        double r78372 = r78370 / r78371;
        double r78373 = -1.3561375991187766e+280;
        bool r78374 = r78372 <= r78373;
        double r78375 = x;
        double r78376 = r78375 / r78371;
        double r78377 = r78370 * r78376;
        double r78378 = -8.828782166850766e-175;
        bool r78379 = r78372 <= r78378;
        double r78380 = r78372 * r78375;
        double r78381 = 6.939139322974091e-194;
        bool r78382 = r78372 <= r78381;
        double r78383 = r78375 * r78370;
        double r78384 = r78383 / r78371;
        double r78385 = 2.459953299034684e+86;
        bool r78386 = r78372 <= r78385;
        double r78387 = r78386 ? r78380 : r78377;
        double r78388 = r78382 ? r78384 : r78387;
        double r78389 = r78379 ? r78380 : r78388;
        double r78390 = r78374 ? r78377 : r78389;
        return r78390;
}

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) < -1.3561375991187766e+280 or 2.459953299034684e+86 < (/ y z)

    1. Initial program 34.5

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

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

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

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

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

    if -1.3561375991187766e+280 < (/ y z) < -8.828782166850766e-175 or 6.939139322974091e-194 < (/ y z) < 2.459953299034684e+86

    1. Initial program 8.3

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

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

    if -8.828782166850766e-175 < (/ y z) < 6.939139322974091e-194

    1. Initial program 17.1

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

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

      \[\leadsto \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \cdot x\]
    5. Applied *-un-lft-identity10.0

      \[\leadsto \frac{\color{blue}{1 \cdot y}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}} \cdot x\]
    6. Applied times-frac10.0

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{y}{\sqrt[3]{z}} \cdot x\right)}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity2.7

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

      \[\leadsto \color{blue}{1 \cdot \left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{y}{\sqrt[3]{z}} \cdot x\right)\right)}\]
    11. Simplified0.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.35613759911877656476275151503320492094 \cdot 10^{280}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -8.828782166850766038005620975563547450989 \cdot 10^{-175}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 6.939139322974091469623957424428358865557 \cdot 10^{-194}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 2.459953299034684076090573649758520228965 \cdot 10^{86}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]

Reproduce

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