Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)
\]
↓
\[\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -5 \lor \neg \left(t_0 \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(-0.008333333333333333 \cdot {im}^{5} + -0.0001984126984126984 \cdot {im}^{7}\right) + \sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
\]
(FPCore (re im)
:precision binary64
(* (* 0.5 (sin re)) (- (exp (- im)) (exp im)))) ↓
(FPCore (re im)
:precision binary64
(let* ((t_0 (- (exp (- im)) (exp im))))
(if (or (<= t_0 -5.0) (not (<= t_0 5e-11)))
(* t_0 (* 0.5 (sin re)))
(+
(*
(sin re)
(+
(* -0.008333333333333333 (pow im 5.0))
(* -0.0001984126984126984 (pow im 7.0))))
(* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im)))))) double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) - exp(im));
}
↓
double code(double re, double im) {
double t_0 = exp(-im) - exp(im);
double tmp;
if ((t_0 <= -5.0) || !(t_0 <= 5e-11)) {
tmp = t_0 * (0.5 * sin(re));
} else {
tmp = (sin(re) * ((-0.008333333333333333 * pow(im, 5.0)) + (-0.0001984126984126984 * pow(im, 7.0)))) + (sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
end function
↓
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: t_0
real(8) :: tmp
t_0 = exp(-im) - exp(im)
if ((t_0 <= (-5.0d0)) .or. (.not. (t_0 <= 5d-11))) then
tmp = t_0 * (0.5d0 * sin(re))
else
tmp = (sin(re) * (((-0.008333333333333333d0) * (im ** 5.0d0)) + ((-0.0001984126984126984d0) * (im ** 7.0d0)))) + (sin(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im))
end if
code = tmp
end function
public static double code(double re, double im) {
return (0.5 * Math.sin(re)) * (Math.exp(-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 <= -5.0) || !(t_0 <= 5e-11)) {
tmp = t_0 * (0.5 * Math.sin(re));
} else {
tmp = (Math.sin(re) * ((-0.008333333333333333 * Math.pow(im, 5.0)) + (-0.0001984126984126984 * Math.pow(im, 7.0)))) + (Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im));
}
return tmp;
}
def code(re, im):
return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
↓
def code(re, im):
t_0 = math.exp(-im) - math.exp(im)
tmp = 0
if (t_0 <= -5.0) or not (t_0 <= 5e-11):
tmp = t_0 * (0.5 * math.sin(re))
else:
tmp = (math.sin(re) * ((-0.008333333333333333 * math.pow(im, 5.0)) + (-0.0001984126984126984 * math.pow(im, 7.0)))) + (math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im))
return tmp
function code(re, im)
return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)))
end
↓
function code(re, im)
t_0 = Float64(exp(Float64(-im)) - exp(im))
tmp = 0.0
if ((t_0 <= -5.0) || !(t_0 <= 5e-11))
tmp = Float64(t_0 * Float64(0.5 * sin(re)));
else
tmp = Float64(Float64(sin(re) * Float64(Float64(-0.008333333333333333 * (im ^ 5.0)) + Float64(-0.0001984126984126984 * (im ^ 7.0)))) + Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)));
end
return tmp
end
function tmp = code(re, im)
tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
end
↓
function tmp_2 = code(re, im)
t_0 = exp(-im) - exp(im);
tmp = 0.0;
if ((t_0 <= -5.0) || ~((t_0 <= 5e-11)))
tmp = t_0 * (0.5 * sin(re));
else
tmp = (sin(re) * ((-0.008333333333333333 * (im ^ 5.0)) + (-0.0001984126984126984 * (im ^ 7.0)))) + (sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im));
end
tmp_2 = tmp;
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $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, -5.0], N[Not[LessEqual[t$95$0, 5e-11]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * N[(N[(-0.008333333333333333 * N[Power[im, 5.0], $MachinePrecision]), $MachinePrecision] + N[(-0.0001984126984126984 * N[Power[im, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)
↓
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -5 \lor \neg \left(t_0 \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(-0.008333333333333333 \cdot {im}^{5} + -0.0001984126984126984 \cdot {im}^{7}\right) + \sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 99.7% Cost 53001
\[\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -5 \lor \neg \left(t_0 \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(-0.008333333333333333 \cdot {im}^{5} + \left(\left({im}^{3} \cdot -0.16666666666666666 - im\right) + -0.0001984126984126984 \cdot {im}^{7}\right)\right)\\
\end{array}
\]
Alternative 2 Accuracy 99.7% Cost 46089
\[\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -0.02 \lor \neg \left(t_0 \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - im \cdot \sin re\\
\end{array}
\]
Alternative 3 Accuracy 99.7% Cost 45961
\[\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -0.02 \lor \neg \left(t_0 \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\end{array}
\]
Alternative 4 Accuracy 97.3% Cost 13840
\[\begin{array}{l}
t_0 := 0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\
t_1 := -0.0001984126984126984 \cdot \left(\sin re \cdot {im}^{7}\right)\\
\mathbf{if}\;im \leq -2.7 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -0.55:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 2.3:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Accuracy 97.6% Cost 13840
\[\begin{array}{l}
t_0 := 0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\
t_1 := -0.0001984126984126984 \cdot \left(\sin re \cdot {im}^{7}\right)\\
\mathbf{if}\;im \leq -2.7 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -0.55:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 2.3:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 6 Accuracy 92.7% Cost 13449
\[\begin{array}{l}
\mathbf{if}\;im \leq -4.2 \lor \neg \left(im \leq 4.2\right):\\
\;\;\;\;-0.0001984126984126984 \cdot \left(\sin re \cdot {im}^{7}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\end{array}
\]
Alternative 7 Accuracy 77.4% Cost 8072
\[\begin{array}{l}
t_0 := im \cdot \left(im \cdot -0.3333333333333333\right)\\
\mathbf{if}\;im \leq -5.5 \cdot 10^{+128}:\\
\;\;\;\;0.5 \cdot \left(\left(im \cdot re\right) \cdot \left(-0.3333333333333333 \cdot \left(im \cdot im\right) + -2\right)\right)\\
\mathbf{elif}\;im \leq -3.3 \cdot 10^{+27}:\\
\;\;\;\;0.5 \cdot \left(\left(im \cdot re\right) \cdot \frac{4 - {t_0}^{2}}{-2 - t_0}\right)\\
\mathbf{elif}\;im \leq 80000000000:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot t_0\right) + re \cdot \left(im \cdot -2\right)\right)\\
\end{array}
\]
Alternative 8 Accuracy 77.1% Cost 6921
\[\begin{array}{l}
\mathbf{if}\;im \leq -3.7 \cdot 10^{+27} \lor \neg \left(im \leq 2600000\right):\\
\;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) + re \cdot \left(im \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\
\end{array}
\]
Alternative 9 Accuracy 52.6% Cost 1088
\[0.5 \cdot \left(re \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) + re \cdot \left(im \cdot -2\right)\right)
\]
Alternative 10 Accuracy 49.5% Cost 832
\[0.5 \cdot \left(\left(im \cdot re\right) \cdot \left(-0.3333333333333333 \cdot \left(im \cdot im\right) + -2\right)\right)
\]
Alternative 11 Accuracy 32.1% Cost 256
\[im \cdot \left(-re\right)
\]
Alternative 12 Accuracy 2.7% Cost 64
\[-3
\]
Alternative 13 Accuracy 2.7% Cost 64
\[-0.5
\]
Alternative 14 Accuracy 14.7% Cost 64
\[0
\]