Average Error: 14.4 → 1.7
Time: 27.1s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.04224840225502 \cdot 10^{+233}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.491454912800015 \cdot 10^{-216}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 6.1501304187373106 \cdot 10^{-201}:\\ \;\;\;\;y \cdot \frac{x}{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 -9.04224840225502 \cdot 10^{+233}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r3676363 = x;
        double r3676364 = y;
        double r3676365 = z;
        double r3676366 = r3676364 / r3676365;
        double r3676367 = t;
        double r3676368 = r3676366 * r3676367;
        double r3676369 = r3676368 / r3676367;
        double r3676370 = r3676363 * r3676369;
        return r3676370;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r3676371 = y;
        double r3676372 = z;
        double r3676373 = r3676371 / r3676372;
        double r3676374 = -9.04224840225502e+233;
        bool r3676375 = r3676373 <= r3676374;
        double r3676376 = x;
        double r3676377 = r3676376 / r3676372;
        double r3676378 = r3676371 * r3676377;
        double r3676379 = -3.491454912800015e-216;
        bool r3676380 = r3676373 <= r3676379;
        double r3676381 = r3676373 * r3676376;
        double r3676382 = 6.1501304187373106e-201;
        bool r3676383 = r3676373 <= r3676382;
        double r3676384 = r3676383 ? r3676378 : r3676381;
        double r3676385 = r3676380 ? r3676381 : r3676384;
        double r3676386 = r3676375 ? r3676378 : r3676385;
        return r3676386;
}

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) < -9.04224840225502e+233 or -3.491454912800015e-216 < (/ y z) < 6.1501304187373106e-201

    1. Initial program 21.7

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

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

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

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

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

    if -9.04224840225502e+233 < (/ y z) < -3.491454912800015e-216 or 6.1501304187373106e-201 < (/ y z)

    1. Initial program 11.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.04224840225502 \cdot 10^{+233}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.491454912800015 \cdot 10^{-216}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 6.1501304187373106 \cdot 10^{-201}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array}\]

Reproduce

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