Average Error: 14.7 → 0.8
Time: 31.6s
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 r80590 = x;
        double r80591 = y;
        double r80592 = z;
        double r80593 = r80591 / r80592;
        double r80594 = t;
        double r80595 = r80593 * r80594;
        double r80596 = r80595 / r80594;
        double r80597 = r80590 * r80596;
        return r80597;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r80598 = y;
        double r80599 = z;
        double r80600 = r80598 / r80599;
        double r80601 = -inf.0;
        bool r80602 = r80600 <= r80601;
        double r80603 = x;
        double r80604 = r80603 / r80599;
        double r80605 = r80598 * r80604;
        double r80606 = -1.7778247007390595e-189;
        bool r80607 = r80600 <= r80606;
        double r80608 = r80600 * r80603;
        double r80609 = 6.194701076531515e-141;
        bool r80610 = r80600 <= r80609;
        double r80611 = r80603 * r80598;
        double r80612 = r80611 / r80599;
        double r80613 = 4.487328446405641e+149;
        bool r80614 = r80600 <= r80613;
        double r80615 = r80614 ? r80608 : r80605;
        double r80616 = r80610 ? r80612 : r80615;
        double r80617 = r80607 ? r80608 : r80616;
        double r80618 = r80602 ? r80605 : r80617;
        return r80618;
}

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 add-cube-cbrt9.5

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{y}{z}} \cdot \sqrt[3]{\frac{y}{z}}\right) \cdot \left(\sqrt[3]{\frac{y}{z}} \cdot x\right)}\]
    6. Using strategy rm
    7. Applied cbrt-div9.4

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

      \[\leadsto \left(\sqrt[3]{\frac{y}{z}} \cdot \sqrt[3]{\frac{y}{z}}\right) \cdot \color{blue}{\frac{\sqrt[3]{y} \cdot x}{\sqrt[3]{z}}}\]
    9. Applied cbrt-div9.6

      \[\leadsto \left(\sqrt[3]{\frac{y}{z}} \cdot \color{blue}{\frac{\sqrt[3]{y}}{\sqrt[3]{z}}}\right) \cdot \frac{\sqrt[3]{y} \cdot x}{\sqrt[3]{z}}\]
    10. Applied cbrt-div1.8

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{\sqrt[3]{y} \cdot x}{\sqrt[3]{z}}\]
    12. Applied frac-times2.1

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{z}}\]
  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)))