\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \frac{x \cdot y}{z}\\
\mathbf{if}\;x \cdot y \leq -7.01133933954049 \cdot 10^{-133}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot y \leq 4.6898775201 \cdot 10^{-313}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;x \cdot y \leq 6.9663080033419285 \cdot 10^{+134}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(if (<= (* x y) (- INFINITY))
(* x (/ y z))
(let* ((t_0 (/ (* x y) z)))
(if (<= (* x y) -7.01133933954049e-133)
t_0
(if (<= (* x y) 4.6898775201e-313)
(* y (/ x z))
(if (<= (* x y) 6.9663080033419285e+134) t_0 (/ x (/ z y))))))))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 = x * (y / z);
} else {
double t_0 = (x * y) / z;
double tmp_1;
if ((x * y) <= -7.01133933954049e-133) {
tmp_1 = t_0;
} else if ((x * y) <= 4.6898775201e-313) {
tmp_1 = y * (x / z);
} else if ((x * y) <= 6.9663080033419285e+134) {
tmp_1 = t_0;
} else {
tmp_1 = x / (z / y);
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.4 |
|---|---|
| Target | 6.3 |
| Herbie | 0.8 |
if (*.f64 x y) < -inf.0Initial program 64.0
Applied *-un-lft-identity_binary6464.0
Applied times-frac_binary640.2
Simplified0.2
if -inf.0 < (*.f64 x y) < -7.01133933954049005e-133 or 4.68987752008e-313 < (*.f64 x y) < 6.9663080033419285e134Initial program 0.2
Applied add-cube-cbrt_binary641.3
Applied times-frac_binary647.5
Taylor expanded in x around 0 0.2
Applied *-un-lft-identity_binary640.2
Applied times-frac_binary648.5
Simplified8.5
Applied pow1_binary648.5
Applied pow1_binary648.5
Applied pow-prod-down_binary648.5
Simplified0.2
if -7.01133933954049005e-133 < (*.f64 x y) < 4.68987752008e-313Initial program 11.2
Applied add-cube-cbrt_binary6411.6
Applied times-frac_binary641.0
Taylor expanded in x around 0 11.2
Applied *-un-lft-identity_binary6411.2
Applied times-frac_binary641.1
Simplified1.1
if 6.9663080033419285e134 < (*.f64 x y) Initial program 18.1
Applied associate-/l*_binary643.2
Final simplification0.8
herbie shell --seed 2022077
(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))