Average Error: 14.6 → 0.7
Time: 9.7s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -6.34231097128044137 \cdot 10^{248}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le -1.37884780012777875 \cdot 10^{-243}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.9689524893479902 \cdot 10^{-215}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.6330625977565216 \cdot 10^{139}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -6.34231097128044137 \cdot 10^{248}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 1.6330625977565216 \cdot 10^{139}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r81951 = x;
        double r81952 = y;
        double r81953 = z;
        double r81954 = r81952 / r81953;
        double r81955 = t;
        double r81956 = r81954 * r81955;
        double r81957 = r81956 / r81955;
        double r81958 = r81951 * r81957;
        return r81958;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r81959 = y;
        double r81960 = z;
        double r81961 = r81959 / r81960;
        double r81962 = -6.342310971280441e+248;
        bool r81963 = r81961 <= r81962;
        double r81964 = 1.0;
        double r81965 = x;
        double r81966 = r81965 * r81959;
        double r81967 = r81960 / r81966;
        double r81968 = r81964 / r81967;
        double r81969 = -1.3788478001277788e-243;
        bool r81970 = r81961 <= r81969;
        double r81971 = r81965 * r81961;
        double r81972 = 1.9689524893479902e-215;
        bool r81973 = r81961 <= r81972;
        double r81974 = 1.6330625977565216e+139;
        bool r81975 = r81961 <= r81974;
        double r81976 = r81964 / r81960;
        double r81977 = r81976 * r81966;
        double r81978 = r81975 ? r81971 : r81977;
        double r81979 = r81973 ? r81968 : r81978;
        double r81980 = r81970 ? r81971 : r81979;
        double r81981 = r81963 ? r81968 : r81980;
        return r81981;
}

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) < -6.342310971280441e+248 or -1.3788478001277788e-243 < (/ y z) < 1.9689524893479902e-215

    1. Initial program 22.7

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

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

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

    if -6.342310971280441e+248 < (/ y z) < -1.3788478001277788e-243 or 1.9689524893479902e-215 < (/ y z) < 1.6330625977565216e+139

    1. Initial program 8.2

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    5. Applied times-frac0.2

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

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

    if 1.6330625977565216e+139 < (/ y z)

    1. Initial program 33.1

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

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

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

      \[\leadsto \frac{x}{\color{blue}{z \cdot \frac{1}{y}}}\]
    7. Applied *-un-lft-identity14.9

      \[\leadsto \frac{\color{blue}{1 \cdot x}}{z \cdot \frac{1}{y}}\]
    8. Applied times-frac3.1

      \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{\frac{1}{y}}}\]
    9. Simplified3.0

      \[\leadsto \frac{1}{z} \cdot \color{blue}{\left(x \cdot y\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -6.34231097128044137 \cdot 10^{248}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le -1.37884780012777875 \cdot 10^{-243}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.9689524893479902 \cdot 10^{-215}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.6330625977565216 \cdot 10^{139}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \end{array}\]

Reproduce

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