Average Error: 15.1 → 5.9
Time: 14.1s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.057062710333388 \cdot 10^{-256}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \le 1.0531420844975264 \cdot 10^{-216}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;z \le -4.057062710333388 \cdot 10^{-256}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r3584491 = x;
        double r3584492 = y;
        double r3584493 = z;
        double r3584494 = r3584492 / r3584493;
        double r3584495 = t;
        double r3584496 = r3584494 * r3584495;
        double r3584497 = r3584496 / r3584495;
        double r3584498 = r3584491 * r3584497;
        return r3584498;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r3584499 = z;
        double r3584500 = -4.057062710333388e-256;
        bool r3584501 = r3584499 <= r3584500;
        double r3584502 = x;
        double r3584503 = y;
        double r3584504 = r3584502 * r3584503;
        double r3584505 = r3584504 / r3584499;
        double r3584506 = 1.0531420844975264e-216;
        bool r3584507 = r3584499 <= r3584506;
        double r3584508 = r3584499 / r3584503;
        double r3584509 = r3584502 / r3584508;
        double r3584510 = r3584507 ? r3584509 : r3584505;
        double r3584511 = r3584501 ? r3584505 : r3584510;
        return r3584511;
}

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 z < -4.057062710333388e-256 or 1.0531420844975264e-216 < z

    1. Initial program 14.3

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot \frac{1}{z}}\]
    6. Taylor expanded around 0 5.3

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

    if -4.057062710333388e-256 < z < 1.0531420844975264e-216

    1. Initial program 23.2

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.057062710333388 \cdot 10^{-256}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \le 1.0531420844975264 \cdot 10^{-216}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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