Average Error: 14.0 → 0.4
Time: 8.9s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -5.396173574168321 \cdot 10^{+225}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le -1.3007802100843793 \cdot 10^{-180}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.8715853137803047 \cdot 10^{-246}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 2.0905090728700514 \cdot 10^{+191}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -5.396173574168321 \cdot 10^{+225}:\\
\;\;\;\;\frac{x}{z} \cdot y\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r3586006 = x;
        double r3586007 = y;
        double r3586008 = z;
        double r3586009 = r3586007 / r3586008;
        double r3586010 = t;
        double r3586011 = r3586009 * r3586010;
        double r3586012 = r3586011 / r3586010;
        double r3586013 = r3586006 * r3586012;
        return r3586013;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r3586014 = y;
        double r3586015 = z;
        double r3586016 = r3586014 / r3586015;
        double r3586017 = -5.396173574168321e+225;
        bool r3586018 = r3586016 <= r3586017;
        double r3586019 = x;
        double r3586020 = r3586019 / r3586015;
        double r3586021 = r3586020 * r3586014;
        double r3586022 = -1.3007802100843793e-180;
        bool r3586023 = r3586016 <= r3586022;
        double r3586024 = r3586015 / r3586014;
        double r3586025 = r3586019 / r3586024;
        double r3586026 = 1.8715853137803047e-246;
        bool r3586027 = r3586016 <= r3586026;
        double r3586028 = 2.0905090728700514e+191;
        bool r3586029 = r3586016 <= r3586028;
        double r3586030 = 1.0;
        double r3586031 = r3586015 / r3586019;
        double r3586032 = r3586031 / r3586014;
        double r3586033 = r3586030 / r3586032;
        double r3586034 = r3586029 ? r3586025 : r3586033;
        double r3586035 = r3586027 ? r3586021 : r3586034;
        double r3586036 = r3586023 ? r3586025 : r3586035;
        double r3586037 = r3586018 ? r3586021 : r3586036;
        return r3586037;
}

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) < -5.396173574168321e+225 or -1.3007802100843793e-180 < (/ y z) < 1.8715853137803047e-246

    1. Initial program 21.6

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot y}}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity1.1

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\sqrt[3]{1}}{\frac{z}{x \cdot y}}}\]
    9. Simplified1.1

      \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{z}{x \cdot y}}\]
    10. Simplified0.6

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

    if -5.396173574168321e+225 < (/ y z) < -1.3007802100843793e-180 or 1.8715853137803047e-246 < (/ y z) < 2.0905090728700514e+191

    1. Initial program 7.7

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

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

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

    if 2.0905090728700514e+191 < (/ y z)

    1. Initial program 38.3

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -5.396173574168321 \cdot 10^{+225}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le -1.3007802100843793 \cdot 10^{-180}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.8715853137803047 \cdot 10^{-246}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 2.0905090728700514 \cdot 10^{+191}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\ \end{array}\]

Reproduce

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