\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 -\infty:\\
\;\;\;\;1 + \frac{z}{x + 1} \cdot \left(\frac{t}{x} - \frac{y}{x}\right)\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 8.7209616902523 \cdot 10^{+264}:\\
\;\;\;\;\frac{x + \left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + \frac{y}{t}\right) - \frac{x}{z \cdot 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)) (- INFINITY))
(+ 1.0 (* (/ z (+ x 1.0)) (- (/ t x) (/ y x))))
(if (<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
8.7209616902523e+264)
(/ (+ x (- (/ (* y z) (- (* z t) x)) (/ x (- (* z t) x)))) (+ x 1.0))
(/ (- (+ x (/ y t)) (/ x (* z 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)) <= -((double) INFINITY)) {
tmp = 1.0 + ((z / (x + 1.0)) * ((t / x) - (y / x)));
} else if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= 8.7209616902523e+264) {
tmp = (x + (((y * z) / ((z * t) - x)) - (x / ((z * t) - x)))) / (x + 1.0);
} else {
tmp = ((x + (y / t)) - (x / (z * 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.5 |
|---|---|
| Target | 0.3 |
| Herbie | 2.5 |
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -inf.0Initial program 64.0
Taylor expanded around 0 64.0
Simplified38.0
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 8.72096169025229998e264Initial program 0.6
rmApplied div-sub_binary64_188380.6
if 8.72096169025229998e264 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 60.2
Taylor expanded around inf 9.3
Simplified9.3
Final simplification2.5
herbie shell --seed 2021043
(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)))