Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function "_ARCSEC()" is wrong?
#1
One example:
Code: (Select All)
PRINT _ARCSEC(-2.5)

results in "illegal function call".

But " .... the domain of sec inverse x is (-∞, -1] U [1, ∞) (being the range of secant function) and the range of arcsec is [0, π/2) U (π/2, π] (principal branch of sec x). ..."

From: https://www.cuemath.com/trigonometry/sec-inverse-x/

The result should be 1.982313172862385.

An alternative formula gives the correct result:

arcsec(x) = acos(1/x)

Code: (Select All)
PRINT _ACOS(1/-2.5)

This works fine and delivers: 1.982313172862385. 

The Help says:
Quote:  FUNCTION ARCSEC (x) ' Inverse Secant
    IF x < 1 THEN ARCSEC = ATN(x / SQR(1 - x * x)) + (SGN(x) - 1) * (2 * ATN(1)) ELSE BEEP
END FUNCTION
 I think this is not correct!   

 Correct for the domain is:  |x| > 1 

What do our mathematical specialists think?
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



Users browsing this thread: 1 Guest(s)