Average Error: 15.1 → 1.2
Time: 18.0s
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 -1.418027389015775738156568367664862717017 \cdot 10^{-287}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{\sqrt[3]{z}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{x}}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}\\ \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 -1.418027389015775738156568367664862717017 \cdot 10^{-287}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r21740838 = x;
        double r21740839 = y;
        double r21740840 = z;
        double r21740841 = r21740839 / r21740840;
        double r21740842 = t;
        double r21740843 = r21740841 * r21740842;
        double r21740844 = r21740843 / r21740842;
        double r21740845 = r21740838 * r21740844;
        return r21740845;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r21740846 = y;
        double r21740847 = z;
        double r21740848 = r21740846 / r21740847;
        double r21740849 = -inf.0;
        bool r21740850 = r21740848 <= r21740849;
        double r21740851 = x;
        double r21740852 = r21740851 / r21740847;
        double r21740853 = r21740846 * r21740852;
        double r21740854 = -1.4180273890157757e-287;
        bool r21740855 = r21740848 <= r21740854;
        double r21740856 = r21740847 / r21740846;
        double r21740857 = r21740851 / r21740856;
        double r21740858 = cbrt(r21740847);
        double r21740859 = cbrt(r21740851);
        double r21740860 = r21740858 / r21740859;
        double r21740861 = r21740860 * r21740860;
        double r21740862 = r21740846 / r21740861;
        double r21740863 = r21740859 / r21740858;
        double r21740864 = r21740862 * r21740863;
        double r21740865 = r21740855 ? r21740857 : r21740864;
        double r21740866 = r21740850 ? r21740853 : r21740865;
        return r21740866;
}

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.4
Herbie1.2
\[\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) < -inf.0

    1. Initial program 64.0

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

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

    if -inf.0 < (/ y z) < -1.4180273890157757e-287

    1. Initial program 10.4

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

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

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    5. Applied *-un-lft-identity8.6

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

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

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

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

      \[\leadsto \frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{x}{\sqrt[3]{\color{blue}{1 \cdot z}}}\]
    11. Applied cbrt-prod2.7

      \[\leadsto \frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{x}{\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{z}}}\]
    12. Applied *-un-lft-identity2.7

      \[\leadsto \frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{\color{blue}{1 \cdot x}}{\sqrt[3]{1} \cdot \sqrt[3]{z}}\]
    13. Applied times-frac2.7

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

      \[\leadsto \color{blue}{\left(\frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{1}{\sqrt[3]{1}}\right) \cdot \frac{x}{\sqrt[3]{z}}}\]
    15. Simplified2.7

      \[\leadsto \color{blue}{\frac{y}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{x}{\sqrt[3]{z}}\]
    16. Using strategy rm
    17. Applied *-un-lft-identity2.7

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

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

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

    if -1.4180273890157757e-287 < (/ y z)

    1. Initial program 16.1

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

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

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    5. Applied *-un-lft-identity5.7

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

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

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

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

      \[\leadsto \frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{x}{\sqrt[3]{\color{blue}{1 \cdot z}}}\]
    11. Applied cbrt-prod6.0

      \[\leadsto \frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{x}{\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{z}}}\]
    12. Applied *-un-lft-identity6.0

      \[\leadsto \frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{\color{blue}{1 \cdot x}}{\sqrt[3]{1} \cdot \sqrt[3]{z}}\]
    13. Applied times-frac6.0

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

      \[\leadsto \color{blue}{\left(\frac{\frac{y}{\sqrt[3]{z}}}{\sqrt[3]{z}} \cdot \frac{1}{\sqrt[3]{1}}\right) \cdot \frac{x}{\sqrt[3]{z}}}\]
    15. Simplified6.0

      \[\leadsto \color{blue}{\frac{y}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{x}{\sqrt[3]{z}}\]
    16. Using strategy rm
    17. Applied *-un-lft-identity6.0

      \[\leadsto \frac{y}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{x}{\sqrt[3]{\color{blue}{1 \cdot z}}}\]
    18. Applied cbrt-prod6.0

      \[\leadsto \frac{y}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{x}{\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{z}}}\]
    19. Applied add-cube-cbrt6.1

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.418027389015775738156568367664862717017 \cdot 10^{-287}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{\sqrt[3]{z}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{x}}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019170 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"

  :herbie-target
  (if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))

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