\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\begin{array}{l}
\mathbf{if}\;t \leq -2.0677804913452024 \cdot 10^{+84}:\\
\;\;\;\;\begin{array}{l}
t_1 := t \cdot \left(x + 1\right)\\
\left(\frac{x}{x + 1} + \frac{y}{t_1}\right) - \frac{x}{t_1 \cdot z}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \frac{y}{x + 1}\\
t_3 := t \cdot z - x\\
t_4 := \frac{x - \frac{x}{t_3}}{x + 1}\\
\mathbf{if}\;t \leq 3.633970818777441 \cdot 10^{+41}:\\
\;\;\;\;t_2 \cdot \frac{z}{t_3} + t_4\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_2, \frac{1}{t}, t_4\right)\\
\end{array}\\
\end{array}
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
(FPCore (x y z t)
:precision binary64
(if (<= t -2.0677804913452024e+84)
(let* ((t_1 (* t (+ x 1.0))))
(- (+ (/ x (+ x 1.0)) (/ y t_1)) (/ x (* t_1 z))))
(let* ((t_2 (/ y (+ x 1.0)))
(t_3 (- (* t z) x))
(t_4 (/ (- x (/ x t_3)) (+ x 1.0))))
(if (<= t 3.633970818777441e+41)
(+ (* t_2 (/ z t_3)) t_4)
(fma t_2 (/ 1.0 t) t_4)))))double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.0677804913452024e+84) {
double t_1_1 = t * (x + 1.0);
tmp = ((x / (x + 1.0)) + (y / t_1_1)) - (x / (t_1_1 * z));
} else {
double t_2 = y / (x + 1.0);
double t_3 = (t * z) - x;
double t_4 = (x - (x / t_3)) / (x + 1.0);
double tmp_2;
if (t <= 3.633970818777441e+41) {
tmp_2 = (t_2 * (z / t_3)) + t_4;
} else {
tmp_2 = fma(t_2, (1.0 / t), t_4);
}
tmp = tmp_2;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 7.2 |
|---|---|
| Target | 0.3 |
| Herbie | 1.5 |
if t < -2.06778049134520244e84Initial program 9.0
Taylor expanded in y around 0 9.0
Simplified4.5
Taylor expanded in t around inf 8.0
Simplified4.8
if -2.06778049134520244e84 < t < 3.6339708187774408e41Initial program 5.9
Taylor expanded in y around 0 5.9
Simplified0.3
Applied fma-udef_binary640.3
if 3.6339708187774408e41 < t Initial program 8.9
Taylor expanded in y around 0 8.9
Simplified4.4
Taylor expanded in z around inf 1.7
Final simplification1.5
herbie shell --seed 2021329
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))