2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\begin{array}{l}
\mathbf{if}\;c \leq -8.239592311601601 \cdot 10^{+58} \lor \neg \left(c \leq 1063779.5953460033\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right) + i \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\right)\\
\end{array}double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((double) (2.0 * ((double) (((double) (((double) (x * y)) + ((double) (z * t)))) - ((double) (((double) (((double) (a + ((double) (b * c)))) * c)) * i))))));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double VAR;
if (((c <= -8.239592311601601e+58) || !(c <= 1063779.5953460033))) {
VAR = ((double) (2.0 * ((double) (((double) (x * y)) + ((double) (((double) (z * t)) - ((double) (c * ((double) (((double) (c * ((double) (b * i)))) + ((double) (i * a))))))))))));
} else {
VAR = ((double) (2.0 * ((double) (((double) (((double) (x * y)) + ((double) (z * t)))) - ((double) (i * ((double) (c * ((double) (a + ((double) (c * b))))))))))));
}
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




Bits error versus i
Results
| Original | 6.6 |
|---|---|
| Target | 1.7 |
| Herbie | 1.2 |
if c < -8.2395923116016015e58 or 1063779.5953460033 < c Initial program Error: 23.4 bits
SimplifiedError: 3.5 bits
rmApplied add-cube-cbrtError: 4.1 bits
Applied associate-*l*Error: 4.1 bits
SimplifiedError: 4.1 bits
rmApplied associate-*r*Error: 14.6 bits
SimplifiedError: 14.6 bits
Taylor expanded around inf Error: 29.9 bits
SimplifiedError: 2.7 bits
if -8.2395923116016015e58 < c < 1063779.5953460033Initial program Error: 0.7 bits
Final simplificationError: 1.2 bits
herbie shell --seed 2020200
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))