\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}\;y \leq -7.523003478271457 \cdot 10^{+37}:\\
\;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{1}{c \cdot \frac{z}{x}}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\right)\\
\mathbf{elif}\;y \leq -5.1063607684978005 \cdot 10^{-132}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b + x \cdot \left(y \cdot 9\right)}{z} - 4 \cdot \left(t \cdot a\right)}}\\
\mathbf{elif}\;y \leq -5.711430602583932 \cdot 10^{-156}:\\
\;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(\frac{t}{\sqrt{c}} \cdot \frac{a}{\sqrt{c}}\right)\right)\\
\mathbf{elif}\;y \leq 2.4324523154551576 \cdot 10^{-305}:\\
\;\;\;\;\frac{b + x \cdot \left(y \cdot 9\right)}{z \cdot c} - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;y \leq 19491748.527885776:\\
\;\;\;\;\frac{\left(b + x \cdot \left(y \cdot 9\right)\right) \cdot \frac{1}{z} - 4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(\frac{t}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{a}{\sqrt[3]{c}}\right)\right)\\
\end{array}double code(double x, double y, double z, double t, double a, double b, double c) {
return (((double) (((double) (((double) (((double) (x * 9.0)) * y)) - ((double) (((double) (((double) (z * 4.0)) * t)) * a)))) + b)) / ((double) (z * c)));
}
double code(double x, double y, double z, double t, double a, double b, double c) {
double VAR;
if ((y <= -7.523003478271457e+37)) {
VAR = ((double) ((b / ((double) (z * c))) + ((double) (((double) (9.0 * ((double) (y * (1.0 / ((double) (c * (z / x)))))))) - ((double) (4.0 * ((double) (t * (a / c)))))))));
} else {
double VAR_1;
if ((y <= -5.1063607684978005e-132)) {
VAR_1 = (1.0 / (c / ((double) ((((double) (b + ((double) (x * ((double) (y * 9.0)))))) / z) - ((double) (4.0 * ((double) (t * a))))))));
} else {
double VAR_2;
if ((y <= -5.711430602583932e-156)) {
VAR_2 = ((double) ((b / ((double) (z * c))) + ((double) (((double) (9.0 * ((double) (y * (x / ((double) (z * c))))))) - ((double) (4.0 * ((double) ((t / ((double) sqrt(c))) * (a / ((double) sqrt(c)))))))))));
} else {
double VAR_3;
if ((y <= 2.4324523154551576e-305)) {
VAR_3 = ((double) ((((double) (b + ((double) (x * ((double) (y * 9.0)))))) / ((double) (z * c))) - ((double) (4.0 * ((double) (t * (a / c)))))));
} else {
double VAR_4;
if ((y <= 19491748.527885776)) {
VAR_4 = (((double) (((double) (((double) (b + ((double) (x * ((double) (y * 9.0)))))) * (1.0 / z))) - ((double) (4.0 * ((double) (t * a)))))) / c);
} else {
VAR_4 = ((double) ((b / ((double) (z * c))) + ((double) (((double) (9.0 * ((double) (y * (x / ((double) (z * c))))))) - ((double) (4.0 * ((double) ((t / ((double) (((double) cbrt(c)) * ((double) cbrt(c))))) * (a / ((double) cbrt(c)))))))))));
}
VAR_3 = VAR_4;
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




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
Results
| Original | 20.5 |
|---|---|
| Target | 14.7 |
| Herbie | 9.7 |
if y < -7.52300347827145674e37Initial program Error: 26.3 bits
SimplifiedError: 21.5 bits
Taylor expanded around 0 Error: 19.3 bits
SimplifiedError: 11.9 bits
rmApplied clear-numError: 12.0 bits
SimplifiedError: 10.2 bits
if -7.52300347827145674e37 < y < -5.1063607684978005e-132Initial program Error: 16.4 bits
SimplifiedError: 9.6 bits
rmApplied clear-numError: 9.7 bits
if -5.1063607684978005e-132 < y < -5.71143060258393205e-156Initial program Error: 18.7 bits
SimplifiedError: 8.4 bits
Taylor expanded around 0 Error: 8.3 bits
SimplifiedError: 10.2 bits
rmApplied add-sqr-sqrtError: 37.7 bits
Applied *-un-lft-identityError: 37.7 bits
Applied times-fracError: 37.7 bits
Applied associate-*r*Error: 37.0 bits
SimplifiedError: 37.0 bits
if -5.71143060258393205e-156 < y < 2.4324523154551576e-305Initial program Error: 16.4 bits
SimplifiedError: 7.4 bits
rmApplied div-subError: 7.4 bits
SimplifiedError: 7.2 bits
SimplifiedError: 7.4 bits
if 2.4324523154551576e-305 < y < 19491748.527885776Initial program Error: 17.2 bits
SimplifiedError: 8.2 bits
rmApplied div-invError: 8.3 bits
if 19491748.527885776 < y Initial program Error: 24.8 bits
SimplifiedError: 21.5 bits
Taylor expanded around 0 Error: 18.2 bits
SimplifiedError: 10.2 bits
rmApplied add-cube-cbrtError: 10.5 bits
Applied *-un-lft-identityError: 10.5 bits
Applied times-fracError: 10.5 bits
Applied associate-*r*Error: 9.5 bits
SimplifiedError: 9.5 bits
Final simplificationError: 9.7 bits
herbie shell --seed 2020200
(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.1001567408041051e-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)))