\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \leq -9.286020151799416 \cdot 10^{-232}:\\
\;\;\;\;t + \left(\frac{x}{y} \cdot z - \frac{x}{y} \cdot t\right)\\
\mathbf{elif}\;y \leq 6.75286678036613 \cdot 10^{-142}:\\
\;\;\;\;t + \left(\frac{x \cdot z}{y} - \frac{x \cdot t}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{z - t}{\sqrt[3]{y}}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
(FPCore (x y z t)
:precision binary64
(if (<= y -9.286020151799416e-232)
(+ t (- (* (/ x y) z) (* (/ x y) t)))
(if (<= y 6.75286678036613e-142)
(+ t (- (/ (* x z) y) (/ (* x t) y)))
(+ t (* (/ x (* (cbrt y) (cbrt y))) (/ (- z t) (cbrt y)))))))double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.286020151799416e-232) {
tmp = t + (((x / y) * z) - ((x / y) * t));
} else if (y <= 6.75286678036613e-142) {
tmp = t + (((x * z) / y) - ((x * t) / y));
} else {
tmp = t + ((x / (cbrt(y) * cbrt(y))) * ((z - t) / cbrt(y)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 2.1 |
| Herbie | 1.9 |
if y < -9.286020151799416e-232Initial program 1.7
rmApplied sub-neg_binary64_138321.7
Applied distribute-rgt-in_binary64_137891.7
Simplified1.7
Simplified1.7
if -9.286020151799416e-232 < y < 6.75286678036612954e-142Initial program 5.7
rmApplied *-un-lft-identity_binary64_138395.7
Applied add-cube-cbrt_binary64_138746.6
Applied times-frac_binary64_138456.6
Applied associate-*l*_binary64_1378021.9
Simplified21.9
Taylor expanded around 0 2.9
Simplified2.9
if 6.75286678036612954e-142 < y Initial program 1.1
rmApplied div-inv_binary64_138361.1
Applied associate-*l*_binary64_137803.7
Simplified3.7
rmApplied add-cube-cbrt_binary64_138744.1
Applied *-un-lft-identity_binary64_138394.1
Applied times-frac_binary64_138454.1
Applied associate-*r*_binary64_137791.9
Simplified1.9
Final simplification1.9
herbie shell --seed 2020289
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))