
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
return exp(re) * cos(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.cos(im);
}
def code(re, im): return math.exp(re) * math.cos(im)
function code(re, im) return Float64(exp(re) * cos(im)) end
function tmp = code(re, im) tmp = exp(re) * cos(im); end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{re} \cdot \cos im
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (re im) :precision binary64 (if (<= (exp re) 0.0) (exp re) (if (<= (exp re) 2.0) (* (cos im) (+ re 1.0)) (exp re))))
double code(double re, double im) {
double tmp;
if (exp(re) <= 0.0) {
tmp = exp(re);
} else if (exp(re) <= 2.0) {
tmp = cos(im) * (re + 1.0);
} else {
tmp = exp(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (exp(re) <= 0.0d0) then
tmp = exp(re)
else if (exp(re) <= 2.0d0) then
tmp = cos(im) * (re + 1.0d0)
else
tmp = exp(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.exp(re) <= 0.0) {
tmp = Math.exp(re);
} else if (Math.exp(re) <= 2.0) {
tmp = Math.cos(im) * (re + 1.0);
} else {
tmp = Math.exp(re);
}
return tmp;
}
def code(re, im): tmp = 0 if math.exp(re) <= 0.0: tmp = math.exp(re) elif math.exp(re) <= 2.0: tmp = math.cos(im) * (re + 1.0) else: tmp = math.exp(re) return tmp
function code(re, im) tmp = 0.0 if (exp(re) <= 0.0) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = Float64(cos(im) * Float64(re + 1.0)); else tmp = exp(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (exp(re) <= 0.0) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = cos(im) * (re + 1.0); else tmp = exp(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Exp[re], $MachinePrecision], 0.0], N[Exp[re], $MachinePrecision], If[LessEqual[N[Exp[re], $MachinePrecision], 2.0], N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[Exp[re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;e^{re} \leq 2:\\
\;\;\;\;\cos im \cdot \left(re + 1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{re}\\
\end{array}
\end{array}
if (exp.f64 re) < 0.0 or 2 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0 89.7%
if 0.0 < (exp.f64 re) < 2Initial program 99.9%
Taylor expanded in re around 0 99.2%
*-rgt-identity99.2%
distribute-lft-in99.2%
Simplified99.2%
Final simplification94.1%
(FPCore (re im) :precision binary64 (if (<= (exp re) 0.0) (exp re) (if (<= (exp re) 2.0) (cos im) (exp re))))
double code(double re, double im) {
double tmp;
if (exp(re) <= 0.0) {
tmp = exp(re);
} else if (exp(re) <= 2.0) {
tmp = cos(im);
} else {
tmp = exp(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (exp(re) <= 0.0d0) then
tmp = exp(re)
else if (exp(re) <= 2.0d0) then
tmp = cos(im)
else
tmp = exp(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (Math.exp(re) <= 0.0) {
tmp = Math.exp(re);
} else if (Math.exp(re) <= 2.0) {
tmp = Math.cos(im);
} else {
tmp = Math.exp(re);
}
return tmp;
}
def code(re, im): tmp = 0 if math.exp(re) <= 0.0: tmp = math.exp(re) elif math.exp(re) <= 2.0: tmp = math.cos(im) else: tmp = math.exp(re) return tmp
function code(re, im) tmp = 0.0 if (exp(re) <= 0.0) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = cos(im); else tmp = exp(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (exp(re) <= 0.0) tmp = exp(re); elseif (exp(re) <= 2.0) tmp = cos(im); else tmp = exp(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[N[Exp[re], $MachinePrecision], 0.0], N[Exp[re], $MachinePrecision], If[LessEqual[N[Exp[re], $MachinePrecision], 2.0], N[Cos[im], $MachinePrecision], N[Exp[re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;e^{re} \leq 2:\\
\;\;\;\;\cos im\\
\mathbf{else}:\\
\;\;\;\;e^{re}\\
\end{array}
\end{array}
if (exp.f64 re) < 0.0 or 2 < (exp.f64 re) Initial program 100.0%
Taylor expanded in im around 0 89.7%
if 0.0 < (exp.f64 re) < 2Initial program 99.9%
Taylor expanded in re around 0 97.3%
Final simplification93.3%
(FPCore (re im)
:precision binary64
(if (or (<= re -0.028) (and (not (<= re 0.009)) (<= re 1.05e+103)))
(exp re)
(*
(cos im)
(+ (+ re 1.0) (* (* re re) (+ 0.5 (* re 0.16666666666666666)))))))
double code(double re, double im) {
double tmp;
if ((re <= -0.028) || (!(re <= 0.009) && (re <= 1.05e+103))) {
tmp = exp(re);
} else {
tmp = cos(im) * ((re + 1.0) + ((re * re) * (0.5 + (re * 0.16666666666666666))));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if ((re <= (-0.028d0)) .or. (.not. (re <= 0.009d0)) .and. (re <= 1.05d+103)) then
tmp = exp(re)
else
tmp = cos(im) * ((re + 1.0d0) + ((re * re) * (0.5d0 + (re * 0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if ((re <= -0.028) || (!(re <= 0.009) && (re <= 1.05e+103))) {
tmp = Math.exp(re);
} else {
tmp = Math.cos(im) * ((re + 1.0) + ((re * re) * (0.5 + (re * 0.16666666666666666))));
}
return tmp;
}
def code(re, im): tmp = 0 if (re <= -0.028) or (not (re <= 0.009) and (re <= 1.05e+103)): tmp = math.exp(re) else: tmp = math.cos(im) * ((re + 1.0) + ((re * re) * (0.5 + (re * 0.16666666666666666)))) return tmp
function code(re, im) tmp = 0.0 if ((re <= -0.028) || (!(re <= 0.009) && (re <= 1.05e+103))) tmp = exp(re); else tmp = Float64(cos(im) * Float64(Float64(re + 1.0) + Float64(Float64(re * re) * Float64(0.5 + Float64(re * 0.16666666666666666))))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if ((re <= -0.028) || (~((re <= 0.009)) && (re <= 1.05e+103))) tmp = exp(re); else tmp = cos(im) * ((re + 1.0) + ((re * re) * (0.5 + (re * 0.16666666666666666)))); end tmp_2 = tmp; end
code[re_, im_] := If[Or[LessEqual[re, -0.028], And[N[Not[LessEqual[re, 0.009]], $MachinePrecision], LessEqual[re, 1.05e+103]]], N[Exp[re], $MachinePrecision], N[(N[Cos[im], $MachinePrecision] * N[(N[(re + 1.0), $MachinePrecision] + N[(N[(re * re), $MachinePrecision] * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.028 \lor \neg \left(re \leq 0.009\right) \land re \leq 1.05 \cdot 10^{+103}:\\
\;\;\;\;e^{re}\\
\mathbf{else}:\\
\;\;\;\;\cos im \cdot \left(\left(re + 1\right) + \left(re \cdot re\right) \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if re < -0.0280000000000000006 or 0.00899999999999999932 < re < 1.0500000000000001e103Initial program 100.0%
Taylor expanded in im around 0 94.9%
if -0.0280000000000000006 < re < 0.00899999999999999932 or 1.0500000000000001e103 < re Initial program 100.0%
Taylor expanded in re around 0 100.0%
associate-+r+100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
*-commutative100.0%
distribute-lft1-in100.0%
distribute-rgt-out100.0%
+-commutative100.0%
cube-mult100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification98.0%
(FPCore (re im) :precision binary64 (if (<= re -0.028) (exp re) (if (<= re 0.0029) (* (cos im) (+ (+ re 1.0) (* re (* re 0.5)))) (exp re))))
double code(double re, double im) {
double tmp;
if (re <= -0.028) {
tmp = exp(re);
} else if (re <= 0.0029) {
tmp = cos(im) * ((re + 1.0) + (re * (re * 0.5)));
} else {
tmp = exp(re);
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= (-0.028d0)) then
tmp = exp(re)
else if (re <= 0.0029d0) then
tmp = cos(im) * ((re + 1.0d0) + (re * (re * 0.5d0)))
else
tmp = exp(re)
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= -0.028) {
tmp = Math.exp(re);
} else if (re <= 0.0029) {
tmp = Math.cos(im) * ((re + 1.0) + (re * (re * 0.5)));
} else {
tmp = Math.exp(re);
}
return tmp;
}
def code(re, im): tmp = 0 if re <= -0.028: tmp = math.exp(re) elif re <= 0.0029: tmp = math.cos(im) * ((re + 1.0) + (re * (re * 0.5))) else: tmp = math.exp(re) return tmp
function code(re, im) tmp = 0.0 if (re <= -0.028) tmp = exp(re); elseif (re <= 0.0029) tmp = Float64(cos(im) * Float64(Float64(re + 1.0) + Float64(re * Float64(re * 0.5)))); else tmp = exp(re); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= -0.028) tmp = exp(re); elseif (re <= 0.0029) tmp = cos(im) * ((re + 1.0) + (re * (re * 0.5))); else tmp = exp(re); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, -0.028], N[Exp[re], $MachinePrecision], If[LessEqual[re, 0.0029], N[(N[Cos[im], $MachinePrecision] * N[(N[(re + 1.0), $MachinePrecision] + N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.028:\\
\;\;\;\;e^{re}\\
\mathbf{elif}\;re \leq 0.0029:\\
\;\;\;\;\cos im \cdot \left(\left(re + 1\right) + re \cdot \left(re \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{re}\\
\end{array}
\end{array}
if re < -0.0280000000000000006 or 0.0029 < re Initial program 100.0%
Taylor expanded in im around 0 89.7%
if -0.0280000000000000006 < re < 0.0029Initial program 99.9%
Taylor expanded in re around 0 99.9%
*-commutative99.9%
associate-*r*99.9%
*-commutative99.9%
distribute-lft1-in99.9%
distribute-rgt-out99.8%
+-commutative99.8%
*-commutative99.8%
unpow299.8%
associate-*l*99.8%
Simplified99.8%
Final simplification94.5%
(FPCore (re im) :precision binary64 (if (<= re 4.8e+23) (cos im) (* re (+ 1.0 (* -0.5 (* im im))))))
double code(double re, double im) {
double tmp;
if (re <= 4.8e+23) {
tmp = cos(im);
} else {
tmp = re * (1.0 + (-0.5 * (im * im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 4.8d+23) then
tmp = cos(im)
else
tmp = re * (1.0d0 + ((-0.5d0) * (im * im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 4.8e+23) {
tmp = Math.cos(im);
} else {
tmp = re * (1.0 + (-0.5 * (im * im)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 4.8e+23: tmp = math.cos(im) else: tmp = re * (1.0 + (-0.5 * (im * im))) return tmp
function code(re, im) tmp = 0.0 if (re <= 4.8e+23) tmp = cos(im); else tmp = Float64(re * Float64(1.0 + Float64(-0.5 * Float64(im * im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 4.8e+23) tmp = cos(im); else tmp = re * (1.0 + (-0.5 * (im * im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 4.8e+23], N[Cos[im], $MachinePrecision], N[(re * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 4.8 \cdot 10^{+23}:\\
\;\;\;\;\cos im\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if re < 4.8e23Initial program 100.0%
Taylor expanded in re around 0 60.0%
if 4.8e23 < re Initial program 100.0%
Taylor expanded in re around 0 5.6%
*-rgt-identity5.6%
distribute-lft-in5.6%
Simplified5.6%
Taylor expanded in im around 0 19.9%
associate-+r+19.9%
+-commutative19.9%
+-commutative19.9%
*-commutative19.9%
unpow219.9%
Simplified19.9%
Taylor expanded in re around inf 19.9%
*-commutative19.9%
unpow219.9%
Simplified19.9%
Final simplification51.1%
(FPCore (re im) :precision binary64 (if (<= re 4.8e+21) (+ re 1.0) (* re (+ 1.0 (* -0.5 (* im im))))))
double code(double re, double im) {
double tmp;
if (re <= 4.8e+21) {
tmp = re + 1.0;
} else {
tmp = re * (1.0 + (-0.5 * (im * im)));
}
return tmp;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
real(8) :: tmp
if (re <= 4.8d+21) then
tmp = re + 1.0d0
else
tmp = re * (1.0d0 + ((-0.5d0) * (im * im)))
end if
code = tmp
end function
public static double code(double re, double im) {
double tmp;
if (re <= 4.8e+21) {
tmp = re + 1.0;
} else {
tmp = re * (1.0 + (-0.5 * (im * im)));
}
return tmp;
}
def code(re, im): tmp = 0 if re <= 4.8e+21: tmp = re + 1.0 else: tmp = re * (1.0 + (-0.5 * (im * im))) return tmp
function code(re, im) tmp = 0.0 if (re <= 4.8e+21) tmp = Float64(re + 1.0); else tmp = Float64(re * Float64(1.0 + Float64(-0.5 * Float64(im * im)))); end return tmp end
function tmp_2 = code(re, im) tmp = 0.0; if (re <= 4.8e+21) tmp = re + 1.0; else tmp = re * (1.0 + (-0.5 * (im * im))); end tmp_2 = tmp; end
code[re_, im_] := If[LessEqual[re, 4.8e+21], N[(re + 1.0), $MachinePrecision], N[(re * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;re \leq 4.8 \cdot 10^{+21}:\\
\;\;\;\;re + 1\\
\mathbf{else}:\\
\;\;\;\;re \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\
\end{array}
\end{array}
if re < 4.8e21Initial program 100.0%
Taylor expanded in re around 0 60.8%
*-rgt-identity60.8%
distribute-lft-in60.8%
Simplified60.8%
Taylor expanded in im around 0 35.2%
+-commutative35.2%
Simplified35.2%
if 4.8e21 < re Initial program 100.0%
Taylor expanded in re around 0 5.6%
*-rgt-identity5.6%
distribute-lft-in5.6%
Simplified5.6%
Taylor expanded in im around 0 19.9%
associate-+r+19.9%
+-commutative19.9%
+-commutative19.9%
*-commutative19.9%
unpow219.9%
Simplified19.9%
Taylor expanded in re around inf 19.9%
*-commutative19.9%
unpow219.9%
Simplified19.9%
Final simplification31.8%
(FPCore (re im) :precision binary64 (+ (+ re 1.0) (* (* im -0.5) (* re im))))
double code(double re, double im) {
return (re + 1.0) + ((im * -0.5) * (re * im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = (re + 1.0d0) + ((im * (-0.5d0)) * (re * im))
end function
public static double code(double re, double im) {
return (re + 1.0) + ((im * -0.5) * (re * im));
}
def code(re, im): return (re + 1.0) + ((im * -0.5) * (re * im))
function code(re, im) return Float64(Float64(re + 1.0) + Float64(Float64(im * -0.5) * Float64(re * im))) end
function tmp = code(re, im) tmp = (re + 1.0) + ((im * -0.5) * (re * im)); end
code[re_, im_] := N[(N[(re + 1.0), $MachinePrecision] + N[(N[(im * -0.5), $MachinePrecision] * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(re + 1\right) + \left(im \cdot -0.5\right) \cdot \left(re \cdot im\right)
\end{array}
Initial program 100.0%
Taylor expanded in re around 0 48.5%
*-rgt-identity48.5%
distribute-lft-in48.5%
Simplified48.5%
Taylor expanded in im around 0 30.3%
associate-+r+30.3%
+-commutative30.3%
+-commutative30.3%
*-commutative30.3%
unpow230.3%
Simplified30.3%
Taylor expanded in re around inf 30.5%
*-commutative30.5%
unpow230.5%
associate-*l*30.5%
associate-*r*30.5%
*-commutative30.5%
Simplified30.5%
Final simplification30.5%
(FPCore (re im) :precision binary64 (+ 1.0 (* -0.5 (* im im))))
double code(double re, double im) {
return 1.0 + (-0.5 * (im * im));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = 1.0d0 + ((-0.5d0) * (im * im))
end function
public static double code(double re, double im) {
return 1.0 + (-0.5 * (im * im));
}
def code(re, im): return 1.0 + (-0.5 * (im * im))
function code(re, im) return Float64(1.0 + Float64(-0.5 * Float64(im * im))) end
function tmp = code(re, im) tmp = 1.0 + (-0.5 * (im * im)); end
code[re_, im_] := N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + -0.5 \cdot \left(im \cdot im\right)
\end{array}
Initial program 100.0%
Taylor expanded in re around 0 48.5%
*-rgt-identity48.5%
distribute-lft-in48.5%
Simplified48.5%
Taylor expanded in im around 0 30.3%
associate-+r+30.3%
+-commutative30.3%
+-commutative30.3%
*-commutative30.3%
unpow230.3%
Simplified30.3%
Taylor expanded in re around 0 29.2%
unpow229.2%
Simplified29.2%
Final simplification29.2%
(FPCore (re im) :precision binary64 (+ re 1.0))
double code(double re, double im) {
return re + 1.0;
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = re + 1.0d0
end function
public static double code(double re, double im) {
return re + 1.0;
}
def code(re, im): return re + 1.0
function code(re, im) return Float64(re + 1.0) end
function tmp = code(re, im) tmp = re + 1.0; end
code[re_, im_] := N[(re + 1.0), $MachinePrecision]
\begin{array}{l}
\\
re + 1
\end{array}
Initial program 100.0%
Taylor expanded in re around 0 48.5%
*-rgt-identity48.5%
distribute-lft-in48.5%
Simplified48.5%
Taylor expanded in im around 0 28.4%
+-commutative28.4%
Simplified28.4%
Final simplification28.4%
herbie shell --seed 2023172
(FPCore (re im)
:name "math.exp on complex, real part"
:precision binary64
(* (exp re) (cos im)))