Average Error: 14.4 → 1.8
Time: 7.2s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;\frac{1}{\frac{z}{y \cdot x}}\\ \mathbf{elif}\;\frac{y}{z} \le -1.277987902397856 \cdot 10^{-271}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.484083870392539 \cdot 10^{-222}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} = -\infty:\\
\;\;\;\;\frac{1}{\frac{z}{y \cdot x}}\\

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r1830203 = x;
        double r1830204 = y;
        double r1830205 = z;
        double r1830206 = r1830204 / r1830205;
        double r1830207 = t;
        double r1830208 = r1830206 * r1830207;
        double r1830209 = r1830208 / r1830207;
        double r1830210 = r1830203 * r1830209;
        return r1830210;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r1830211 = y;
        double r1830212 = z;
        double r1830213 = r1830211 / r1830212;
        double r1830214 = -inf.0;
        bool r1830215 = r1830213 <= r1830214;
        double r1830216 = 1.0;
        double r1830217 = x;
        double r1830218 = r1830211 * r1830217;
        double r1830219 = r1830212 / r1830218;
        double r1830220 = r1830216 / r1830219;
        double r1830221 = -1.277987902397856e-271;
        bool r1830222 = r1830213 <= r1830221;
        double r1830223 = r1830217 * r1830213;
        double r1830224 = 1.484083870392539e-222;
        bool r1830225 = r1830213 <= r1830224;
        double r1830226 = r1830216 / r1830212;
        double r1830227 = r1830218 * r1830226;
        double r1830228 = r1830225 ? r1830227 : r1830223;
        double r1830229 = r1830222 ? r1830223 : r1830228;
        double r1830230 = r1830215 ? r1830220 : r1830229;
        return r1830230;
}

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}}\]
    3. Taylor expanded around 0 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}}}\]

    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:\\ \;\;\;\;\frac{1}{\frac{z}{y \cdot x}}\\ \mathbf{elif}\;\frac{y}{z} \le -1.277987902397856 \cdot 10^{-271}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.484083870392539 \cdot 10^{-222}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \end{array}\]

Reproduce

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