Repository navigation
Modern Math CAtanh
Paul Squires edited this page Oct 19, 2026
·
5 revisions
Home › Math Library › Math Library › CAtanh
Returns the inverse hyperbolic tangent of a complex number, or of any real number.
CAtanh( byref z as Complex ) as Complex
CAtanh( byval x as float64 ) as Complex- Reached through the inverse trigonometric functions, so it inherits the Hull–Fairgrieve–Tang conditioning rather than carrying its own copy.
atanh z = -i·atan( iz ). -
Cut along the real axis beyond ±1, and that segment cannot be reached through
CAtan: forming1 + izadds+0.0to-0.0, IEEE gives+0.0, and the bit that decides the side of the cut is gone before the logarithm sees it. It is computed directly —atanh( x ± 0i ) = atanh( 1/x ) ± iπ/2. - The imaginary axis is answered directly too:
atanh( ±0 + yi ) = ±0 + i·atan( y ). - The
float64overload is AfxNova'sCArcTanHReal. -
CAtanh( ±1 )is infinite, which is the true value.
#import "std/numeric"
using numeric
print CToString( CAtanh( CSet( 0.5, 0.25 ) ) ) '' 0.5003700000525311+0.3143981432077165i
print CToString( CAtanh( 2.0 ) ) '' 0.5493061443340549+1.5707963267948966i -- outside the real function's domain
print CToString( CAtanh( CSet( 2, -0.0 ) ) ) '' 0.5493061443340549-1.5707963267948966i -- the other side of the cut
print CToString( CAtanh( 0.5 ) ) '' 0.5493061443340549+0i -- inside it, so simply realLibrary: Math Library
Category: Math Library
Documented under: Members
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing