Average Error: 14.2 → 0.3
Time: 42.4s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -2.2521697391721805 \cdot 10^{+183}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.917190651235875 \cdot 10^{-264}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.2214116120111555 \cdot 10^{-224}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{y}{z} \le 3.067025007758323 \cdot 10^{+241}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -2.2521697391721805 \cdot 10^{+183}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 3.067025007758323 \cdot 10^{+241}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r14731832 = x;
        double r14731833 = y;
        double r14731834 = z;
        double r14731835 = r14731833 / r14731834;
        double r14731836 = t;
        double r14731837 = r14731835 * r14731836;
        double r14731838 = r14731837 / r14731836;
        double r14731839 = r14731832 * r14731838;
        return r14731839;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r14731840 = y;
        double r14731841 = z;
        double r14731842 = r14731840 / r14731841;
        double r14731843 = -2.2521697391721805e+183;
        bool r14731844 = r14731842 <= r14731843;
        double r14731845 = x;
        double r14731846 = r14731845 * r14731840;
        double r14731847 = r14731846 / r14731841;
        double r14731848 = -3.917190651235875e-264;
        bool r14731849 = r14731842 <= r14731848;
        double r14731850 = r14731842 * r14731845;
        double r14731851 = 1.2214116120111555e-224;
        bool r14731852 = r14731842 <= r14731851;
        double r14731853 = r14731841 / r14731845;
        double r14731854 = r14731840 / r14731853;
        double r14731855 = 3.067025007758323e+241;
        bool r14731856 = r14731842 <= r14731855;
        double r14731857 = r14731856 ? r14731850 : r14731847;
        double r14731858 = r14731852 ? r14731854 : r14731857;
        double r14731859 = r14731849 ? r14731850 : r14731858;
        double r14731860 = r14731844 ? r14731847 : r14731859;
        return r14731860;
}

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) < -2.2521697391721805e+183 or 3.067025007758323e+241 < (/ y z)

    1. Initial program 40.4

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Taylor expanded around -inf 1.0

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

    if -2.2521697391721805e+183 < (/ y z) < -3.917190651235875e-264 or 1.2214116120111555e-224 < (/ y z) < 3.067025007758323e+241

    1. Initial program 8.3

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

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

    if -3.917190651235875e-264 < (/ y z) < 1.2214116120111555e-224

    1. Initial program 17.8

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

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

      \[\leadsto x \cdot \frac{y}{\color{blue}{1 \cdot z}}\]
    5. Applied add-cube-cbrt13.1

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

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

      \[\leadsto \color{blue}{\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1}\right) \cdot \frac{\sqrt[3]{y}}{z}}\]
    8. Using strategy rm
    9. Applied associate-*r/2.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -2.2521697391721805 \cdot 10^{+183}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.917190651235875 \cdot 10^{-264}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.2214116120111555 \cdot 10^{-224}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{y}{z} \le 3.067025007758323 \cdot 10^{+241}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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