\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;t \leq -5.150743828419859 \cdot 10^{+115} \lor \neg \left(t \leq -3.3018215432180023 \cdot 10^{-248}\right):\\
\;\;\;\;t \cdot \frac{x - y}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{z - y}\\
\frac{t \cdot x}{z - y} - \frac{y}{t_1 \cdot t_1} \cdot \frac{t}{t_1}
\end{array}\\
\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
:precision binary64
(if (or (<= t -5.150743828419859e+115) (not (<= t -3.3018215432180023e-248)))
(* t (/ (- x y) (- z y)))
(let* ((t_1 (cbrt (- z y))))
(- (/ (* t x) (- z y)) (* (/ y (* t_1 t_1)) (/ t t_1))))))double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.150743828419859e+115) || !(t <= -3.3018215432180023e-248)) {
tmp = t * ((x - y) / (z - y));
} else {
double t_1 = cbrt(z - y);
tmp = ((t * x) / (z - y)) - ((y / (t_1 * t_1)) * (t / t_1));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.2 |
| Herbie | 2.5 |
if t < -5.1507438284198586e115 or -3.30182154321800235e-248 < t Initial program 2.3
if -5.1507438284198586e115 < t < -3.30182154321800235e-248Initial program 2.0
Taylor expanded in x around 0 4.0
Applied add-cube-cbrt_binary644.5
Applied times-frac_binary642.9
Applied cancel-sign-sub-inv_binary642.9
Simplified2.9
Final simplification2.5
herbie shell --seed 2021280
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))