Average Error: 14.8 → 1.8
Time: 30.3s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.801230547067030745875236962804965666353 \cdot 10^{-232}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 7.40416252088828699055648515267267277537 \cdot 10^{-288}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 1.694302386726195194013907163636463756663 \cdot 10^{191}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -4.801230547067030745875236962804965666353 \cdot 10^{-232}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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

\mathbf{elif}\;\frac{y}{z} \le 1.694302386726195194013907163636463756663 \cdot 10^{191}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r5234196 = x;
        double r5234197 = y;
        double r5234198 = z;
        double r5234199 = r5234197 / r5234198;
        double r5234200 = t;
        double r5234201 = r5234199 * r5234200;
        double r5234202 = r5234201 / r5234200;
        double r5234203 = r5234196 * r5234202;
        return r5234203;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r5234204 = y;
        double r5234205 = z;
        double r5234206 = r5234204 / r5234205;
        double r5234207 = -4.801230547067031e-232;
        bool r5234208 = r5234206 <= r5234207;
        double r5234209 = x;
        double r5234210 = r5234209 * r5234206;
        double r5234211 = 7.404162520888287e-288;
        bool r5234212 = r5234206 <= r5234211;
        double r5234213 = r5234209 / r5234205;
        double r5234214 = r5234213 * r5234204;
        double r5234215 = 1.6943023867261952e+191;
        bool r5234216 = r5234206 <= r5234215;
        double r5234217 = r5234209 * r5234204;
        double r5234218 = r5234217 / r5234205;
        double r5234219 = r5234216 ? r5234210 : r5234218;
        double r5234220 = r5234212 ? r5234214 : r5234219;
        double r5234221 = r5234208 ? r5234210 : r5234220;
        return r5234221;
}

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) < -4.801230547067031e-232 or 7.404162520888287e-288 < (/ y z) < 1.6943023867261952e+191

    1. Initial program 11.5

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

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

    if -4.801230547067031e-232 < (/ y z) < 7.404162520888287e-288

    1. Initial program 18.4

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

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

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

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

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

    if 1.6943023867261952e+191 < (/ y z)

    1. Initial program 40.3

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot x}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt25.9

      \[\leadsto \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \cdot x\]
    5. Applied *-un-lft-identity25.9

      \[\leadsto \frac{\color{blue}{1 \cdot y}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}} \cdot x\]
    6. Applied times-frac25.9

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{y}{\sqrt[3]{z}} \cdot x\right)}\]
    8. Using strategy rm
    9. Applied associate-*l/2.4

      \[\leadsto \frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \color{blue}{\frac{y \cdot x}{\sqrt[3]{z}}}\]
    10. Applied frac-times2.4

      \[\leadsto \color{blue}{\frac{1 \cdot \left(y \cdot x\right)}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    11. Simplified2.4

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\]
    12. Simplified1.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.801230547067030745875236962804965666353 \cdot 10^{-232}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 7.40416252088828699055648515267267277537 \cdot 10^{-288}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 1.694302386726195194013907163636463756663 \cdot 10^{191}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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