\[ \begin{array}{c}[z, t] = \mathsf{sort}([z, t])\\ \end{array} \]
Math FPCore C Julia Wolfram TeX \[\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+147} \lor \neg \left(z \cdot t \leq 5000000000\right):\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \mathsf{fma}\left(\cos \left(t \cdot \frac{z}{-3}\right), \cos y, \sin y \cdot \sin \left(\left(z \cdot t\right) \cdot 0.3333333333333333\right)\right)\right) - \frac{a}{b \cdot 3}\\
\end{array}
\]
(FPCore (x y z t a b)
:precision binary64
(- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0)))) ↓
(FPCore (x y z t a b)
:precision binary64
(if (or (<= (* z t) -2e+147) (not (<= (* z t) 5000000000.0)))
(fma 2.0 (sqrt x) (/ (/ a -3.0) b))
(-
(*
2.0
(*
(sqrt x)
(fma
(cos (* t (/ z -3.0)))
(cos y)
(* (sin y) (sin (* (* z t) 0.3333333333333333))))))
(/ a (* b 3.0))))) double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0));
}
↓
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((z * t) <= -2e+147) || !((z * t) <= 5000000000.0)) {
tmp = fma(2.0, sqrt(x), ((a / -3.0) / b));
} else {
tmp = (2.0 * (sqrt(x) * fma(cos((t * (z / -3.0))), cos(y), (sin(y) * sin(((z * t) * 0.3333333333333333)))))) - (a / (b * 3.0));
}
return tmp;
}
function code(x, y, z, t, a, b)
return Float64(Float64(Float64(2.0 * sqrt(x)) * cos(Float64(y - Float64(Float64(z * t) / 3.0)))) - Float64(a / Float64(b * 3.0)))
end
↓
function code(x, y, z, t, a, b)
tmp = 0.0
if ((Float64(z * t) <= -2e+147) || !(Float64(z * t) <= 5000000000.0))
tmp = fma(2.0, sqrt(x), Float64(Float64(a / -3.0) / b));
else
tmp = Float64(Float64(2.0 * Float64(sqrt(x) * fma(cos(Float64(t * Float64(z / -3.0))), cos(y), Float64(sin(y) * sin(Float64(Float64(z * t) * 0.3333333333333333)))))) - Float64(a / Float64(b * 3.0)));
end
return tmp
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -2e+147], N[Not[LessEqual[N[(z * t), $MachinePrecision], 5000000000.0]], $MachinePrecision]], N[(2.0 * N[Sqrt[x], $MachinePrecision] + N[(N[(a / -3.0), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(N[Cos[N[(t * N[(z / -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * N[Sin[N[(N[(z * t), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3}
↓
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+147} \lor \neg \left(z \cdot t \leq 5000000000\right):\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \mathsf{fma}\left(\cos \left(t \cdot \frac{z}{-3}\right), \cos y, \sin y \cdot \sin \left(\left(z \cdot t\right) \cdot 0.3333333333333333\right)\right)\right) - \frac{a}{b \cdot 3}\\
\end{array}
Alternatives Alternative 1 Error 15.7 Cost 34121
\[\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+147} \lor \neg \left(z \cdot t \leq 5000000000\right):\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(t \cdot \frac{z}{3}\right) - \sin y \cdot \sin \left(t \cdot \left(z \cdot -0.3333333333333333\right)\right)\right) - \frac{a}{b \cdot 3}\\
\end{array}
\]
Alternative 2 Error 15.7 Cost 34120
\[\begin{array}{l}
t_1 := z \cdot \left(t \cdot -0.3333333333333333\right)\\
t_2 := \frac{a}{b \cdot 3}\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+222}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot \sqrt{x \cdot {\cos y}^{2}}\right)\right) - t_2\\
\mathbf{elif}\;z \cdot t \leq 5000000000:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos t_1 - \sin y \cdot \sin t_1\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\end{array}
\]
Alternative 3 Error 16.1 Cost 33800
\[\begin{array}{l}
t_1 := \frac{a}{b \cdot 3}\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+240}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot \sqrt{x \cdot {\cos y}^{2}}\right)\right) - t_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+177}:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{\sqrt[3]{t}}{\frac{3}{z}} \cdot {\left(\sqrt[3]{t}\right)}^{2}\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, {\left(\sqrt[3]{\sqrt{x} \cdot \cos y}\right)}^{3}, \frac{\frac{a}{-3}}{b}\right)\\
\end{array}
\]
Alternative 4 Error 16.2 Cost 33800
\[\begin{array}{l}
t_1 := 2 \cdot \sqrt{x}\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+107}:\\
\;\;\;\;t_1 \cdot \cos \left(y - {\left(\sqrt[3]{z}\right)}^{2} \cdot \frac{\sqrt[3]{z}}{\frac{3}{t}}\right) - \frac{a}{b \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left({\left({\left(\mathsf{log1p}\left(t_1\right)\right)}^{3}\right)}^{0.3333333333333333}\right) + \frac{-a}{b \cdot 3}\\
\end{array}
\]
Alternative 5 Error 16.2 Cost 33800
\[\begin{array}{l}
t_1 := 2 \cdot \sqrt{x}\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+107}:\\
\;\;\;\;t_1 \cdot \cos \left(y - \frac{{\left(\sqrt[3]{z}\right)}^{2}}{\frac{3}{t \cdot \sqrt[3]{z}}}\right) - \frac{a}{b \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left({\left({\left(\mathsf{log1p}\left(t_1\right)\right)}^{3}\right)}^{0.3333333333333333}\right) + \frac{-a}{b \cdot 3}\\
\end{array}
\]
Alternative 6 Error 16.1 Cost 33028
\[\begin{array}{l}
t_1 := \frac{a}{b \cdot 3}\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+222}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot \sqrt{x \cdot {\cos y}^{2}}\right)\right) - t_1\\
\mathbf{elif}\;z \cdot t \leq 5000000000:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y + z \cdot \frac{-1}{\frac{3}{t}}\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\end{array}
\]
Alternative 7 Error 16.1 Cost 20164
\[\begin{array}{l}
t_1 := \frac{a}{b \cdot 3}\\
t_2 := 2 \cdot \sqrt{x}\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+222}:\\
\;\;\;\;t_2 \cdot \left|\cos y\right| - t_1\\
\mathbf{elif}\;z \cdot t \leq 5000000000:\\
\;\;\;\;t_2 \cdot \cos \left(y + z \cdot \frac{-1}{\frac{3}{t}}\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\end{array}
\]
Alternative 8 Error 16.1 Cost 14537
\[\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+147} \lor \neg \left(z \cdot t \leq 5000000000\right):\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y + z \cdot \frac{-1}{\frac{3}{t}}\right) - \frac{a}{b \cdot 3}\\
\end{array}
\]
Alternative 9 Error 16.1 Cost 14409
\[\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+240} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+107}\right):\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - t \cdot \frac{z}{3}\right) - \frac{a}{b \cdot 3}\\
\end{array}
\]
Alternative 10 Error 19.4 Cost 14025
\[\begin{array}{l}
t_1 := \frac{a}{b \cdot 3}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-105} \lor \neg \left(t_1 \leq 2 \cdot 10^{-113}\right):\\
\;\;\;\;\mathsf{fma}\left(2, \sqrt{x}, \frac{\frac{a}{-3}}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(2 \cdot \cos y\right)\\
\end{array}
\]
Alternative 11 Error 19.4 Cost 13897
\[\begin{array}{l}
t_1 := \frac{a}{b \cdot 3}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-105} \lor \neg \left(t_1 \leq 2 \cdot 10^{-113}\right):\\
\;\;\;\;2 \cdot \sqrt{x} - t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(2 \cdot \cos y\right)\\
\end{array}
\]
Alternative 12 Error 16.5 Cost 13504
\[\cos y \cdot \left(2 \cdot \sqrt{x}\right) + a \cdot \frac{-0.3333333333333333}{b}
\]
Alternative 13 Error 24.5 Cost 6976
\[2 \cdot \sqrt{x} - \frac{a}{b \cdot 3}
\]
Alternative 14 Error 33.4 Cost 6857
\[\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+213} \lor \neg \left(b \leq 6.5 \cdot 10^{+146}\right):\\
\;\;\;\;2 \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{-3}}{b}\\
\end{array}
\]
Alternative 15 Error 35.7 Cost 320
\[-0.3333333333333333 \cdot \frac{a}{b}
\]
Alternative 16 Error 35.7 Cost 320
\[a \cdot \frac{-0.3333333333333333}{b}
\]
Alternative 17 Error 35.7 Cost 320
\[\frac{a \cdot -0.3333333333333333}{b}
\]
Alternative 18 Error 35.6 Cost 320
\[\frac{\frac{a}{-3}}{b}
\]