Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function "_ARCSEC()" is wrong?
#12
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:

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!
Reply


Messages In This Thread
function "_ARCSEC()" is wrong? - by BSpinoza - 10-28-2023, 05:44 AM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 01:40 PM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-28-2023, 01:53 PM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 02:42 PM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 02:56 PM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 04:42 PM
RE: function "_ARCSEC()" is wrong? - by BSpinoza - 10-29-2023, 06:04 AM
RE: function "_ARCSEC()" is wrong? - by BSpinoza - 10-30-2023, 09:22 AM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-30-2023, 10:24 AM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-30-2023, 02:42 PM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-31-2023, 04:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Function Pointers? BlameTroi 5 244 02-20-2026, 05:55 PM
Last Post: BlameTroi
  TYPE and CONST within SUB/FUNCTION TerryRitchie 9 1,955 07-11-2023, 01:22 AM
Last Post: bplus
  Query to function _InputBox$ Petr 10 2,045 03-31-2023, 09:53 PM
Last Post: mnrvovrfc
  instr function in reverse ??? doppler 3 755 02-10-2023, 02:33 PM
Last Post: doppler
  Variable as a reference or value to a function Kernelpanic 22 4,264 08-08-2022, 07:41 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: