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}
t_1 := \mathsf{fma}\left(x, y, z \cdot t\right)\\
\mathbf{if}\;i \leq -5.383784074544764 \cdot 10^{+53} \lor \neg \left(i \leq 1.0975431556761 \cdot 10^{+60}\right):\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma x y (* z t))))
(if (or (<= i -5.383784074544764e+53) (not (<= i 1.0975431556761e+60)))
(* 2.0 (- t_1 (* i (* c (fma b c a)))))
(* 2.0 (- t_1 (* c (* i (+ a (* c b)))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(x, y, (z * t));
double tmp;
if ((i <= -5.383784074544764e+53) || !(i <= 1.0975431556761e+60)) {
tmp = 2.0 * (t_1 - (i * (c * fma(b, c, a))));
} else {
tmp = 2.0 * (t_1 - (c * (i * (a + (c * b)))));
}
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




Bits error versus i
| Original | 6.4 |
|---|---|
| Target | 1.8 |
| Herbie | 1.5 |
if i < -5.38378407454476375e53 or 1.0975431556761e60 < i Initial program 0.8
Simplified0.7
Applied cancel-sign-sub-inv_binary640.7
if -5.38378407454476375e53 < i < 1.0975431556761e60Initial program 8.8
Simplified8.8
Taylor expanded in i around inf 1.9
Final simplification1.5
herbie shell --seed 2021329
(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))))