\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \frac{x \cdot y}{z}\\
\mathbf{if}\;x \cdot y \leq -3.7244331968216916 \cdot 10^{-288}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot y \leq 9.72260088070231 \cdot 10^{-305}:\\
\;\;\;\;\frac{\frac{1}{\frac{z}{y}}}{\frac{1}{x}}\\
\mathbf{elif}\;x \cdot y \leq 1.2223870885476119 \cdot 10^{+145}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(if (<= (* x y) (- INFINITY))
(* y (/ x z))
(let* ((t_0 (/ (* x y) z)))
(if (<= (* x y) -3.7244331968216916e-288)
t_0
(if (<= (* x y) 9.72260088070231e-305)
(/ (/ 1.0 (/ z y)) (/ 1.0 x))
(if (<= (* x y) 1.2223870885476119e+145) t_0 (* x (/ y z))))))))double code(double x, double y, double z) {
return (x * y) / z;
}
double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = y * (x / z);
} else {
double t_0 = (x * y) / z;
double tmp_1;
if ((x * y) <= -3.7244331968216916e-288) {
tmp_1 = t_0;
} else if ((x * y) <= 9.72260088070231e-305) {
tmp_1 = (1.0 / (z / y)) / (1.0 / x);
} else if ((x * y) <= 1.2223870885476119e+145) {
tmp_1 = t_0;
} else {
tmp_1 = x * (y / z);
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.5 |
|---|---|
| Target | 6.3 |
| Herbie | 0.4 |
if (*.f64 x y) < -inf.0Initial program 64.0
Applied associate-/l*_binary640.3
Applied associate-/r/_binary640.3
if -inf.0 < (*.f64 x y) < -3.7244331968216916e-288 or 9.7226008807023103e-305 < (*.f64 x y) < 1.2223870885476119e145Initial program 0.2
if -3.7244331968216916e-288 < (*.f64 x y) < 9.7226008807023103e-305Initial program 17.5
Applied associate-/l*_binary640.1
Applied clear-num_binary640.5
Applied div-inv_binary640.6
Applied associate-/r*_binary640.2
if 1.2223870885476119e145 < (*.f64 x y) Initial program 18.5
Applied *-un-lft-identity_binary6418.5
Applied times-frac_binary642.0
Simplified2.0
Final simplification0.4
herbie shell --seed 2022088
(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))