\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathsf{fma}\left(\frac{y}{x + 1}, \frac{z}{t_1}, \frac{x - \frac{x}{t_1}}{x + 1}\right)
\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 (let* ((t_1 (- (* z t) x))) (fma (/ y (+ x 1.0)) (/ z t_1) (/ (- x (/ x t_1)) (+ 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 t_1 = (z * t) - x;
return fma((y / (x + 1.0)), (z / t_1), ((x - (x / t_1)) / (x + 1.0)));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 7.5 |
|---|---|
| Target | 0.3 |
| Herbie | 1.9 |
Initial program 7.5
Taylor expanded in y around 0 7.5
Simplified1.9
Final simplification1.9
herbie shell --seed 2021307
(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)))