Compute the inverse hyperbolic sine of a real number.
ASINH(expr)
## Overview Returns the inverse hyperbolic sine of the input. Unlike ASIN, ASINH has no domain restriction: every real number is a valid input. It is the algebraic inverse of SINH across the entire real line and is equivalent to LN(x + SQRT(x*x + 1)). ASINH is popular in statistics and machine learning as a 'signed log' transform. Unlike LN, which is undefined for non-positive values, ASINH accepts the full real line while still producing a roughly logarithmic growth pattern for large magnitudes. This makes it useful for visualizing data with heavy tails in both directions (for example, profit-and-loss columns). ## Behavior - Domain: all finite DOUBLE values. - Range: all real numbers. - Returns NULL if the argument is NULL. - Is anti-symmetric: ASINH(-x) = -ASINH(x). - Grows like LN(2*|x|) for large |x|. - ASINH(SINH(x)) equals x for all real x. ## Numeric precision - Uses the IEEE 754 double-precision asinh routine, accurate to within one ULP. - Does not suffer the catastrophic cancellation that the naive closed form LN(x + SQRT(x*x + 1)) exhibits for large negative x; call ASINH directly rather than recomputing. - Near zero, ASINH(x) is numerically close to x. ## Compatibility - Conforms to the SQL standard definition of ASINH as a scalar DOUBLE function. - Matches typical mathematical library implementations.
| Name | Type | Description |
|---|---|---|
expr | Specifies the real-valued input. Accepts any finite DOUBLE value; no domain restriction. |
-- Basic literal
SELECT ASINH(0);
-- Result: 0.0
-- Inverse hyperbolic sine of 1
SELECT ASINH(1);
-- Result: 0.8813736198295702
-- Negative input
SELECT ASINH(-2.5);
-- Result: -1.6472311463710958
-- Round trip: ASINH(SINH(x)) = x
SELECT ASINH(SINH(4.0));
-- Result: 4.0
-- Closed form: ASINH(x) = LN(x + SQRT(x*x + 1))
SELECT ASINH(2), LN(2 + SQRT(5));
-- Result: 1.4436354751788103, 1.4436354751788103
-- Column use: signed log-like transform for features with both signs
SELECT customer_id, ASINH(net_balance) AS signed_log_balance
FROM finance.ledger.accounts;