\[ \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}
t_1 := \mathsf{fma}\left(-z, t \cdot 0.3333333333333333, y\right)\\
t_2 := \frac{\frac{a}{b}}{3}\\
t_3 := \mathsf{fma}\left(t \cdot -0.3333333333333333, z, z \cdot \left(t \cdot 0.3333333333333333\right)\right)\\
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;2 \cdot \left|\cos y \cdot \sqrt{x}\right| - t_2\\
\mathbf{elif}\;z \cdot t \leq 10^{+140}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \left(\cos t_1 \cdot \cos t_3 - \sin t_1 \cdot \sin t_3\right)\right) - \frac{a}{b \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \mathsf{expm1}\left(\mathsf{fma}\left(-0.25, y \cdot y, \log 2\right)\right)\right) - t_2\\
\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
(let* ((t_1 (fma (- z) (* t 0.3333333333333333) y))
(t_2 (/ (/ a b) 3.0))
(t_3 (fma (* t -0.3333333333333333) z (* z (* t 0.3333333333333333)))))
(if (<= (* z t) (- INFINITY))
(- (* 2.0 (fabs (* (cos y) (sqrt x)))) t_2)
(if (<= (* z t) 1e+140)
(-
(*
2.0
(* (sqrt x) (- (* (cos t_1) (cos t_3)) (* (sin t_1) (sin t_3)))))
(/ a (* b 3.0)))
(- (* 2.0 (* (sqrt x) (expm1 (fma -0.25 (* y y) (log 2.0))))) t_2))))) 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 t_1 = fma(-z, (t * 0.3333333333333333), y);
double t_2 = (a / b) / 3.0;
double t_3 = fma((t * -0.3333333333333333), z, (z * (t * 0.3333333333333333)));
double tmp;
if ((z * t) <= -((double) INFINITY)) {
tmp = (2.0 * fabs((cos(y) * sqrt(x)))) - t_2;
} else if ((z * t) <= 1e+140) {
tmp = (2.0 * (sqrt(x) * ((cos(t_1) * cos(t_3)) - (sin(t_1) * sin(t_3))))) - (a / (b * 3.0));
} else {
tmp = (2.0 * (sqrt(x) * expm1(fma(-0.25, (y * y), log(2.0))))) - t_2;
}
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)
t_1 = fma(Float64(-z), Float64(t * 0.3333333333333333), y)
t_2 = Float64(Float64(a / b) / 3.0)
t_3 = fma(Float64(t * -0.3333333333333333), z, Float64(z * Float64(t * 0.3333333333333333)))
tmp = 0.0
if (Float64(z * t) <= Float64(-Inf))
tmp = Float64(Float64(2.0 * abs(Float64(cos(y) * sqrt(x)))) - t_2);
elseif (Float64(z * t) <= 1e+140)
tmp = Float64(Float64(2.0 * Float64(sqrt(x) * Float64(Float64(cos(t_1) * cos(t_3)) - Float64(sin(t_1) * sin(t_3))))) - Float64(a / Float64(b * 3.0)));
else
tmp = Float64(Float64(2.0 * Float64(sqrt(x) * expm1(fma(-0.25, Float64(y * y), log(2.0))))) - t_2);
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_] := Block[{t$95$1 = N[((-z) * N[(t * 0.3333333333333333), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a / b), $MachinePrecision] / 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * -0.3333333333333333), $MachinePrecision] * z + N[(z * N[(t * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(N[(2.0 * N[Abs[N[(N[Cos[y], $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+140], N[(N[(2.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(N[(N[Cos[t$95$1], $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t$95$1], $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(Exp[N[(-0.25 * N[(y * y), $MachinePrecision] + N[Log[2.0], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $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}
t_1 := \mathsf{fma}\left(-z, t \cdot 0.3333333333333333, y\right)\\
t_2 := \frac{\frac{a}{b}}{3}\\
t_3 := \mathsf{fma}\left(t \cdot -0.3333333333333333, z, z \cdot \left(t \cdot 0.3333333333333333\right)\right)\\
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;2 \cdot \left|\cos y \cdot \sqrt{x}\right| - t_2\\
\mathbf{elif}\;z \cdot t \leq 10^{+140}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \left(\cos t_1 \cdot \cos t_3 - \sin t_1 \cdot \sin t_3\right)\right) - \frac{a}{b \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \mathsf{expm1}\left(\mathsf{fma}\left(-0.25, y \cdot y, \log 2\right)\right)\right) - t_2\\
\end{array}
Alternatives Alternative 1 Error 16.4 Cost 34120
\[\begin{array}{l}
t_1 := \frac{\frac{a}{b}}{3}\\
t_2 := 2 \cdot \left(\sqrt{x} \cdot \mathsf{expm1}\left(\mathsf{fma}\left(-0.25, y \cdot y, \log 2\right)\right)\right) - t_1\\
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \cdot t \leq 10^{+132}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \left(\cos y \cdot \cos \left(z \cdot \left(t \cdot 0.3333333333333333\right)\right) - \sin \left(\left(z \cdot t\right) \cdot -0.3333333333333333\right) \cdot \sin y\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 2 Error 24.7 Cost 13768
\[\begin{array}{l}
\mathbf{if}\;b \leq -1.25 \cdot 10^{+115}:\\
\;\;\;\;\sqrt{x} \cdot \left(2 \cdot \cos y\right)\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+195}:\\
\;\;\;\;2 \cdot \sqrt{x} - \frac{\frac{a}{b}}{3}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{x} \cdot \cos \left(y + \left(z \cdot t\right) \cdot -0.3333333333333333\right)\right)\\
\end{array}
\]
Alternative 3 Error 17.2 Cost 13504
\[2 \cdot \left(\cos y \cdot \sqrt{x}\right) - \frac{a}{b \cdot 3}
\]
Alternative 4 Error 17.3 Cost 13504
\[2 \cdot \left(\cos y \cdot \sqrt{x}\right) - \frac{\frac{a}{b}}{3}
\]
Alternative 5 Error 24.7 Cost 13384
\[\begin{array}{l}
t_1 := 2 \cdot \sqrt{x}\\
\mathbf{if}\;a \leq -1.85 \cdot 10^{-224}:\\
\;\;\;\;t_1 - \frac{\frac{a}{b}}{3}\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-247}:\\
\;\;\;\;\sqrt{x} \cdot \left(2 \cdot \cos y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - \frac{a}{b \cdot 3}\\
\end{array}
\]
Alternative 6 Error 25.5 Cost 6976
\[2 \cdot \sqrt{x} + \frac{a}{b} \cdot -0.3333333333333333
\]
Alternative 7 Error 25.5 Cost 6976
\[2 \cdot \sqrt{x} - \frac{a}{b \cdot 3}
\]
Alternative 8 Error 25.5 Cost 6976
\[2 \cdot \sqrt{x} - \frac{\frac{a}{b}}{3}
\]
Alternative 9 Error 36.5 Cost 320
\[\frac{a}{b} \cdot -0.3333333333333333
\]
Alternative 10 Error 36.4 Cost 320
\[\frac{-0.3333333333333333}{\frac{b}{a}}
\]
Alternative 11 Error 36.4 Cost 320
\[\frac{a}{b \cdot -3}
\]
Alternative 12 Error 36.4 Cost 320
\[\frac{\frac{a}{-3}}{b}
\]