Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
\]
↓
\[\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{-6}\right):\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
\]
(FPCore (re im)
:precision binary64
(* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im)))) ↓
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 1e-6)))
(* (* 0.5 (cos re)) t_0)
(* (cos re) (- (* (pow im 3.0) -0.16666666666666666) im))))) double code(double re, double im) {
return (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
}
↓
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 1e-6)) {
tmp = (0.5 * cos(re)) * t_0;
} else {
tmp = cos(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
public static double code(double re, double im) {
return (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
}
↓
public static double code(double re, double im) {
double t_0 = Math.exp(-im) - Math.exp(im);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 1e-6)) {
tmp = (0.5 * Math.cos(re)) * t_0;
} else {
tmp = Math.cos(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
}
return tmp;
}
def code(re, im):
return (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
↓
def code(re, im):
t_0 = math.exp(-im) - math.exp(im)
tmp = 0
if (t_0 <= -math.inf) or not (t_0 <= 1e-6):
tmp = (0.5 * math.cos(re)) * t_0
else:
tmp = math.cos(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
return tmp
function code(re, im)
return Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im)))
end
↓
function code(re, im)
t_0 = Float64(exp(Float64(-im)) - exp(im))
tmp = 0.0
if ((t_0 <= Float64(-Inf)) || !(t_0 <= 1e-6))
tmp = Float64(Float64(0.5 * cos(re)) * t_0);
else
tmp = Float64(cos(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im));
end
return tmp
end
function tmp = code(re, im)
tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
end
↓
function tmp_2 = code(re, im)
t_0 = exp(-im) - exp(im);
tmp = 0.0;
if ((t_0 <= -Inf) || ~((t_0 <= 1e-6)))
tmp = (0.5 * cos(re)) * t_0;
else
tmp = cos(re) * (((im ^ 3.0) * -0.16666666666666666) - im);
end
tmp_2 = tmp;
end
code[re_, im_] := N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 1e-6]], $MachinePrecision]], N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]]]
\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)
↓
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{-6}\right):\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 99.5% Cost 45961
\[\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{-6}\right):\\
\;\;\;\;\left(0.5 \cdot \cos re\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
\]
Alternative 2 Accuracy 94.8% Cost 14098
\[\begin{array}{l}
\mathbf{if}\;im \leq -7.2 \cdot 10^{+109} \lor \neg \left(im \leq -0.105 \lor \neg \left(im \leq 960000000\right) \land im \leq 5.8 \cdot 10^{+102}\right):\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 + re \cdot \left(re \cdot -0.25\right)\right)\\
\end{array}
\]
Alternative 3 Accuracy 94.1% Cost 13842
\[\begin{array}{l}
\mathbf{if}\;im \leq -2.9 \cdot 10^{+128} \lor \neg \left(im \leq -190000000000 \lor \neg \left(im \leq 0.125\right) \land im \leq 5.8 \cdot 10^{+102}\right):\\
\;\;\;\;\cos re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(e^{-im} - e^{im}\right)\\
\end{array}
\]
Alternative 4 Accuracy 86.1% Cost 13580
\[\begin{array}{l}
t_0 := 0.5 \cdot \left(e^{-im} - e^{im}\right)\\
t_1 := {im}^{3} \cdot -0.16666666666666666\\
\mathbf{if}\;im \leq -190000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 0.0068:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+135}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 2.6 \cdot 10^{+186}:\\
\;\;\;\;\left(im - t_1\right) \cdot \left(-1 - -0.5 \cdot \left(re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - im\\
\end{array}
\]
Alternative 5 Accuracy 77.8% Cost 7692
\[\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666\\
t_1 := \left(im - t_0\right) \cdot \left(-1 - -0.5 \cdot \left(re \cdot re\right)\right)\\
\mathbf{if}\;im \leq -445:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 1.9 \cdot 10^{+25}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 3.5 \cdot 10^{+186}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 - im\\
\end{array}
\]
Alternative 6 Accuracy 74.3% Cost 7445
\[\begin{array}{l}
t_0 := {im}^{3} \cdot -0.16666666666666666 - im\\
\mathbf{if}\;im \leq -3.8 \cdot 10^{+40}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.9 \cdot 10^{+25}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 3.9 \cdot 10^{+111}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im\\
\mathbf{elif}\;im \leq 9 \cdot 10^{+167} \lor \neg \left(im \leq 1.32 \cdot 10^{+185}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(re \cdot 0.75\right)\\
\end{array}
\]
Alternative 7 Accuracy 63.4% Cost 7184
\[\begin{array}{l}
t_0 := \left(re \cdot re\right) \cdot \left(-0.25 \cdot \left(im \cdot -2\right)\right)\\
t_1 := \frac{im \cdot im - t_0 \cdot t_0}{\left(-im\right) - t_0}\\
\mathbf{if}\;im \leq -3.3 \cdot 10^{+156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -3 \cdot 10^{+30}:\\
\;\;\;\;re \cdot \left(re \cdot 0.75\right)\\
\mathbf{elif}\;im \leq -7 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 3.25 \cdot 10^{+25}:\\
\;\;\;\;im \cdot \left(-\cos re\right)\\
\mathbf{elif}\;im \leq 6 \cdot 10^{+190}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 8 Accuracy 37.5% Cost 1608
\[\begin{array}{l}
t_0 := \left(re \cdot re\right) \cdot 0.75\\
\mathbf{if}\;re \leq -1.55 \cdot 10^{+147}:\\
\;\;\;\;re \cdot \left(re \cdot 0.75\right)\\
\mathbf{elif}\;re \leq -5.6 \cdot 10^{+125}:\\
\;\;\;\;\frac{2.25 - t_0 \cdot t_0}{-1.5 - t_0}\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im\\
\end{array}
\]
Alternative 9 Accuracy 36.1% Cost 712
\[\begin{array}{l}
\mathbf{if}\;re \leq -5.1 \cdot 10^{+179}:\\
\;\;\;\;re \cdot \left(re \cdot 0.75\right)\\
\mathbf{elif}\;re \leq 330000000000:\\
\;\;\;\;-im\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot re\right)\right)\\
\end{array}
\]
Alternative 10 Accuracy 37.5% Cost 704
\[\left(0.5 + re \cdot \left(re \cdot -0.25\right)\right) \cdot \left(im \cdot -2\right)
\]
Alternative 11 Accuracy 34.7% Cost 585
\[\begin{array}{l}
\mathbf{if}\;re \leq -5.1 \cdot 10^{+179} \lor \neg \left(re \leq 3.2 \cdot 10^{+122}\right):\\
\;\;\;\;re \cdot \left(re \cdot 0.75\right)\\
\mathbf{else}:\\
\;\;\;\;-im\\
\end{array}
\]
Alternative 12 Accuracy 37.5% Cost 576
\[im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right) - im
\]
Alternative 13 Accuracy 30.5% Cost 128
\[-im
\]
Alternative 14 Accuracy 2.9% Cost 64
\[-1.5
\]