\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 -4.1872115872888202 \cdot 10^{-218}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\
\mathbf{elif}\;x \cdot y \le 8.47685242098004365 \cdot 10^{-299}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{x \cdot y}{z}\\
\end{array}double f(double x, double y, double z) {
double r847180 = x;
double r847181 = y;
double r847182 = r847180 * r847181;
double r847183 = z;
double r847184 = r847182 / r847183;
return r847184;
}
double f(double x, double y, double z) {
double r847185 = x;
double r847186 = y;
double r847187 = r847185 * r847186;
double r847188 = -inf.0;
bool r847189 = r847187 <= r847188;
double r847190 = z;
double r847191 = r847190 / r847186;
double r847192 = r847185 / r847191;
double r847193 = -4.18721158728882e-218;
bool r847194 = r847187 <= r847193;
double r847195 = 1.0;
double r847196 = r847190 / r847187;
double r847197 = r847195 / r847196;
double r847198 = 8.476852420980044e-299;
bool r847199 = r847187 <= r847198;
double r847200 = r847186 / r847190;
double r847201 = r847185 * r847200;
double r847202 = r847187 / r847190;
double r847203 = r847195 * r847202;
double r847204 = r847199 ? r847201 : r847203;
double r847205 = r847194 ? r847197 : r847204;
double r847206 = r847189 ? r847192 : r847205;
return r847206;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.3 |
|---|---|
| Target | 5.9 |
| Herbie | 1.8 |
if (* x y) < -inf.0Initial program 64.0
rmApplied associate-/l*0.2
if -inf.0 < (* x y) < -4.18721158728882e-218Initial program 0.2
rmApplied clear-num0.6
if -4.18721158728882e-218 < (* x y) < 8.476852420980044e-299Initial program 15.5
rmApplied *-un-lft-identity15.5
Applied times-frac0.2
Simplified0.2
if 8.476852420980044e-299 < (* x y) Initial program 3.7
rmApplied clear-num4.1
rmApplied *-un-lft-identity4.1
Applied add-cube-cbrt4.1
Applied times-frac4.1
Simplified4.1
Simplified3.7
Final simplification1.8
herbie shell --seed 2020035
(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))