Math FPCore C Julia Wolfram TeX \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\]
↓
\[\mathsf{fma}\left(x, y, \mathsf{fma}\left(t, \frac{z}{16}, c - a \cdot \frac{b}{4}\right)\right)
\]
(FPCore (x y z t a b c)
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c)) ↓
(FPCore (x y z t a b c)
:precision binary64
(fma x y (fma t (/ z 16.0) (- c (* a (/ b 4.0)))))) double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
↓
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(t, (z / 16.0), (c - (a * (b / 4.0)))));
}
function code(x, y, z, t, a, b, c)
return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
↓
function code(x, y, z, t, a, b, c)
return fma(x, y, fma(t, Float64(z / 16.0), Float64(c - Float64(a * Float64(b / 4.0)))))
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(t * N[(z / 16.0), $MachinePrecision] + N[(c - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
↓
\mathsf{fma}\left(x, y, \mathsf{fma}\left(t, \frac{z}{16}, c - a \cdot \frac{b}{4}\right)\right)
Alternatives Alternative 1 Accuracy 66.1% Cost 3304
\[\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
t_2 := t_1 + \left(a \cdot b\right) \cdot -0.25\\
t_3 := c + t_1\\
t_4 := c + a \cdot \left(b \cdot -0.25\right)\\
t_5 := c + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+87}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-72}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-138}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-317}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 0:\\
\;\;\;\;t_1 + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-198}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{-34}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 10^{+62}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+129}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\]
Alternative 2 Accuracy 67.0% Cost 2268
\[\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
t_2 := c + t_1\\
t_3 := c + a \cdot \left(b \cdot -0.25\right)\\
t_4 := c + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+87}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-138}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-317}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 0:\\
\;\;\;\;t_1 + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-198}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 10^{+62}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
Alternative 3 Accuracy 62.8% Cost 2140
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
t_3 := c + \left(t \cdot z\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -2.4 \cdot 10^{+170}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -2.9 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{+87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -6 \cdot 10^{-74}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -4.9 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 2.75 \cdot 10^{-198}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 4 Accuracy 67.8% Cost 1748
\[\begin{array}{l}
t_1 := c + \left(t \cdot z\right) \cdot 0.0625\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-138}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 10^{+62}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 5 Accuracy 43.6% Cost 1640
\[\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;c \leq -6 \cdot 10^{+67}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq -5 \cdot 10^{-150}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -8.5 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 5.8 \cdot 10^{-273}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{-242}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{-198}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \leq 3.8 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 5.4 \cdot 10^{-34}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \leq 1.25 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 9 \cdot 10^{+120}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\]
Alternative 6 Accuracy 66.1% Cost 1632
\[\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
t_2 := c + t_1\\
t_3 := t_1 + x \cdot y\\
t_4 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;c \leq -4.2 \cdot 10^{+117}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;c \leq -0.0001:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -4.5 \cdot 10^{-95}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;c \leq -8 \cdot 10^{-151}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{-270}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{-273}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{-12}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;c \leq 1.5 \cdot 10^{+120}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 7 Accuracy 62.1% Cost 1620
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -2.2 \cdot 10^{+172}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -4.8 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -4.4 \cdot 10^{+86}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -1.2 \cdot 10^{+55}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 8 Accuracy 86.5% Cost 1484
\[\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
t_2 := t_1 + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+172}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 10^{+62}:\\
\;\;\;\;c + \left(t_1 + x \cdot y\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+129}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\]
Alternative 9 Accuracy 89.4% Cost 1484
\[\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
t_2 := \left(t \cdot z\right) \cdot 0.0625\\
t_3 := \left(c + x \cdot y\right) + t_1\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+87}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 10^{+62}:\\
\;\;\;\;c + \left(t_2 + x \cdot y\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+129}:\\
\;\;\;\;t_2 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
Alternative 10 Accuracy 91.2% Cost 1353
\[\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+87} \lor \neg \left(a \cdot b \leq 10^{+62}\right):\\
\;\;\;\;c + \left(t_1 + \left(a \cdot b\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(t_1 + x \cdot y\right)\\
\end{array}
\]
Alternative 11 Accuracy 43.9% Cost 1112
\[\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;c \leq -1.05 \cdot 10^{+69}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq -2.4 \cdot 10^{-179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -3.2 \cdot 10^{-238}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \leq 1.1 \cdot 10^{-233}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 0.00055:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \leq 1.8 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\]
Alternative 12 Accuracy 99.9% Cost 1088
\[c + \left(\left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\right)
\]
Alternative 13 Accuracy 43.9% Cost 456
\[\begin{array}{l}
\mathbf{if}\;c \leq -1.1 \cdot 10^{+70}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 9 \cdot 10^{+120}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\]
Alternative 14 Accuracy 31.5% Cost 64
\[c
\]