Average Error: 14.6 → 1.3
Time: 19.7s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.8126829855011086 \cdot 10^{+56}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -6.5437421167394 \cdot 10^{-313}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.619197802471649 \cdot 10^{-117}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 3.5140858798581566 \cdot 10^{+213}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -3.8126829855011086 \cdot 10^{+56}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 3.5140858798581566 \cdot 10^{+213}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r3372291 = x;
        double r3372292 = y;
        double r3372293 = z;
        double r3372294 = r3372292 / r3372293;
        double r3372295 = t;
        double r3372296 = r3372294 * r3372295;
        double r3372297 = r3372296 / r3372295;
        double r3372298 = r3372291 * r3372297;
        return r3372298;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r3372299 = y;
        double r3372300 = z;
        double r3372301 = r3372299 / r3372300;
        double r3372302 = -3.8126829855011086e+56;
        bool r3372303 = r3372301 <= r3372302;
        double r3372304 = x;
        double r3372305 = r3372304 / r3372300;
        double r3372306 = r3372299 * r3372305;
        double r3372307 = -6.5437421167394e-313;
        bool r3372308 = r3372301 <= r3372307;
        double r3372309 = r3372301 * r3372304;
        double r3372310 = 1.619197802471649e-117;
        bool r3372311 = r3372301 <= r3372310;
        double r3372312 = r3372304 * r3372299;
        double r3372313 = r3372312 / r3372300;
        double r3372314 = 3.5140858798581566e+213;
        bool r3372315 = r3372301 <= r3372314;
        double r3372316 = r3372315 ? r3372309 : r3372306;
        double r3372317 = r3372311 ? r3372313 : r3372316;
        double r3372318 = r3372308 ? r3372309 : r3372317;
        double r3372319 = r3372303 ? r3372306 : r3372318;
        return r3372319;
}

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) < -3.8126829855011086e+56 or 3.5140858798581566e+213 < (/ y z)

    1. Initial program 28.8

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

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

    if -3.8126829855011086e+56 < (/ y z) < -6.5437421167394e-313 or 1.619197802471649e-117 < (/ y z) < 3.5140858798581566e+213

    1. Initial program 7.8

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot y}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity8.4

      \[\leadsto \frac{x}{\color{blue}{1 \cdot z}} \cdot y\]
    5. Applied add-cube-cbrt9.2

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{1 \cdot z} \cdot y\]
    6. Applied times-frac9.2

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \left(\frac{\sqrt[3]{x}}{z} \cdot y\right)}\]
    8. Taylor expanded around inf 9.6

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    9. Using strategy rm
    10. Applied *-un-lft-identity9.6

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    11. Applied times-frac0.2

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
    12. Simplified0.2

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

    if -6.5437421167394e-313 < (/ y z) < 1.619197802471649e-117

    1. Initial program 16.4

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot y}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity1.5

      \[\leadsto \frac{x}{\color{blue}{1 \cdot z}} \cdot y\]
    5. Applied add-cube-cbrt1.9

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{1 \cdot z} \cdot y\]
    6. Applied times-frac1.9

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \left(\frac{\sqrt[3]{x}}{z} \cdot y\right)}\]
    8. Taylor expanded around inf 1.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.8126829855011086 \cdot 10^{+56}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -6.5437421167394 \cdot 10^{-313}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.619197802471649 \cdot 10^{-117}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 3.5140858798581566 \cdot 10^{+213}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]

Reproduce

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