x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t_1\\
t_3 := \mathsf{fma}\left(y - z, t_1, x\right)\\
\mathbf{if}\;t_2 \leq -1.650857283112171 \cdot 10^{-274}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\left(\frac{x \cdot y}{z} + \left(t + \frac{t \cdot a}{z}\right)\right) - \left(\frac{y \cdot t}{z} + \frac{x \cdot a}{z}\right)\\
\mathbf{elif}\;t_2 \leq 4.122632137532037 \cdot 10^{-67} \lor \neg \left(t_2 \leq 1.6527103431256226 \cdot 10^{+305}\right):\\
\;\;\;\;\left(\frac{x \cdot z}{a - z} + \left(x + \frac{y \cdot t}{a - z}\right)\right) - \left(\frac{1}{\frac{a - z}{x \cdot y}} + \frac{z \cdot t}{a - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) (- a z)))
(t_2 (+ x (* (- y z) t_1)))
(t_3 (fma (- y z) t_1 x)))
(if (<= t_2 -1.650857283112171e-274)
t_3
(if (<= t_2 0.0)
(-
(+ (/ (* x y) z) (+ t (/ (* t a) z)))
(+ (/ (* y t) z) (/ (* x a) z)))
(if (or (<= t_2 4.122632137532037e-67)
(not (<= t_2 1.6527103431256226e+305)))
(-
(+ (/ (* x z) (- a z)) (+ x (/ (* y t) (- a z))))
(+ (/ 1.0 (/ (- a z) (* x y))) (/ (* z t) (- a z))))
t_3)))))double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / (a - z);
double t_2 = x + ((y - z) * t_1);
double t_3 = fma((y - z), t_1, x);
double tmp;
if (t_2 <= -1.650857283112171e-274) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = (((x * y) / z) + (t + ((t * a) / z))) - (((y * t) / z) + ((x * a) / z));
} else if ((t_2 <= 4.122632137532037e-67) || !(t_2 <= 1.6527103431256226e+305)) {
tmp = (((x * z) / (a - z)) + (x + ((y * t) / (a - z)))) - ((1.0 / ((a - z) / (x * y))) + ((z * t) / (a - z)));
} else {
tmp = t_3;
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z



Bits error versus t



Bits error versus a
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.650857283112171e-274 or 4.1226321375320367e-67 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.65271034312562259e305Initial program 5.1
Simplified5.1
Applied add-cube-cbrt_binary646.1
Applied pow1/3_binary6438.7
Applied pow1/3_binary6439.1
Applied pow1/3_binary6439.4
Applied pow-sqr_binary6439.4
Applied pow-prod-up_binary645.1
if -1.650857283112171e-274 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 60.2
Simplified60.0
Taylor expanded in z around inf 12.4
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.1226321375320367e-67 or 1.65271034312562259e305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 25.1
Simplified25.0
Taylor expanded in y around 0 3.1
Applied clear-num_binary643.1
Final simplification5.9
herbie shell --seed 2022068
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))