Average Error: 14.3 → 2.2
Time: 22.1s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.0532464204699888 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -6.588547053565423 \cdot 10^{-193}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 2.2740014914314757 \cdot 10^{-89}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -1.0532464204699888 \cdot 10^{+209}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r4477403 = x;
        double r4477404 = y;
        double r4477405 = z;
        double r4477406 = r4477404 / r4477405;
        double r4477407 = t;
        double r4477408 = r4477406 * r4477407;
        double r4477409 = r4477408 / r4477407;
        double r4477410 = r4477403 * r4477409;
        return r4477410;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r4477411 = y;
        double r4477412 = z;
        double r4477413 = r4477411 / r4477412;
        double r4477414 = -1.0532464204699888e+209;
        bool r4477415 = r4477413 <= r4477414;
        double r4477416 = x;
        double r4477417 = r4477416 / r4477412;
        double r4477418 = r4477411 * r4477417;
        double r4477419 = -6.588547053565423e-193;
        bool r4477420 = r4477413 <= r4477419;
        double r4477421 = r4477413 * r4477416;
        double r4477422 = 2.2740014914314757e-89;
        bool r4477423 = r4477413 <= r4477422;
        double r4477424 = r4477416 * r4477411;
        double r4477425 = r4477424 / r4477412;
        double r4477426 = r4477423 ? r4477425 : r4477421;
        double r4477427 = r4477420 ? r4477421 : r4477426;
        double r4477428 = r4477415 ? r4477418 : r4477427;
        return r4477428;
}

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.0532464204699888e+209

    1. Initial program 40.4

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

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

    if -1.0532464204699888e+209 < (/ y z) < -6.588547053565423e-193 or 2.2740014914314757e-89 < (/ y z)

    1. Initial program 11.1

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

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

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

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

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

    if -6.588547053565423e-193 < (/ y z) < 2.2740014914314757e-89

    1. Initial program 15.7

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.0532464204699888 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -6.588547053565423 \cdot 10^{-193}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 2.2740014914314757 \cdot 10^{-89}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array}\]

Reproduce

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