update major trigonometric help files and regression tests

Improved help files for sin, cos, tan, cot, sec, csc.  In case
of tan, cot, sec, csc corrected help file was corrected to
indicate that complex arguments are allowed.  This was a help
file oversight from long ago when those trigonometric functions

Expanded the calc regression test suite test 34dd to test various
real and complex values for sin, cos, tan, cot, sec, csc.
This commit is contained in:
Landon Curt Noll
2023-09-10 16:33:31 -07:00
parent 78d536140f
commit a722b5cca7
8 changed files with 214 additions and 8 deletions

View File

@@ -25,6 +25,9 @@ EXAMPLE
; print cos(pi/3, 1e-10), cos(pi/2, 1e-10), cos(pi, 1e-10)
0.5 0 -1
; print cos(1/2), cos(5/7), cos(42/7)
0.87758256189037271612 0.75556134670069659847 0.96017028665036602055
LIMITS
0 < eps < 1

View File

@@ -5,7 +5,7 @@ SYNOPSIS
cot(x [,eps])
TYPES
x nonzero real
x number (real or complex)
eps 0 < real < 1, defaults to epsilon()
return real
@@ -18,12 +18,21 @@ EXAMPLE
; print cot(1, 1e-5), cot(1, 1e-10), cot(1, 1e-15), cot(1, 1e-20)
0.64209 0.6420926159 0.642092615934331 0.64209261593433070301
; print cot(2 + 3i, 1e-5), cot(2 + 3i, 1e-10)
~-0.00373977357605613583-~0.99675796378381737782i ~-0.00373971037383300017-~0.99675779657435500069i
; pi = pi(1e-20)
; print cot(pi/12, 1e-10), cot(pi/6, 1e-10), cot(pi/3, 1e-10), cot(pi/2, 1e-10)
3.7320508076 1.7320508076 0.5773502692 0
; print cot(1/2), cot(5/7), cot(42/7)
1.83048772171245191927 1.15339160419695060142 -3.43635300418012783207
LIMITS
0 < eps < 1
LINK LIBRARY
NUMBER *qcot(NUMBER *x, NUMBER *eps)
COMPLEX *c_acot(COMPLEX *c, NUMBER *eps);
SEE ALSO
sin, cos, tan, sec, csc

View File

@@ -5,7 +5,7 @@ SYNOPSIS
csc(x [,eps])
TYPES
x real
x number (real or complex)
eps 0 < real < 1, defaults to epsilon()
return real
@@ -18,6 +18,16 @@ EXAMPLE
; print csc(1, 1e-5), csc(1, 1e-10), csc(1, 1e-15), csc(1, 1e-20)
1.1884 1.1883951058 1.188395105778121 1.18839510577812121626
; print csc(2 + 3i, 1e-5), csc(2 + 3i, 1e-10)
~0.09047318155450436310+~0.04120099965201690801i ~0.09047320975303232503+~0.04120098628887626238i
; pi = pi(1e-20)
; print csc(pi/6, 1e-10), csc(pi/3, 1e-10), csc(4*pi/3, 1e-10)
2 1.1547005384 -1.1547005384
; print csc(1/2), csc(5/7), csc(42/7)
2.08582964293348818577 1.52653601091884339347 -3.57889954725440563736
LIMITS
0 < eps < 1

View File

@@ -5,7 +5,7 @@ SYNOPSIS
sec(x [,eps])
TYPES
x real
x number (real or complex)
eps 0 < real < 1, defaults to epsilon()
return real
@@ -18,8 +18,17 @@ EXAMPLE
; print sec(1, 1e-5), sec(1, 1e-10), sec(1, 1e-15), sec(1, 1e-20)
1.85082 1.8508157177 1.850815717680926 1.85081571768092561791
; print sec(2 + 3i, 1e-5), sec(2 + 3i, 1e-10)
~-0.04167497639869547021+~0.09061109101765280898i ~-0.04167496441100888150+~0.09061113719571288336i
; pi = pi(1e-20)
; print 1e-10), sec(pi/6, 1e-10), sec(pi/3, 1e-10), sec(pi, 1e-10)
1.1547005384 2 -1
; print sec(1/2), sec(5/7), sec(42/7)
1.13949392732454912231 1.3235192673191814545 1.04148192659510767648
LIMITS
unlike sin and cos, x must be real
0 < eps < 1
LINK LIBRARY

View File

@@ -25,6 +25,9 @@ EXAMPLE
; print sin(pi/6, 1e-10), sin(pi/2, 1e-10), sin(pi, 1e-10)
0.5 1 0
; print sin(1/2), sin(5/7), sin(42/7)
0.47942553860420300027 0.6550778971785185742 -0.27941549819892587281
LIMITS
0 < eps < 1

View File

@@ -5,7 +5,7 @@ SYNOPSIS
tan(x [,eps])
TYPES
x real
x number (real or complex)
eps 0 < real < 1, defaults to epsilon()
return real
@@ -18,13 +18,21 @@ EXAMPLE
; print tan(1, 1e-5), tan(1, 1e-10), tan(1, 1e-15), tan(1, 1e-20)
1.55741 1.5574077247 1.557407724654902 1.55740772465490223051
; print tan(2 + 3i, 1e-5), tan(2 + 3i, 1e-10)
~-0.00376408798745471014+~1.00323845857938817252i ~-0.00376402563894634508+~1.00323862734859967572i
; pi = pi(1e-20)
; print tan(0, 1e-10), tan(pi/6, 1e-10), tan(pi/3, 1e-10), tan(pi, 1e-10)
0 0.5773502692 1.7320508076 0
; print tan(1/2), tan(5/7), tan(42/7)
0.54630248984379051326 0.8670082185107029875 -0.29100619138474915705
LIMITS
unlike sin and cos, x must be real
0 < eps < 1
LINK LIBRARY
NUMBER *qtan(NUMBER *x, NUMBER *eps)
COMPLEX *c_atan(COMPLEX *c, NUMBER *eps);
SEE ALSO
sin, cos, cot, sec, csc