\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y = -\infty:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;x \cdot y \le -2.194443350775470398848039528862924587498 \cdot 10^{-140}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 1.132971827104085719715227384294432498361 \cdot 10^{-277}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;x \cdot y \le 4.552391931798920032050045519550199226521 \cdot 10^{228}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}double f(double x, double y, double z) {
double r640277 = x;
double r640278 = y;
double r640279 = r640277 * r640278;
double r640280 = z;
double r640281 = r640279 / r640280;
return r640281;
}
double f(double x, double y, double z) {
double r640282 = x;
double r640283 = y;
double r640284 = r640282 * r640283;
double r640285 = -inf.0;
bool r640286 = r640284 <= r640285;
double r640287 = z;
double r640288 = r640282 / r640287;
double r640289 = r640288 * r640283;
double r640290 = -2.1944433507754704e-140;
bool r640291 = r640284 <= r640290;
double r640292 = r640284 / r640287;
double r640293 = 1.1329718271040857e-277;
bool r640294 = r640284 <= r640293;
double r640295 = r640287 / r640282;
double r640296 = r640283 / r640295;
double r640297 = 4.55239193179892e+228;
bool r640298 = r640284 <= r640297;
double r640299 = r640298 ? r640292 : r640289;
double r640300 = r640294 ? r640296 : r640299;
double r640301 = r640291 ? r640292 : r640300;
double r640302 = r640286 ? r640289 : r640301;
return r640302;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.3 |
|---|---|
| Target | 6.4 |
| Herbie | 0.5 |
if (* x y) < -inf.0 or 4.55239193179892e+228 < (* x y) Initial program 44.3
Simplified0.5
rmApplied pow10.5
Applied pow10.5
Applied pow-prod-down0.5
Simplified0.6
Taylor expanded around 0 44.3
Simplified0.6
if -inf.0 < (* x y) < -2.1944433507754704e-140 or 1.1329718271040857e-277 < (* x y) < 4.55239193179892e+228Initial program 0.2
if -2.1944433507754704e-140 < (* x y) < 1.1329718271040857e-277Initial program 11.1
Simplified0.9
rmApplied pow10.9
Applied pow10.9
Applied pow-prod-down0.9
Simplified1.0
Final simplification0.5
herbie shell --seed 2019196
(FPCore (x y z)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
:herbie-target
(if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))
(/ (* x y) z))