csch
Calculates the hyperbolic cosecant of a numeric value.
Use the csch() function to calculate the hyperbolic cosecant of a numeric value. The hyperbolic cosecant is the reciprocal of the hyperbolic sine function.
Syntax
csch(<number>)Parameters
number
integer, float
Yes
The numeric value for which to calculate the hyperbolic cosecant. The value must not be zero.
Returns
Type: float
Description: The csch() function returns the hyperbolic cosecant of the input value, which is equivalent to 1 / sinh(x). If the input is null, the function returns null.
Usage notes
Input type: XQL doesn't support NaN or infinite values as input and these value types also can not be returned.
Valid Input Range: The
csch()function accepts any real number except zero, where the hyperbolic cosecant is undefined.Undefined at Zero:
csch(0)is undefined and returnsinfinity,NaN, ornull.Null Handling: If the input expression is
null, the function returnsnull.Symmetry: The function is odd, meaning
csch(-x) = -csch(x).Asymptotic Behavior: As
xapproaches positive or negative infinity,csch(x)approaches0.Common Use Cases: This function is typically used within the
alterstage for mathematical modeling, physics calculations, and scientific computations.
Examples
Example 1: Calculate hyperbolic cosecant of literal values
Goal: Calculate the hyperbolic cosecant for specific numeric literals to verify known mathematical results.
XQL code:
Explanation: You use csch() on three different literal values. csch(1) returns approximately 0.8509, csch(2) returns approximately 0.2757, and csch(-1) returns approximately -0.8509, demonstrating the odd symmetry of the function.
Output:
0.85092
0.27572
-0.85092
Example 2: Calculate hyperbolic cosecant from a field value
Goal: Calculate the hyperbolic cosecant of values stored in a dataset field, filtering out zero values.
XQL code:
Explanation: This query filters out zero values (where hyperbolic cosecant is undefined), then computes the hyperbolic cosecant for each remaining value in the numeric_value field.
Output:
101
0.5
1.91903
102
1.0
0.85092
103
3.0
0.09982
Example 3: Verify csch as reciprocal of sinh
Goal: Demonstrate that csch(x) equals 1 / sinh(x) by computing both and comparing.
XQL code:
Explanation: This query computes both csch(numeric_value) and 1 / sinh(numeric_value) to verify they produce the same result, confirming the mathematical identity csch(x) = 1 / sinh(x).
Output:
101
0.5
1.91903
1.91903
102
1.0
0.85092
0.85092
103
3.0
0.09982
0.09982
Related articles
Last updated
Was this helpful?
