\frac{x \cdot y}{z}
\begin{array}{l}
t_0 := \frac{x \cdot y}{z}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{\sqrt[3]{z}}\\
\frac{\frac{y}{\sqrt[3]{z}}}{t_1 \cdot t_1} \cdot \frac{\frac{x}{\sqrt[3]{z}}}{t_1}
\end{array}\\
\mathbf{elif}\;t_0 \leq 4.6360253909051757 \cdot 10^{+285}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* x y) z)))
(if (<= t_0 0.0)
(let* ((t_1 (cbrt (cbrt z))))
(* (/ (/ y (cbrt z)) (* t_1 t_1)) (/ (/ x (cbrt z)) t_1)))
(if (<= t_0 4.6360253909051757e+285) t_0 (/ y (/ z x))))))double code(double x, double y, double z) {
return (x * y) / z;
}
double code(double x, double y, double z) {
double t_0 = (x * y) / z;
double tmp;
if (t_0 <= 0.0) {
double t_1_1 = cbrt(cbrt(z));
tmp = ((y / cbrt(z)) / (t_1_1 * t_1_1)) * ((x / cbrt(z)) / t_1_1);
} else if (t_0 <= 4.6360253909051757e+285) {
tmp = t_0;
} else {
tmp = y / (z / x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.1 |
|---|---|
| Target | 6.1 |
| Herbie | 3.2 |
if (/.f64 (*.f64 x y) z) < 0.0Initial program 7.0
rmApplied add-cube-cbrt_binary647.7
Applied associate-/r*_binary647.7
Simplified5.1
rmApplied *-un-lft-identity_binary645.1
Applied times-frac_binary645.1
Applied associate-*r*_binary644.4
Simplified4.4
rmApplied add-cube-cbrt_binary644.6
Applied times-frac_binary644.7
if 0.0 < (/.f64 (*.f64 x y) z) < 4.63602539090517566e285Initial program 0.5
if 4.63602539090517566e285 < (/.f64 (*.f64 x y) z) Initial program 47.9
rmApplied add-cube-cbrt_binary6448.2
Applied associate-/r*_binary6448.2
Simplified15.6
rmApplied associate-/l*_binary644.9
Simplified3.8
Final simplification3.2
herbie shell --seed 2021198
(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))