Average Error: 6.3 → 3.0
Time: 4.5s
Precision: 64
\[\frac{x \cdot y}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y = -\infty:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;x \cdot y \le -2.151301248767147878432323417865107726952 \cdot 10^{-307}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y}{\sqrt[3]{z}}\\ \end{array}\]
\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y = -\infty:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r759311 = x;
        double r759312 = y;
        double r759313 = r759311 * r759312;
        double r759314 = z;
        double r759315 = r759313 / r759314;
        return r759315;
}

double f(double x, double y, double z) {
        double r759316 = x;
        double r759317 = y;
        double r759318 = r759316 * r759317;
        double r759319 = -inf.0;
        bool r759320 = r759318 <= r759319;
        double r759321 = z;
        double r759322 = r759321 / r759317;
        double r759323 = r759316 / r759322;
        double r759324 = -2.151301248767148e-307;
        bool r759325 = r759318 <= r759324;
        double r759326 = r759318 / r759321;
        double r759327 = cbrt(r759321);
        double r759328 = r759327 * r759327;
        double r759329 = r759316 / r759328;
        double r759330 = r759317 / r759327;
        double r759331 = r759329 * r759330;
        double r759332 = r759325 ? r759326 : r759331;
        double r759333 = r759320 ? r759323 : r759332;
        return r759333;
}

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.3
Target6.1
Herbie3.0
\[\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) < -inf.0

    1. Initial program 64.0

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied associate-/l*0.3

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

    if -inf.0 < (* x y) < -2.151301248767148e-307

    1. Initial program 0.2

      \[\frac{x \cdot y}{z}\]

    if -2.151301248767148e-307 < (* x y)

    1. Initial program 7.6

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

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

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

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

Reproduce

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