Average Error: 14.6 → 1.7
Time: 19.8s
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 -9.764747372949971 \cdot 10^{-270}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 2.6772801671161767 \cdot 10^{-229}:\\ \;\;\;\;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} = -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

\mathbf{elif}\;\frac{y}{z} \le 2.6772801671161767 \cdot 10^{-229}:\\
\;\;\;\;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 r3544024 = x;
        double r3544025 = y;
        double r3544026 = z;
        double r3544027 = r3544025 / r3544026;
        double r3544028 = t;
        double r3544029 = r3544027 * r3544028;
        double r3544030 = r3544029 / r3544028;
        double r3544031 = r3544024 * r3544030;
        return r3544031;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r3544032 = y;
        double r3544033 = z;
        double r3544034 = r3544032 / r3544033;
        double r3544035 = -inf.0;
        bool r3544036 = r3544034 <= r3544035;
        double r3544037 = x;
        double r3544038 = r3544037 / r3544033;
        double r3544039 = r3544032 * r3544038;
        double r3544040 = -9.764747372949971e-270;
        bool r3544041 = r3544034 <= r3544040;
        double r3544042 = r3544034 * r3544037;
        double r3544043 = 2.6772801671161767e-229;
        bool r3544044 = r3544034 <= r3544043;
        double r3544045 = r3544044 ? r3544039 : r3544042;
        double r3544046 = r3544041 ? r3544042 : r3544045;
        double r3544047 = r3544036 ? r3544039 : r3544046;
        return r3544047;
}

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) < -inf.0 or -9.764747372949971e-270 < (/ y z) < 2.6772801671161767e-229

    1. Initial program 22.7

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

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

    if -inf.0 < (/ y z) < -9.764747372949971e-270 or 2.6772801671161767e-229 < (/ y z)

    1. Initial program 12.0

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -9.764747372949971 \cdot 10^{-270}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 2.6772801671161767 \cdot 10^{-229}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array}\]

Reproduce

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