Average Error: 15.1 → 1.3
Time: 22.9s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.636236528901048215946534163640858695462 \cdot 10^{270}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.631110063090909634837685639348743915595 \cdot 10^{-306}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z}} \cdot x\right)\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -4.636236528901048215946534163640858695462 \cdot 10^{270}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z}} \cdot x\right)\\

\end{array}
double f(double x, double y, double z, double t) {
        double r389638 = x;
        double r389639 = y;
        double r389640 = z;
        double r389641 = r389639 / r389640;
        double r389642 = t;
        double r389643 = r389641 * r389642;
        double r389644 = r389643 / r389642;
        double r389645 = r389638 * r389644;
        return r389645;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r389646 = y;
        double r389647 = z;
        double r389648 = r389646 / r389647;
        double r389649 = -4.636236528901048e+270;
        bool r389650 = r389648 <= r389649;
        double r389651 = x;
        double r389652 = r389651 / r389647;
        double r389653 = r389646 * r389652;
        double r389654 = -1.6311100630909096e-306;
        bool r389655 = r389648 <= r389654;
        double r389656 = r389648 * r389651;
        double r389657 = cbrt(r389646);
        double r389658 = r389657 * r389657;
        double r389659 = cbrt(r389647);
        double r389660 = r389659 * r389659;
        double r389661 = r389658 / r389660;
        double r389662 = r389657 / r389659;
        double r389663 = r389662 * r389651;
        double r389664 = r389661 * r389663;
        double r389665 = r389655 ? r389656 : r389664;
        double r389666 = r389650 ? r389653 : r389665;
        return r389666;
}

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

Target

Original15.1
Target1.5
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \lt -1.206722051230450047215521150762600712224 \cdot 10^{245}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt -5.90752223693390632993316700759382836344 \cdot 10^{-275}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt 5.658954423153415216825328199697215652986 \cdot 10^{-65}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt 2.008718050240713347941382056648619307142 \cdot 10^{217}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -4.636236528901048e+270

    1. Initial program 54.7

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

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

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

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

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

    if -4.636236528901048e+270 < (/ y z) < -1.6311100630909096e-306

    1. Initial program 10.4

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

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

    if -1.6311100630909096e-306 < (/ y z)

    1. Initial program 15.7

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

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

      \[\leadsto \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \cdot x\]
    5. Applied add-cube-cbrt8.7

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.636236528901048215946534163640858695462 \cdot 10^{270}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.631110063090909634837685639348743915595 \cdot 10^{-306}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z}} \cdot x\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< (/ (* (/ y z) t) t) -1.20672205123045005e245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.90752223693390633e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.65895442315341522e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e217) (* x (/ y z)) (/ (* y x) z)))))

  (* x (/ (* (/ y z) t) t)))