10-30-2023, 09:22 AM
The same problem with QB64 _ARCCSC-Funktion: domain of x for real result: |x| >1 !
Pls. check this sources:
https://en.wikipedia.org/wiki/Inverse_tr..._functions
https://mathworld.wolfram.com/InverseCosecant.html
https://www.wolframalpha.com/input/?i=arccosec%28x%29
But in the QB64 help and WIKI:
Example:
gives: 0.52358...
But arccosec(0.5) is not defined!
The alternative formula for _ARCCSC(x):
arccosec(x) = arcsin(1/x)
This delivers:
0.52358...
nan
"nan" is correct here.
conclusion:
I think both functions _ARCSEC and _ARCCSC are not correct in QB64!
Pls. check this sources:
https://en.wikipedia.org/wiki/Inverse_tr..._functions
https://mathworld.wolfram.com/InverseCosecant.html
https://www.wolframalpha.com/input/?i=arccosec%28x%29
But in the QB64 help and WIKI:
Code: (Select All)
FUNCTION ARCCSC (x) ' Inverse CoSecant
IF x < 1 THEN ARCCSC = ATN(1 / SQR(1 - x * x)) + (SGN(x) - 1) * (2 * ATN(1)) ELSE BEEP
END FUNCTION
Example:
Code: (Select All)
PRINT _ARCCSC(0.5)
gives: 0.52358...
But arccosec(0.5) is not defined!
The alternative formula for _ARCCSC(x):
arccosec(x) = arcsin(1/x)
Code: (Select All)
PRINT _ARCCSC(0.5)
PRINT _ASIN(1 / 0.5)
This delivers:
0.52358...
nan
"nan" is correct here.
conclusion:
I think both functions _ARCSEC and _ARCCSC are not correct in QB64!