\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{y}}{x}}\\
\mathbf{elif}\;x \cdot y \leq -2.929739868498803 \cdot 10^{-293}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{z}}{y}}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(if (<= (* x y) (- INFINITY))
(/ 1.0 (/ (/ z y) x))
(if (<= (* x y) -2.929739868498803e-293)
(/ (* x y) z)
(*
(/ (* (cbrt x) (cbrt x)) (* (cbrt z) (cbrt z)))
(/ (cbrt x) (/ (cbrt 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 = 1.0 / ((z / y) / x);
} else if ((x * y) <= -2.929739868498803e-293) {
tmp = (x * y) / z;
} else {
tmp = ((cbrt(x) * cbrt(x)) / (cbrt(z) * cbrt(z))) * (cbrt(x) / (cbrt(z) / y));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.5 |
|---|---|
| Target | 6.5 |
| Herbie | 1.6 |
if (*.f64 x y) < -inf.0Initial program 64.0
Applied associate-/l*_binary640.3
Applied clear-num_binary640.4
if -inf.0 < (*.f64 x y) < -2.9297398684988028e-293Initial program 0.2
Applied *-un-lft-identity_binary640.2
Applied times-frac_binary647.4
Simplified7.4
Taylor expanded in x around 0 0.2
if -2.9297398684988028e-293 < (*.f64 x y) Initial program 8.1
Applied associate-/l*_binary645.9
Applied *-un-lft-identity_binary645.9
Applied add-cube-cbrt_binary646.6
Applied times-frac_binary646.6
Applied add-cube-cbrt_binary646.8
Applied times-frac_binary642.6
Simplified2.6
Final simplification1.6
herbie shell --seed 2021275
(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))