\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\begin{array}{l}
t_1 := b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;b \leq -2.0887889302975253 \cdot 10^{+26}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + t_1\\
\mathbf{elif}\;b \leq 8.306771119277255 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \mathsf{fma}\left(z, y, \mathsf{fma}\left(a, t, 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
(let* ((t_1 (* b (* z a))))
(if (<= b -2.0887889302975253e+26)
(+ (+ (+ x (* y z)) (* t a)) t_1)
(if (<= b 8.306771119277255e-64)
(fma a t (fma z (fma a b y) x))
(+ t_1 (fma z y (fma a 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 t_1 = b * (z * a);
double tmp;
if (b <= -2.0887889302975253e+26) {
tmp = ((x + (y * z)) + (t * a)) + t_1;
} else if (b <= 8.306771119277255e-64) {
tmp = fma(a, t, fma(z, fma(a, b, y), x));
} else {
tmp = t_1 + fma(z, y, fma(a, 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 | 2.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if b < -2.0887889302975253e26Initial program 0.4
if -2.0887889302975253e26 < b < 8.3067711192772547e-64Initial program 3.2
Taylor expanded in x around 0 0.1
Simplified0.0
if 8.3067711192772547e-64 < b Initial program 0.9
Taylor expanded in x around 0 0.9
Simplified0.9
Final simplification0.3
herbie shell --seed 2022020
(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)))