Average Error: 14.9 → 1.9
Time: 8.8s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.0482842712917167 \cdot 10^{-253}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.3686289682416492 \cdot 10^{-304}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 1.2134899625884335 \cdot 10^{+227}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -1.0482842712917167 \cdot 10^{-253}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r1846148 = x;
        double r1846149 = y;
        double r1846150 = z;
        double r1846151 = r1846149 / r1846150;
        double r1846152 = t;
        double r1846153 = r1846151 * r1846152;
        double r1846154 = r1846153 / r1846152;
        double r1846155 = r1846148 * r1846154;
        return r1846155;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r1846156 = y;
        double r1846157 = z;
        double r1846158 = r1846156 / r1846157;
        double r1846159 = -1.0482842712917167e-253;
        bool r1846160 = r1846158 <= r1846159;
        double r1846161 = x;
        double r1846162 = r1846158 * r1846161;
        double r1846163 = 1.3686289682416492e-304;
        bool r1846164 = r1846158 <= r1846163;
        double r1846165 = r1846161 / r1846157;
        double r1846166 = r1846165 * r1846156;
        double r1846167 = 1.2134899625884335e+227;
        bool r1846168 = r1846158 <= r1846167;
        double r1846169 = r1846157 / r1846161;
        double r1846170 = r1846156 / r1846169;
        double r1846171 = r1846168 ? r1846162 : r1846170;
        double r1846172 = r1846164 ? r1846166 : r1846171;
        double r1846173 = r1846160 ? r1846162 : r1846172;
        return r1846173;
}

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) < -1.0482842712917167e-253 or 1.3686289682416492e-304 < (/ y z) < 1.2134899625884335e+227

    1. Initial program 11.6

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}}\]
    7. Using strategy rm
    8. Applied associate-/r/2.3

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

    if -1.0482842712917167e-253 < (/ y z) < 1.3686289682416492e-304

    1. Initial program 20.7

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

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

    if 1.2134899625884335e+227 < (/ y z)

    1. Initial program 43.8

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.0482842712917167 \cdot 10^{-253}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.3686289682416492 \cdot 10^{-304}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 1.2134899625884335 \cdot 10^{+227}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]

Reproduce

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