\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 3.558758878955456 \cdot 10^{+281}:\\
\;\;\;\;\frac{x + \left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\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 (<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
3.558758878955456e+281)
(/ (+ x (- (/ (* y z) (- (* z t) x)) (/ x (- (* z t) x)))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0))))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 (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= 3.558758878955456e+281) {
tmp = (x + (((y * z) / ((z * t) - x)) - (x / ((z * t) - x)))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 3.5 |
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 3.55875887895545603e281Initial program 3.0
rmApplied div-sub_binary64_113363.0
Simplified3.0
Simplified3.0
if 3.55875887895545603e281 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 61.9
Taylor expanded around inf 9.5
Final simplification3.5
herbie shell --seed 2020354
(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)))