Average Error: 14.9 → 1.9
Time: 9.9s
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{x}{z} \cdot y\\ \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{x}{z} \cdot y\\

\end{array}
double f(double x, double y, double z, double t) {
        double r2075140 = x;
        double r2075141 = y;
        double r2075142 = z;
        double r2075143 = r2075141 / r2075142;
        double r2075144 = t;
        double r2075145 = r2075143 * r2075144;
        double r2075146 = r2075145 / r2075144;
        double r2075147 = r2075140 * r2075146;
        return r2075147;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r2075148 = y;
        double r2075149 = z;
        double r2075150 = r2075148 / r2075149;
        double r2075151 = -1.0482842712917167e-253;
        bool r2075152 = r2075150 <= r2075151;
        double r2075153 = x;
        double r2075154 = r2075150 * r2075153;
        double r2075155 = 1.3686289682416492e-304;
        bool r2075156 = r2075150 <= r2075155;
        double r2075157 = r2075153 / r2075149;
        double r2075158 = r2075157 * r2075148;
        double r2075159 = 1.2134899625884335e+227;
        bool r2075160 = r2075150 <= r2075159;
        double r2075161 = r2075160 ? r2075154 : r2075158;
        double r2075162 = r2075156 ? r2075158 : r2075161;
        double r2075163 = r2075152 ? r2075154 : r2075162;
        return r2075163;
}

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 (/ 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. Taylor expanded around -inf 8.2

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

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

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
    7. Simplified2.3

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

    if -1.0482842712917167e-253 < (/ y z) < 1.3686289682416492e-304 or 1.2134899625884335e+227 < (/ y z)

    1. Initial program 25.7

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
  3. Recombined 2 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{x}{z} \cdot y\\ \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)))