Average Error: 14.4 → 1.8
Time: 6.9s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.277987902397856 \cdot 10^{-271}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.484083870392539 \cdot 10^{-222}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{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} = -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

\mathbf{elif}\;\frac{y}{z} \le 1.484083870392539 \cdot 10^{-222}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r1412600 = x;
        double r1412601 = y;
        double r1412602 = z;
        double r1412603 = r1412601 / r1412602;
        double r1412604 = t;
        double r1412605 = r1412603 * r1412604;
        double r1412606 = r1412605 / r1412604;
        double r1412607 = r1412600 * r1412606;
        return r1412607;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r1412608 = y;
        double r1412609 = z;
        double r1412610 = r1412608 / r1412609;
        double r1412611 = -inf.0;
        bool r1412612 = r1412610 <= r1412611;
        double r1412613 = x;
        double r1412614 = r1412613 / r1412609;
        double r1412615 = r1412608 * r1412614;
        double r1412616 = -1.277987902397856e-271;
        bool r1412617 = r1412610 <= r1412616;
        double r1412618 = r1412610 * r1412613;
        double r1412619 = 1.484083870392539e-222;
        bool r1412620 = r1412610 <= r1412619;
        double r1412621 = r1412613 * r1412608;
        double r1412622 = 1.0;
        double r1412623 = r1412622 / r1412609;
        double r1412624 = r1412621 * r1412623;
        double r1412625 = r1412620 ? r1412624 : r1412618;
        double r1412626 = r1412617 ? r1412618 : r1412625;
        double r1412627 = r1412612 ? r1412615 : r1412626;
        return r1412627;
}

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) < -inf.0

    1. Initial program 60.1

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

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

    if -inf.0 < (/ y z) < -1.277987902397856e-271 or 1.484083870392539e-222 < (/ y z)

    1. Initial program 11.9

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around 0 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.277987902397856e-271 < (/ y z) < 1.484083870392539e-222

    1. Initial program 18.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.277987902397856 \cdot 10^{-271}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.484083870392539 \cdot 10^{-222}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array}\]

Reproduce

herbie shell --seed 2019156 +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)))