\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\begin{array}{l}
\mathbf{if}\;a \leq -5.4202676746054004 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(y, z, a \cdot \left(z \cdot b\right) + \left(a \cdot t + x\right)\right)\\
\mathbf{elif}\;a \leq 6.248196026292757 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x + z \cdot \mathsf{fma}\left(a, b, y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
(FPCore (x y z t a b)
:precision binary64
(if (<= a -5.4202676746054004e+26)
(fma y z (+ (* a (* z b)) (+ (* a t) x)))
(if (<= a 6.248196026292757e+70)
(fma a t (+ x (* z (fma a b y))))
(fma y z (fma a (fma z b t) x)))))double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.4202676746054004e+26) {
tmp = fma(y, z, ((a * (z * b)) + ((a * t) + x)));
} else if (a <= 6.248196026292757e+70) {
tmp = fma(a, t, (x + (z * fma(a, b, y))));
} else {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
}
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
| Original | 1.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if a < -5.4202676746054004e26Initial program 5.6
Simplified0.1
Taylor expanded in a around 0 0.1
if -5.4202676746054004e26 < a < 6.2481960262927567e70Initial program 0.4
Simplified3.2
Taylor expanded in y around 0 3.2
Simplified0.2
Applied fma-udef_binary640.2
if 6.2481960262927567e70 < a Initial program 5.8
Simplified0.1
Applied *-un-lft-identity_binary640.1
Final simplification0.2
herbie shell --seed 2021280
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))