Average Error: 15.0 → 1.6
Time: 5.3s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty \lor \neg \left(\frac{y}{z} \le -4.63381832549882 \cdot 10^{-264} \lor \neg \left(\frac{y}{z} \le 7.18495937326560576 \cdot 10^{-264}\right)\right):\\ \;\;\;\;\frac{x \cdot y}{z}\\ \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 \lor \neg \left(\frac{y}{z} \le -4.63381832549882 \cdot 10^{-264} \lor \neg \left(\frac{y}{z} \le 7.18495937326560576 \cdot 10^{-264}\right)\right):\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r615 = x;
        double r616 = y;
        double r617 = z;
        double r618 = r616 / r617;
        double r619 = t;
        double r620 = r618 * r619;
        double r621 = r620 / r619;
        double r622 = r615 * r621;
        return r622;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r623 = y;
        double r624 = z;
        double r625 = r623 / r624;
        double r626 = -inf.0;
        bool r627 = r625 <= r626;
        double r628 = -4.63381832549882e-264;
        bool r629 = r625 <= r628;
        double r630 = 7.184959373265606e-264;
        bool r631 = r625 <= r630;
        double r632 = !r631;
        bool r633 = r629 || r632;
        double r634 = !r633;
        bool r635 = r627 || r634;
        double r636 = x;
        double r637 = r636 * r623;
        double r638 = r637 / r624;
        double r639 = r624 / r623;
        double r640 = r636 / r639;
        double r641 = r635 ? r638 : r640;
        return r641;
}

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 -4.63381832549882e-264 < (/ y z) < 7.184959373265606e-264

    1. Initial program 24.0

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/0.1

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

    if -inf.0 < (/ y z) < -4.63381832549882e-264 or 7.184959373265606e-264 < (/ y z)

    1. Initial program 12.4

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/7.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty \lor \neg \left(\frac{y}{z} \le -4.63381832549882 \cdot 10^{-264} \lor \neg \left(\frac{y}{z} \le 7.18495937326560576 \cdot 10^{-264}\right)\right):\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

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