\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 -8.262890138825605465511184669818653865175 \cdot 10^{-174} \lor \neg \left(x \cdot y \le 1.775239536769126579734755404861004766773 \cdot 10^{-219}\right) \land x \cdot y \le 4.654103577641758604718829078963007975589 \cdot 10^{206}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}double f(double x, double y, double z) {
double r397514 = x;
double r397515 = y;
double r397516 = r397514 * r397515;
double r397517 = z;
double r397518 = r397516 / r397517;
return r397518;
}
double f(double x, double y, double z) {
double r397519 = x;
double r397520 = y;
double r397521 = r397519 * r397520;
double r397522 = -inf.0;
bool r397523 = r397521 <= r397522;
double r397524 = z;
double r397525 = r397520 / r397524;
double r397526 = r397519 * r397525;
double r397527 = -8.262890138825605e-174;
bool r397528 = r397521 <= r397527;
double r397529 = 1.7752395367691266e-219;
bool r397530 = r397521 <= r397529;
double r397531 = !r397530;
double r397532 = 4.6541035776417586e+206;
bool r397533 = r397521 <= r397532;
bool r397534 = r397531 && r397533;
bool r397535 = r397528 || r397534;
double r397536 = r397521 / r397524;
double r397537 = r397519 / r397524;
double r397538 = r397537 * r397520;
double r397539 = r397535 ? r397536 : r397538;
double r397540 = r397523 ? r397526 : r397539;
return r397540;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.5 |
|---|---|
| Target | 6.5 |
| Herbie | 0.4 |
if (* x y) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied times-frac0.3
Simplified0.3
if -inf.0 < (* x y) < -8.262890138825605e-174 or 1.7752395367691266e-219 < (* x y) < 4.6541035776417586e+206Initial program 0.2
if -8.262890138825605e-174 < (* x y) < 1.7752395367691266e-219 or 4.6541035776417586e+206 < (* x y) Initial program 13.4
rmApplied associate-/l*0.8
rmApplied associate-/r/0.7
Final simplification0.4
herbie shell --seed 2019326 +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))