\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.545000424659655 \cdot 10^{+290}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \frac{x \cdot y}{z}\\
\mathbf{if}\;x \cdot y \leq -2.7643367134265166 \cdot 10^{-163}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot y \leq 5.898011240367938 \cdot 10^{-141}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \leq 2.231654736492483 \cdot 10^{+178}:\\
\;\;\;\;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) -7.545000424659655e+290)
(/ y (/ z x))
(let* ((t_0 (/ (* x y) z)))
(if (<= (* x y) -2.7643367134265166e-163)
t_0
(if (<= (* x y) 5.898011240367938e-141)
(* x (/ y z))
(if (<= (* x y) 2.231654736492483e+178) 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) <= -7.545000424659655e+290) {
tmp = y / (z / x);
} else {
double t_0 = (x * y) / z;
double tmp_1;
if ((x * y) <= -2.7643367134265166e-163) {
tmp_1 = t_0;
} else if ((x * y) <= 5.898011240367938e-141) {
tmp_1 = x * (y / z);
} else if ((x * y) <= 2.231654736492483e+178) {
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.0 |
| Herbie | 0.7 |
if (*.f64 x y) < -7.545000424659655e290Initial program 55.8
Applied add-cube-cbrt_binary6455.9
Applied associate-/r*_binary6456.0
Simplified12.9
Applied associate-/l*_binary641.2
Simplified0.2
if -7.545000424659655e290 < (*.f64 x y) < -2.76433671342651659e-163 or 5.898011240367938e-141 < (*.f64 x y) < 2.231654736492483e178Initial program 0.2
Applied add-cube-cbrt_binary641.3
Applied associate-/r*_binary641.3
Simplified6.5
Taylor expanded in y around 0 0.2
if -2.76433671342651659e-163 < (*.f64 x y) < 5.898011240367938e-141Initial program 8.4
Applied *-un-lft-identity_binary648.4
Applied times-frac_binary641.3
Simplified1.3
if 2.231654736492483e178 < (*.f64 x y) Initial program 22.6
Applied associate-/l*_binary641.8
Final simplification0.7
herbie shell --seed 2021291
(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))