\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}
t_1 := 4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;z \leq -13120955.299355708:\\
\;\;\;\;\frac{\mathsf{fma}\left(9, y \cdot \frac{x}{z}, \frac{b}{z}\right) - t_1}{c}\\
\mathbf{elif}\;z \leq 4.429411479627045 \cdot 10^{-26}:\\
\;\;\;\;\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(9, \frac{y}{\frac{z}{x}}, \frac{b}{z}\right) - t_1}{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
(let* ((t_1 (* 4.0 (* a t))))
(if (<= z -13120955.299355708)
(/ (- (fma 9.0 (* y (/ x z)) (/ b z)) t_1) c)
(if (<= z 4.429411479627045e-26)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))
(/ (- (fma 9.0 (/ y (/ z x)) (/ b z)) t_1) 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 t_1 = 4.0 * (a * t);
double tmp;
if (z <= -13120955.299355708) {
tmp = (fma(9.0, (y * (x / z)), (b / z)) - t_1) / c;
} else if (z <= 4.429411479627045e-26) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (fma(9.0, (y / (z / x)), (b / z)) - t_1) / 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.0 |
|---|---|
| Target | 14.2 |
| Herbie | 6.0 |
if z < -13120955.299355708Initial program 29.8
Simplified8.7
Applied clear-num_binary648.9
Taylor expanded in c around 0 8.5
Simplified8.5
Applied *-un-lft-identity_binary648.5
Applied times-frac_binary645.5
Simplified5.5
if -13120955.299355708 < z < 4.42941147962704476e-26Initial program 6.5
if 4.42941147962704476e-26 < z Initial program 26.9
Simplified8.7
Applied clear-num_binary649.0
Taylor expanded in c around 0 8.5
Simplified8.5
Applied associate-/l*_binary645.9
Final simplification6.0
herbie shell --seed 2022081
(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)))