Average Error: 14.5 → 2.2
Time: 4.7s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.42110258613913981 \cdot 10^{-87} \lor \neg \left(\frac{y}{z} \le 1.1014995100088346 \cdot 10^{-297} \lor \neg \left(\frac{y}{z} \le 1.84201517993839439 \cdot 10^{192}\right)\right):\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -1.42110258613913981 \cdot 10^{-87} \lor \neg \left(\frac{y}{z} \le 1.1014995100088346 \cdot 10^{-297} \lor \neg \left(\frac{y}{z} \le 1.84201517993839439 \cdot 10^{192}\right)\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r85495 = x;
        double r85496 = y;
        double r85497 = z;
        double r85498 = r85496 / r85497;
        double r85499 = t;
        double r85500 = r85498 * r85499;
        double r85501 = r85500 / r85499;
        double r85502 = r85495 * r85501;
        return r85502;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r85503 = y;
        double r85504 = z;
        double r85505 = r85503 / r85504;
        double r85506 = -1.4211025861391398e-87;
        bool r85507 = r85505 <= r85506;
        double r85508 = 1.1014995100088346e-297;
        bool r85509 = r85505 <= r85508;
        double r85510 = 1.8420151799383944e+192;
        bool r85511 = r85505 <= r85510;
        double r85512 = !r85511;
        bool r85513 = r85509 || r85512;
        double r85514 = !r85513;
        bool r85515 = r85507 || r85514;
        double r85516 = x;
        double r85517 = r85516 * r85505;
        double r85518 = r85516 * r85503;
        double r85519 = r85518 / r85504;
        double r85520 = r85515 ? r85517 : r85519;
        return r85520;
}

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) < -1.4211025861391398e-87 or 1.1014995100088346e-297 < (/ y z) < 1.8420151799383944e+192

    1. Initial program 11.1

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

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

    if -1.4211025861391398e-87 < (/ y z) < 1.1014995100088346e-297 or 1.8420151799383944e+192 < (/ y z)

    1. Initial program 20.6

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt12.6

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \frac{y}{z}\right)}\]
    6. Using strategy rm
    7. Applied associate-*r/6.8

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\frac{\sqrt[3]{x} \cdot y}{z}}\]
    8. Applied associate-*r/2.4

      \[\leadsto \color{blue}{\frac{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot y\right)}{z}}\]
    9. Simplified1.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.42110258613913981 \cdot 10^{-87} \lor \neg \left(\frac{y}{z} \le 1.1014995100088346 \cdot 10^{-297} \lor \neg \left(\frac{y}{z} \le 1.84201517993839439 \cdot 10^{192}\right)\right):\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020049 +o rules:numerics
(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)))