\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y}{z} = -\infty:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;\frac{x \cdot y}{z} \le -5.954942870390162170560614222042356335045 \cdot 10^{-288}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z) {
double r1265344 = x;
double r1265345 = y;
double r1265346 = r1265344 * r1265345;
double r1265347 = z;
double r1265348 = r1265346 / r1265347;
return r1265348;
}
double f(double x, double y, double z) {
double r1265349 = x;
double r1265350 = y;
double r1265351 = r1265349 * r1265350;
double r1265352 = z;
double r1265353 = r1265351 / r1265352;
double r1265354 = -inf.0;
bool r1265355 = r1265353 <= r1265354;
double r1265356 = r1265350 / r1265352;
double r1265357 = r1265349 * r1265356;
double r1265358 = -5.954942870390162e-288;
bool r1265359 = r1265353 <= r1265358;
double r1265360 = r1265352 / r1265350;
double r1265361 = r1265349 / r1265360;
double r1265362 = r1265359 ? r1265353 : r1265361;
double r1265363 = r1265355 ? r1265357 : r1265362;
return r1265363;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.4 |
|---|---|
| Target | 6.4 |
| Herbie | 3.5 |
if (/ (* x y) z) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied times-frac0.3
Simplified0.3
if -inf.0 < (/ (* x y) z) < -5.954942870390162e-288Initial program 0.5
rmApplied associate-/l*8.0
rmApplied add-cube-cbrt9.0
Applied *-un-lft-identity9.0
Applied times-frac9.0
Applied associate-/r*2.7
Simplified2.7
Taylor expanded around 0 0.5
if -5.954942870390162e-288 < (/ (* x y) z) Initial program 7.2
rmApplied associate-/l*5.3
Final simplification3.5
herbie shell --seed 2019318
(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))