IMSEC Function (OpenOffice Calc)
Find complex secants in Apache OpenOffice, with reciprocal-cosine examples, even symmetry and precision cautions near poles.
Verification status: Eight reference formulas and 5 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using generated native-ODF input and GUI hard recalculation. Saved formula identities and typed results were checked. How formula examples are checked
Quick answer: =IMSEC("1+i") returned 0.498337030555187+0.591083841721045i in the tested Apache OpenOffice 4.1.16 build.
Availability and version history
- Introduced: First release not established; the pinned 4.1.16 source confirms current-release presence.
- Supported in: Apache OpenOffice 4.1.16; this identifies a verified release, not a final supported version.
- Scope: Desktop Calc with its Analysis add-in, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated from generated native-ODF input in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.
What IMSEC returns
IMSEC returns the reciprocal of complex cosine where cosine is nonzero. It does not calculate an inverse cosine angle. The output is formatted complex-number text, even when the imaginary component vanishes. For z=a+bi, the independent component formula is sec(a+bi)=[2 cos(a)cosh(b)+2i sin(a)sinh(b)]/[cosh(2b)+cos(2a)]. Release entry.
Syntax and arguments
=IMSEC(ComplexNumber)
Exactly one complex-number argument is required. The add-in parses pure real forms and complex strings with lowercase i or j. Its strict parser rejects nonempty malformed text and empty strings. The trigonometric angles in the component formulas are in radians, not degrees.
Reproducible examples
The native column records the saved 4.1.16 results. The native strings are retained exactly. Independent component references are rounded to twelve decimal places, with rounded negative zero shown as zero. A tiny stored residual can therefore appear in the native string beside a reference component rounded to zero. Every successful result below is string-typed, including pure real-looking outputs.
| Formula | Native 4.1.16 string | Independent (real, imaginary) reference |
|---|---|---|
=IMSEC("1+i") |
0.498337030555187+0.591083841721045i |
(0.498337030555, 0.591083841721) |
=IMSEC("1-i") |
0.498337030555187-0.591083841721045i |
(0.498337030555, -0.591083841721) |
=IMSEC("-1+i") |
0.498337030555187-0.591083841721045i |
(0.498337030555, -0.591083841721) |
=IMSEC("-1-i") |
0.498337030555187+0.591083841721045i |
(0.498337030555, 0.591083841721) |
=IMSEC("1") |
1.85081571768093 |
(1.850815717681, 0) |
=IMSEC("i") |
0.648054273663885 |
(0.648054273664, 0) |
=IMSEC("0.5+0.25i") |
1.08535860475161+0.145220628661436i |
(1.085358604752, 0.145220628661) |
=IMSEC("2+0.5i") |
-1.05517978421926+1.0654618887767i |
(-1.055179784219, 1.065461888777) |
Practical worksheet
For 1+i, the components are approximately 0.498337030555 and +0.591083841721. The plus sign in the imaginary numerator is part of the reciprocal of cosine’s negative-imaginary result. At a purely imaginary input i, sec(i)=1/cosh(1), a positive real value smaller than 1.
For a worksheet, place a validated complex value in A2 and use =IMSEC(A2). This is an illustrative layout for the tested literal argument. Keeping real and imaginary measurements separately can make unit, sign and parsing mistakes easier to detect.
Advanced interpretation and checks
Secant is even: sec(−z)=sec(z). It respects conjugation and satisfies sec(z)cos(z)=1 where cosine is nonzero. The identity sec(z)²=1+tan(z)² involves complex squares; squared magnitudes are not a replacement.
On the real axis, cosine vanishes at π/2+kπ. Close to these locations, a small change in the argument can make a large change in the secant. Use an input-precision analysis and an appropriate tolerance when checking a reciprocal near a pole.
Boundaries and troubleshooting
Zero is valid and returns 1, unlike the zero-input pole of cosecant or cotangent. The diagnostics confirm invalid text, empty strings and an extra argument separately. A finite value near an approximate pole does not establish that the mathematical pole is valid. Nonfinite output components are rejected by the shared formatter.
These additional formulas were recalculated through the same generated-ODF path. Error displays are retained as errors, even when an ODS numeric attribute stores zero.
| Formula | Observed result or error |
|---|---|
=IMSEC("0") |
1 |
=IMSEC("abc") |
Err:502 |
=IMSEC("") |
Err:502 |
=IMSEC("1+j") |
0.498337030555187+0.591083841721045j |
=IMSEC("1";2) |
Err:504 |
Other spreadsheet implementations
The IMSEC guide for LibreOffice Calc documents that product’s own syntax and tested behavior. A shared function name does not guarantee the same argument conversion, text parsing, branch or precision rules.
Official evidence and checking scope
- Function-specific release entry
- Complex algorithm or collection helper
- Strict complex-string parser
- Finite-output string formatter
The saved ODS retained every tested formula identity. A deliberately stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. The application reported “Not all attributes could be read” on loading the generated input. All tested identities and input text survived, but preservation of every style attribute was not established. Native evidence covers the eight reference formulas and listed diagnostics only; it does not establish XLSX-import or manual-entry behavior. Other explanatory compositions are independent mathematical checks; other releases, locales and extreme-value behavior were not established by this run.