\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\begin{array}{l}
\mathbf{if}\;z \leq -5.624504260144903 \cdot 10^{-62}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{9 \cdot \left(y \cdot x\right) + b}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 2.2481237932582964 \cdot 10^{-19}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t \cdot -4, \frac{\mathsf{fma}\left(9, y \cdot x, b\right)}{z}\right)}{c}\\
\end{array}
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -5.624504260144903e-62)
(/ (fma t (* a -4.0) (/ (+ (* 9.0 (* y x)) b) z)) c)
(if (<= z 2.2481237932582964e-19)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))
(/ (fma a (* t -4.0) (/ (fma 9.0 (* y x) b) z)) c))))double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -5.624504260144903e-62) {
tmp = fma(t, (a * -4.0), (((9.0 * (y * x)) + b) / z)) / c;
} else if (z <= 2.2481237932582964e-19) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = fma(a, (t * -4.0), (fma(9.0, (y * x), b) / z)) / c;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b




Bits error versus c
| Original | 20.5 |
|---|---|
| Target | 14.3 |
| Herbie | 8.2 |
if z < -5.62450426014490289e-62Initial program 26.4
Simplified9.2
Applied frac-2neg_binary649.2
Simplified9.2
Taylor expanded in z around 0 9.2
if -5.62450426014490289e-62 < z < 2.24812379325829636e-19Initial program 5.8
if 2.24812379325829636e-19 < z Initial program 28.4
Simplified9.4
Applied *-un-lft-identity_binary649.4
Applied *-un-lft-identity_binary649.4
Applied times-frac_binary649.4
Simplified9.4
Simplified9.4
Final simplification8.2
herbie shell --seed 2022077
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))