Average Error: 14.5 → 1.7
Time: 11.9s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;\frac{y}{z} \le -4.693289067124317 \cdot 10^{-250}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -0.0:\\ \;\;\;\;\left(x \cdot \frac{1}{z}\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} = -\infty:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\

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

\mathbf{elif}\;\frac{y}{z} \le -0.0:\\
\;\;\;\;\left(x \cdot \frac{1}{z}\right) \cdot y\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r6822192 = x;
        double r6822193 = y;
        double r6822194 = z;
        double r6822195 = r6822193 / r6822194;
        double r6822196 = t;
        double r6822197 = r6822195 * r6822196;
        double r6822198 = r6822197 / r6822196;
        double r6822199 = r6822192 * r6822198;
        return r6822199;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r6822200 = y;
        double r6822201 = z;
        double r6822202 = r6822200 / r6822201;
        double r6822203 = -inf.0;
        bool r6822204 = r6822202 <= r6822203;
        double r6822205 = 1.0;
        double r6822206 = r6822205 / r6822201;
        double r6822207 = x;
        double r6822208 = r6822207 * r6822200;
        double r6822209 = r6822206 * r6822208;
        double r6822210 = -4.693289067124317e-250;
        bool r6822211 = r6822202 <= r6822210;
        double r6822212 = r6822207 * r6822202;
        double r6822213 = -0.0;
        bool r6822214 = r6822202 <= r6822213;
        double r6822215 = r6822207 * r6822206;
        double r6822216 = r6822215 * r6822200;
        double r6822217 = r6822201 / r6822200;
        double r6822218 = r6822207 / r6822217;
        double r6822219 = r6822214 ? r6822216 : r6822218;
        double r6822220 = r6822211 ? r6822212 : r6822219;
        double r6822221 = r6822204 ? r6822209 : r6822220;
        return r6822221;
}

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 4 regimes
  2. if (/ y z) < -inf.0

    1. Initial program 60.0

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Taylor expanded around inf 0.3

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot y}}}\]
    6. Using strategy rm
    7. Applied associate-/r/0.3

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

    if -inf.0 < (/ y z) < -4.693289067124317e-250

    1. Initial program 10.9

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

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

    if -4.693289067124317e-250 < (/ y z) < -0.0

    1. Initial program 19.2

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Taylor expanded around inf 0.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied clear-num0.9

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot y}}}\]
    6. Using strategy rm
    7. Applied associate-/r/0.2

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

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

    if -0.0 < (/ y z)

    1. Initial program 12.8

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Taylor expanded around inf 6.5

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied associate-/l*3.6

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

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

Reproduce

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