Average Error: 6.5 → 0.7
Time: 2.3s
Precision: 64
\[\frac{x \cdot y}{z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot y}{z} = -\infty:\\ \;\;\;\;1 \cdot \frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le -2.75403327231568085421125185005337842666 \cdot 10^{-316}:\\ \;\;\;\;1 \cdot \frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le 0.0:\\ \;\;\;\;1 \cdot \left(x \cdot \frac{y}{z}\right)\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le 3.90915317948964794762777056224645120804 \cdot 10^{266}:\\ \;\;\;\;1 \cdot \frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(x \cdot \frac{y}{z}\right)\\ \end{array}\]
\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y}{z} = -\infty:\\
\;\;\;\;1 \cdot \frac{x}{\frac{z}{y}}\\

\mathbf{elif}\;\frac{x \cdot y}{z} \le -2.75403327231568085421125185005337842666 \cdot 10^{-316}:\\
\;\;\;\;1 \cdot \frac{x \cdot y}{z}\\

\mathbf{elif}\;\frac{x \cdot y}{z} \le 0.0:\\
\;\;\;\;1 \cdot \left(x \cdot \frac{y}{z}\right)\\

\mathbf{elif}\;\frac{x \cdot y}{z} \le 3.90915317948964794762777056224645120804 \cdot 10^{266}:\\
\;\;\;\;1 \cdot \frac{x \cdot y}{z}\\

\mathbf{else}:\\
\;\;\;\;1 \cdot \left(x \cdot \frac{y}{z}\right)\\

\end{array}
double f(double x, double y, double z) {
        double r664918 = x;
        double r664919 = y;
        double r664920 = r664918 * r664919;
        double r664921 = z;
        double r664922 = r664920 / r664921;
        return r664922;
}

double f(double x, double y, double z) {
        double r664923 = x;
        double r664924 = y;
        double r664925 = r664923 * r664924;
        double r664926 = z;
        double r664927 = r664925 / r664926;
        double r664928 = -inf.0;
        bool r664929 = r664927 <= r664928;
        double r664930 = 1.0;
        double r664931 = r664926 / r664924;
        double r664932 = r664923 / r664931;
        double r664933 = r664930 * r664932;
        double r664934 = -2.7540332723157e-316;
        bool r664935 = r664927 <= r664934;
        double r664936 = r664930 * r664927;
        double r664937 = 0.0;
        bool r664938 = r664927 <= r664937;
        double r664939 = r664924 / r664926;
        double r664940 = r664923 * r664939;
        double r664941 = r664930 * r664940;
        double r664942 = 3.909153179489648e+266;
        bool r664943 = r664927 <= r664942;
        double r664944 = r664943 ? r664936 : r664941;
        double r664945 = r664938 ? r664941 : r664944;
        double r664946 = r664935 ? r664936 : r664945;
        double r664947 = r664929 ? r664933 : r664946;
        return r664947;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.5
Target6.5
Herbie0.7
\[\begin{array}{l} \mathbf{if}\;z \lt -4.262230790519428958560619200129306371776 \cdot 10^{-138}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \lt 1.704213066065047207696571404603247573308 \cdot 10^{-164}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x y) z) < -inf.0

    1. Initial program 64.0

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt64.0

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

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

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

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

      \[\leadsto 1 \cdot \color{blue}{\frac{x \cdot y}{z}}\]
    9. Using strategy rm
    10. Applied associate-/l*0.2

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

    if -inf.0 < (/ (* x y) z) < -2.7540332723157e-316 or 0.0 < (/ (* x y) z) < 3.909153179489648e+266

    1. Initial program 2.2

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt3.2

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

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

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

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

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

    if -2.7540332723157e-316 < (/ (* x y) z) < 0.0 or 3.909153179489648e+266 < (/ (* x y) z)

    1. Initial program 18.8

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt18.9

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot y}{z} = -\infty:\\ \;\;\;\;1 \cdot \frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le -2.75403327231568085421125185005337842666 \cdot 10^{-316}:\\ \;\;\;\;1 \cdot \frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le 0.0:\\ \;\;\;\;1 \cdot \left(x \cdot \frac{y}{z}\right)\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le 3.90915317948964794762777056224645120804 \cdot 10^{266}:\\ \;\;\;\;1 \cdot \frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(x \cdot \frac{y}{z}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(FPCore (x y z)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))

  (/ (* x y) z))