Average Error: 14.6 → 0.3
Time: 9.6s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -8.744938221735624394086083700588160422165 \cdot 10^{247}:\\ \;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le -4.90887845624400356201079550409662195503 \cdot 10^{-234}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 6.890799872238725235555987506188972971533 \cdot 10^{-284} \lor \neg \left(\frac{y}{z} \le 4.844168314129915218649001510512659703992 \cdot 10^{193}\right):\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -8.744938221735624394086083700588160422165 \cdot 10^{247}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\

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

\mathbf{elif}\;\frac{y}{z} \le 6.890799872238725235555987506188972971533 \cdot 10^{-284} \lor \neg \left(\frac{y}{z} \le 4.844168314129915218649001510512659703992 \cdot 10^{193}\right):\\
\;\;\;\;\frac{x}{z} \cdot y\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r89792 = x;
        double r89793 = y;
        double r89794 = z;
        double r89795 = r89793 / r89794;
        double r89796 = t;
        double r89797 = r89795 * r89796;
        double r89798 = r89797 / r89796;
        double r89799 = r89792 * r89798;
        return r89799;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r89800 = y;
        double r89801 = z;
        double r89802 = r89800 / r89801;
        double r89803 = -8.744938221735624e+247;
        bool r89804 = r89802 <= r89803;
        double r89805 = 1.0;
        double r89806 = x;
        double r89807 = r89801 / r89806;
        double r89808 = r89807 / r89800;
        double r89809 = r89805 / r89808;
        double r89810 = -4.9088784562440036e-234;
        bool r89811 = r89802 <= r89810;
        double r89812 = r89806 * r89802;
        double r89813 = 6.890799872238725e-284;
        bool r89814 = r89802 <= r89813;
        double r89815 = 4.844168314129915e+193;
        bool r89816 = r89802 <= r89815;
        double r89817 = !r89816;
        bool r89818 = r89814 || r89817;
        double r89819 = r89806 / r89801;
        double r89820 = r89819 * r89800;
        double r89821 = r89801 / r89800;
        double r89822 = r89806 / r89821;
        double r89823 = r89818 ? r89820 : r89822;
        double r89824 = r89811 ? r89812 : r89823;
        double r89825 = r89804 ? r89809 : r89824;
        return r89825;
}

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 4 regimes
  2. if (/ y z) < -8.744938221735624e+247

    1. Initial program 47.7

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

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

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

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

    if -8.744938221735624e+247 < (/ y z) < -4.9088784562440036e-234

    1. Initial program 9.2

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

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

      \[\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 -4.9088784562440036e-234 < (/ y z) < 6.890799872238725e-284 or 4.844168314129915e+193 < (/ y z)

    1. Initial program 23.8

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 \cdot x\right)} \cdot \frac{y}{z}\]
    9. Applied associate-*l*16.6

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

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

    if 6.890799872238725e-284 < (/ y z) < 4.844168314129915e+193

    1. Initial program 8.4

      \[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}}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -8.744938221735624394086083700588160422165 \cdot 10^{247}:\\ \;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le -4.90887845624400356201079550409662195503 \cdot 10^{-234}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 6.890799872238725235555987506188972971533 \cdot 10^{-284} \lor \neg \left(\frac{y}{z} \le 4.844168314129915218649001510512659703992 \cdot 10^{193}\right):\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

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