IMCOS Function (Gnumeric)
Learn the IMCOS function in Gnumeric: Returns the cosine of a complex number.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked
Evidence: Examples are independent mathematical calculations. Official documentation and the Gnumeric 1.12.62 source were inspected. No native Gnumeric workbook execution or application screenshots were produced.
What IMCOS does
Compute the cosine of a complex number, retaining both the real and imaginary components of the answer. The identity cos(x+iy) = cos(x) cosh(y) − i sin(x) sinh(y) explains why its output is generally complex even when x is an ordinary radian angle.
Gnumeric’s official Complex manual documents this exact function name and signature; the official function catalogue separately lists it as Complete with Exhaustive upstream testing. “Complete” describes the catalogue’s implementation classification; “Exhaustive” describes the listed upstream tests, not a claim about the example worksheet below or every available platform/version. Official documentation, checked 2026-10-13.
Version-specific error distinction: The online 1.12 manual describes malformed complex inputs as
#VALUE!. The official 1.12.62 source instead returns#NUM!when parsing a malformed complex string; other unsupported value types can still return#VALUE!. Any#VALUE!expectations below are the manual’s older documented rule, not verified 1.12.62 output. No native error test was performed.
Exact syntax and arguments
=IMCOS(z)
| Position | Argument | Required? | Type and meaning | Default |
|---|---|---|---|---|
| 1 | z |
Yes | One complex number, for example "1+2i", or a cell containing a complex-number representation |
None; there is no optional argument |
There are no additional arguments. z stands for a single complex value, not two separate real-number arguments. To construct a value from distinct coefficients use the separately documented COMPLEX function; in Gnumeric the related function’s arguments are COMPLEX(x,y,i) where the optional i/j suffix defaults to i. The simple one-argument examples here work independently of list-separator conventions, but COMPLEX’s comma notation reflects the English manual; check the installed locale before pasting multi-argument expressions. Official source, checked 2026-10-13.
Radian convention. Interpret angular inputs in the complex trigonometric formulas using radians. The real and imaginary components of the input are ordinary numeric coefficients; appending i marks the imaginary coefficient, not an angle unit. If starting with a real angle in degrees, convert it to radians first before constructing z; do not append i to a degree number and expect automatic conversion.
The mathematics behind the formula
Definition: for z = x + yi with real x and y, cos(z) = cos(x) cosh(y) − i sin(x) sinh(y). Here x is measured in radians (not degrees) in the trigonometric terms. The imaginary component is negative when sin(x)sinh(y) is positive.
The mathematical formula explains the independent expected outputs below. It is not a separate assertion that an untested Gnumeric build has identical last-digit floating-point behavior in every environment.
Reproducible beginner worksheet
Create an empty Gnumeric sheet with column headings: A = complex input, B = IMCOS result, C = real component, D = imaginary coefficient. Enter the text values in A2:A6 (if automatic cell conversion interferes, explicitly format A cells as text), then enter the formulas in B2:D2 and fill them down. Do not type the illustrative expectation into the formula-result cells.
| Cell | Enter this value or formula | Independently calculated expectation |
|---|---|---|
| A2 | 1+2i (text) |
Complex argument |
| B2 | =IMCOS(A2) |
Complex result; text formatting may vary |
| C2 | =IMREAL(B2) |
Real component ≈ 2.032723007 |
| D2 | =IMAGINARY(B2) |
Imaginary coefficient ≈ -3.051897799 |
| A3 | 0+0i (text) |
Complex argument |
| B3 | =IMCOS(A3) |
Complex result; text formatting may vary |
| C3 | =IMREAL(B3) |
Real component ≈ 1.000000000 |
| D3 | =IMAGINARY(B3) |
Imaginary coefficient ≈ 0.000000000 |
| A4 | 2-1i (text) |
Complex argument |
| B4 | =IMCOS(A4) |
Complex result; text formatting may vary |
| C4 | =IMREAL(B4) |
Real component ≈ -0.642148125 |
| D4 | =IMAGINARY(B4) |
Imaginary coefficient ≈ 1.068607421 |
| A5 | 0+1i (text) |
Complex argument |
| B5 | =IMCOS(A5) |
Complex result; text formatting may vary |
| C5 | =IMREAL(B5) |
Real component ≈ 1.543080635 |
| D5 | =IMAGINARY(B5) |
Imaginary coefficient ≈ 0.000000000 |
| A6 | 3+4i (text) |
Complex argument |
| B6 | =IMCOS(A6) |
Complex result; text formatting may vary |
| C6 | =IMREAL(B6) |
Real component ≈ -27.034945603 |
| D6 | =IMAGINARY(B6) |
Imaginary coefficient ≈ -3.851153335 |
These values are rounded to nine decimal places. A complex-result cell may display additional digits, omit a zero coefficient, or represent imaginary units with another supported suffix; the table tests numeric coefficients, not exact string serialization. The official manual documents IMREAL and IMAGINARY for extracting those parts. If the input entered as 1+2i is not treated as a valid complex text representation on a particular system, explicitly enter it as a string or generate it with =COMPLEX(1,2); do not silently assume every locale parses input the same way. Documentation checked 2026-10-13.
A direct formula to try
=IMCOS("1+2i")
Use =IMREAL(IMCOS("1+2i")) and =IMAGINARY(IMCOS("1+2i")) to compare the two independently expected coefficients from the table above. Both the compound formulas and the output-format details are review examples pending native confirmation, rather than proof that they were executed in Gnumeric.
Practical scenario
A signal-processing model represents a phase offset and attenuation parameter as 1+2i. Calculate the complex cosine without discarding the imaginary part. For that input, the independent expected result is approximately 2.032723007 − 3.051897799i. The real component exceeds 1 because a nonzero imaginary part introduces hyperbolic growth; do not apply the real-domain [−1,1] bound to a complex cosine.
Advanced use and verification identities
For a formula-level consistency check, use the identity cos(z)^2 + sin(z)^2 = 1 in complex arithmetic, not by squaring the displayed real coefficients individually. If A2 holds 1+2i, the illustrative check is:
=IMSUM(IMPRODUCT(IMCOS(A2),IMCOS(A2)),IMPRODUCT(IMSIN(A2),IMSIN(A2)))
The independently computed mathematical expectation is approximately 1+0i, with small floating-point residuals possible. Compare its IMREAL and IMAGINARY components against 1 and 0 with tolerances instead of relying on exact text equality. A second analytical check is cos(conjugate(z)) = conjugate(cos(z)) for finite z. Gnumeric provides IMCONJUGATE for expressing that identity. These are proposed worksheet checks, not observations from native Gnumeric execution.
Errors and troubleshooting
| Symptom or issue | What is supported by evidence, and what to check |
|---|---|
#VALUE! for invalid z |
The official Complex manual expressly documents this response when its complex-number argument is invalid. Check for malformed expressions such as an extra i, unsupported embedded spaces, wrong quotation marks, or mistakenly split real and imaginary inputs. Exact parsing of every malformed text variant was not tested. |
| A cell appears to return unexpected text | First inspect whether A2 is a text value and whether the result is a complex representation. Extract real and imaginary components with IMREAL/IMAGINARY rather than treating the complex result as an ordinary scalar or comparing formatted strings. |
| Real-vs-complex confusion | Treating IMCOS as an ordinary real cosine when the imaginary coefficient is nonzero leads to incorrect amplitude estimates. To recover an ordinary real cosine, input a complex number with zero imaginary coefficient, such as "1+0i", and compare to the real COS(1) mathematically. |
| Extreme input magnitude or instability | Complex cosine grows in magnitude rapidly with a large imaginary component because it contains hyperbolic functions. For extreme values, finite-precision overflow or loss of precision is possible; an exact Gnumeric error classification for this situation was not established. Do not assume the result remains between −1 and 1. |
| Wrong values after copying between sheets/applications | Verify the active locale, the interpretation of i/j suffixes, function availability in the target product and the source application’s actual version. Excel and LibreOffice behavior is not independently established Gnumeric runtime evidence. |
| A blank or numeric-only input behaves surprisingly | Official documentation establishes the requirement for a valid complex number, but it does not specify all blank-cell coercion and text-parsing cases. Test these directly in the installed Gnumeric version instead of inferring output from Excel or a mathematical library. |
Numerical tolerance tip: even for mathematically exact identities such as a sum being 1+0i, roundoff can leave a very small residual. Comparing text representations for equality is not a sound numerical test. Set a problem-appropriate absolute/relative tolerance for each numeric coefficient.
Compatibility, software version, and platform evidence
Gnumeric’s Complex manual expressly marks IMCOS as Microsoft Excel compatible. This is a documented function-level compatibility statement, not proof that all versions, number formatting, suffix serialization, precision and invalid-input behavior match. The Gnumeric 1.12.62 announcement reports general improvements in complex-function Excel compatibility but does not enumerate IMCOS-specific changed cases.
The official release material identifies Gnumeric 1.12.62 in September 2026, and the GNOME source archive lists the corresponding 1.12.62 tarball. This review uses the online official manual and catalogue as consulted 2026-10-13, alongside inspection of checksum-verified official 1.12.62 source; no source build was executed. Consequently, the evidence supports documented function availability in the contemporary Gnumeric project, not a claim that every Linux distribution, platform port, or historical build produces identical results. Official release notes · GNOME release archive.
Related Gnumeric function guides
Sources, checked on 2026-10-13
- Official Gnumeric Complex function manual — exact
IMCOS(z)signature, argument meaning, invalid-input#VALUE!note, specific compatibility wording where provided, and nearby related complex functions. - Gnumeric’s public function catalogue — contemporary listing and labels “Complete” and “Exhaustive”; these are classification/testing labels, not a runtime experiment by this research task.
- Official Gnumeric 1.12.62 release announcement — project version and general Excel-compatibility improvements; not proof of this function’s exact release implementation.
- GNOME source-release directory — available 1.12.62 source archive; official 1.12.62 source inspected after checksum verification; not compiled or executed.
Evidence limits: Official documentation and release-source inspection; independent mathematics. No native Gnumeric execution, application screenshots, locale tests or cross-application workbook round-trips.