Math FPCore C Julia Wolfram TeX \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\]
↓
\[\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot \left(t \cdot 0.0625\right)\right)\\
\end{array}
\]
(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
(let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* b a) 4.0))))
(if (<= t_1 INFINITY) (+ c t_1) (fma y x (* z (* t 0.0625)))))) 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) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = fma(y, x, (z * (t * 0.0625)));
}
return tmp;
}
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)
t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0))
tmp = 0.0
if (t_1 <= Inf)
tmp = Float64(c + t_1);
else
tmp = fma(y, x, Float64(z * Float64(t * 0.0625)));
end
return tmp
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_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(y * x + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
↓
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot \left(t \cdot 0.0625\right)\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 98.9% Cost 7876
\[\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, z \cdot \left(t \cdot 0.0625\right)\right)\\
\end{array}
\]
Alternative 2 Accuracy 98.8% Cost 19904
\[\mathsf{fma}\left(x, y, \mathsf{fma}\left(b, -0.25 \cdot a, \mathsf{fma}\left(z, \frac{t}{16}, c\right)\right)\right)
\]
Alternative 3 Accuracy 98.9% Cost 13632
\[\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\]
Alternative 4 Accuracy 98.1% Cost 7360
\[\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\]
Alternative 5 Accuracy 44.4% Cost 2660
\[\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
t_2 := -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;b \cdot a \leq -5.5 \cdot 10^{+79}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -520000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -3.7 \cdot 10^{-50}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \cdot a \leq -9.6 \cdot 10^{-104}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \cdot a \leq -2.1 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 1.7 \cdot 10^{-189}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 9.5 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 2.1 \cdot 10^{-94}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \cdot a \leq 2.2 \cdot 10^{+28}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 6 Accuracy 62.8% Cost 2140
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := -0.25 \cdot \left(b \cdot a\right)\\
t_3 := c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;b \cdot a \leq -1.66 \cdot 10^{+214}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -1.8 \cdot 10^{+174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -2.6 \cdot 10^{+80}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -3 \cdot 10^{+16}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot a \leq -3.4 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -3.2 \cdot 10^{-192}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot a \leq 1.95 \cdot 10^{+202}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 7 Accuracy 68.3% Cost 2136
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := x \cdot y + t_2\\
t_4 := x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+80}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{+18}:\\
\;\;\;\;c + t_2\\
\mathbf{elif}\;b \cdot a \leq -5 \cdot 10^{-103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{-140}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{+22}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\]
Alternative 8 Accuracy 85.5% Cost 1876
\[\begin{array}{l}
t_1 := c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
t_2 := x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+225}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+118}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+185}:\\
\;\;\;\;c + b \cdot \left(-0.25 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 9 Accuracy 85.2% Cost 1876
\[\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
t_2 := x \cdot y - t_1\\
t_3 := 0.0625 \cdot \left(z \cdot t\right)\\
t_4 := c + \left(x \cdot y + t_3\right)\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+225}:\\
\;\;\;\;t_3 - t_1\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{+22}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+118}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{+154}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+185}:\\
\;\;\;\;c + b \cdot \left(-0.25 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 10 Accuracy 65.6% Cost 1748
\[\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := c + b \cdot \left(-0.25 \cdot a\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+90}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -4 \cdot 10^{-50}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot a \leq -4 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 10^{+26}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 11 Accuracy 88.3% Cost 1746
\[\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+108} \lor \neg \left(b \cdot a \leq -2 \cdot 10^{+18} \lor \neg \left(b \cdot a \leq -2 \cdot 10^{-81}\right) \land b \cdot a \leq 50000000000000\right):\\
\;\;\;\;x \cdot y + \left(c - \frac{a}{\frac{4}{b}}\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 12 Accuracy 88.3% Cost 1746
\[\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+108} \lor \neg \left(b \cdot a \leq -2 \cdot 10^{+18} \lor \neg \left(b \cdot a \leq -2 \cdot 10^{-81}\right) \land b \cdot a \leq 50000000000000\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 13 Accuracy 62.1% Cost 1360
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;b \cdot a \leq -1.55 \cdot 10^{+214}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -2.8 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -8 \cdot 10^{-190}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;b \cdot a \leq 5.8 \cdot 10^{+200}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 14 Accuracy 60.6% Cost 1236
\[\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := c + b \cdot \left(-0.25 \cdot a\right)\\
t_3 := x \cdot y + t_1\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.75 \cdot 10^{-28}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \leq -3.8 \cdot 10^{-166}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq -4.9 \cdot 10^{-233}:\\
\;\;\;\;c + t_1\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-107}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 15 Accuracy 37.1% Cost 1113
\[\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;t \leq -3.15 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-95}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 7500:\\
\;\;\;\;c\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+35} \lor \neg \left(t \leq 2.7 \cdot 10^{+58}\right) \land t \leq 7.2 \cdot 10^{+171}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 16 Accuracy 97.8% Cost 1088
\[c + \left(\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\right)
\]
Alternative 17 Accuracy 37.5% Cost 456
\[\begin{array}{l}
\mathbf{if}\;c \leq -3.7 \cdot 10^{+127}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 8.2 \cdot 10^{+65}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\]
Alternative 18 Accuracy 22.6% Cost 64
\[c
\]