Average Error: 6.1 → 0.4
Time: 9.8s
Precision: 64
\[\frac{x \cdot y}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y = -\infty:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;x \cdot y \le -1.518340285158244167699972310716084602895 \cdot 10^{-194} \lor \neg \left(x \cdot y \le 5.88065538335666025342643040475244053333 \cdot 10^{-283}\right) \land x \cdot y \le 1.984690863720470523745396250756862977108 \cdot 10^{170}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]
\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y = -\infty:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;x \cdot y \le -1.518340285158244167699972310716084602895 \cdot 10^{-194} \lor \neg \left(x \cdot y \le 5.88065538335666025342643040475244053333 \cdot 10^{-283}\right) \land x \cdot y \le 1.984690863720470523745396250756862977108 \cdot 10^{170}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

\end{array}
double f(double x, double y, double z) {
        double r594765 = x;
        double r594766 = y;
        double r594767 = r594765 * r594766;
        double r594768 = z;
        double r594769 = r594767 / r594768;
        return r594769;
}

double f(double x, double y, double z) {
        double r594770 = x;
        double r594771 = y;
        double r594772 = r594770 * r594771;
        double r594773 = -inf.0;
        bool r594774 = r594772 <= r594773;
        double r594775 = z;
        double r594776 = r594771 / r594775;
        double r594777 = r594770 * r594776;
        double r594778 = -1.5183402851582442e-194;
        bool r594779 = r594772 <= r594778;
        double r594780 = 5.88065538335666e-283;
        bool r594781 = r594772 <= r594780;
        double r594782 = !r594781;
        double r594783 = 1.9846908637204705e+170;
        bool r594784 = r594772 <= r594783;
        bool r594785 = r594782 && r594784;
        bool r594786 = r594779 || r594785;
        double r594787 = r594772 / r594775;
        double r594788 = r594775 / r594771;
        double r594789 = r594770 / r594788;
        double r594790 = r594786 ? r594787 : r594789;
        double r594791 = r594774 ? r594777 : r594790;
        return r594791;
}

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.1
Target6.1
Herbie0.4
\[\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 *-un-lft-identity64.0

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    4. Applied times-frac0.2

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
    5. Simplified0.2

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

    if -inf.0 < (* x y) < -1.5183402851582442e-194 or 5.88065538335666e-283 < (* x y) < 1.9846908637204705e+170

    1. Initial program 0.2

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

    if -1.5183402851582442e-194 < (* x y) < 5.88065538335666e-283 or 1.9846908637204705e+170 < (* x y)

    1. Initial program 14.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y = -\infty:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;x \cdot y \le -1.518340285158244167699972310716084602895 \cdot 10^{-194} \lor \neg \left(x \cdot y \le 5.88065538335666025342643040475244053333 \cdot 10^{-283}\right) \land x \cdot y \le 1.984690863720470523745396250756862977108 \cdot 10^{170}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019305 
(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.70421306606504721e-164) (/ x (/ z y)) (* (/ x z) y)))

  (/ (* x y) z))