Average Error: 14.5 → 6.0
Time: 13.0s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le 1.6218775689393483 \cdot 10^{-99} \lor \neg \left(z \le 1.32166055357661369 \cdot 10^{217}\right):\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;z \le 1.6218775689393483 \cdot 10^{-99} \lor \neg \left(z \le 1.32166055357661369 \cdot 10^{217}\right):\\
\;\;\;\;\frac{y \cdot x}{z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r88994 = x;
        double r88995 = y;
        double r88996 = z;
        double r88997 = r88995 / r88996;
        double r88998 = t;
        double r88999 = r88997 * r88998;
        double r89000 = r88999 / r88998;
        double r89001 = r88994 * r89000;
        return r89001;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r89002 = z;
        double r89003 = 1.6218775689393483e-99;
        bool r89004 = r89002 <= r89003;
        double r89005 = 1.3216605535766137e+217;
        bool r89006 = r89002 <= r89005;
        double r89007 = !r89006;
        bool r89008 = r89004 || r89007;
        double r89009 = y;
        double r89010 = x;
        double r89011 = r89009 * r89010;
        double r89012 = r89011 / r89002;
        double r89013 = r89002 / r89009;
        double r89014 = r89010 / r89013;
        double r89015 = r89008 ? r89012 : r89014;
        return r89015;
}

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 2 regimes
  2. if z < 1.6218775689393483e-99 or 1.3216605535766137e+217 < z

    1. Initial program 15.2

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

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

    if 1.6218775689393483e-99 < z < 1.3216605535766137e+217

    1. Initial program 12.7

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{y \cdot x}}}\]
    5. Simplified4.8

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{x} \cdot \frac{z}{y}}}\]
    9. Applied associate-/r*4.4

      \[\leadsto \color{blue}{\frac{\frac{1}{\frac{1}{x}}}{\frac{z}{y}}}\]
    10. Simplified4.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le 1.6218775689393483 \cdot 10^{-99} \lor \neg \left(z \le 1.32166055357661369 \cdot 10^{217}\right):\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

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