Mercurial > hg > octave-lojdl
changeset 2743:fa632c35437a
[project @ 1997-02-26 06:58:05 by jwe]
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acos-1.m @@ -0,0 +1,7 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = [0, pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +x = [1, rt3/2, rt2/2, 1/2, 0, -1/2, -rt2/2, -rt3/2, -1]; +all (abs (acos (x) - v) < sqrt (eps)) + +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acos-3.m @@ -0,0 +1,1 @@ +acos (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acosh-1.m @@ -0,0 +1,4 @@ +v = [0, pi/2*i, pi*i, pi/2*i]; +x = [1, 0, -1, 0]; +all (abs (acosh (x) - v) < sqrt (eps)) +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acosh-3.m @@ -0,0 +1,1 @@ +acosh (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acot-1.m @@ -0,0 +1,7 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = [pi/6, pi/4, pi/3, pi/2, -pi/3, -pi/4, -pi/6]; +x = [rt3, 1, rt3/3, 0, -rt3/3, -1, -rt3]; +all (abs (acot (x) - v) < sqrt (eps)) + +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acot-3.m @@ -0,0 +1,1 @@ +acot (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acoth-1.m @@ -0,0 +1,5 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = -i*[pi/6, pi/4, pi/3, -pi/3, -pi/4, -pi/6]; +x = i*[rt3, 1, rt3/3, -rt3/3, -1, -rt3]; +all (abs (acoth (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acoth-3.m @@ -0,0 +1,1 @@ +acoth (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acsc-1.m @@ -0,0 +1,6 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = [pi/6, pi/4, pi/3, pi/2, pi/3, pi/4, pi/6]; +x = [2, rt2, 2*rt3/3, 1, 2*rt3/3, rt2, 2]; +all (abs (acsc (x) - v) < sqrt (eps)) +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acsc-3.m @@ -0,0 +1,1 @@ +acsc (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acsch-1.m @@ -0,0 +1,4 @@ +v = [pi/2*i, -pi/2*i]; +x = [-i, i]; +all (abs (acsch (x) - v) < sqrt (eps)) +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/acsch-3.m @@ -0,0 +1,1 @@ +acsch (1, 2)
--- a/test/octave.test/arith/arith.exp +++ b/test/octave.test/arith/arith.exp @@ -62,11 +62,29 @@ set prog_output "error:.*" do_test floor-4.m -# gcd -# lcm -# log -# log10 -# log2 +set test gcd-1 +set prog_output "ans = 1" +do_test gcd-1.m + +set test gcd-2 +set prog_output "usage:.*" +do_test gcd-2.m + +set test gcd-3 +set prog_output "usage:.*" +do_test gcd-3.m + +set test lcm-1 +set prog_output "ans = 1" +do_test lcm-1.m + +set test lcm-2 +set prog_output "usage:.*" +do_test lcm-2.m + +set test lcm-3 +set prog_output "usage:.*" +do_test lcm-3.m set test max-1 set prog_output "ans = 1" @@ -271,30 +289,341 @@ set prog_output "error:.*" do_test real-4.m -# sin -# cos -# tan -# sec -# csc -# cot -# asin -# acos -# atan -# asec -# acsc -# acot -# cosh -# tanh -# sech -# csch -# coth -# asinh -# acosh -# atanh -# asech -# acsch -# acoth -# atan2 +set test log-1 +set prog_output "ans = 1" +do_test log-1.m + +set test log-2 +set prog_output "error:.*" +do_test log-2.m + +set test log-3 +set prog_output "error:.*" +do_test log-3.m + +set test log10-1 +set prog_output "ans = 1" +do_test log10-1.m + +set test log10-2 +set prog_output "error:.*" +do_test log10-2.m + +set test log10-3 +set prog_output "error:.*" +do_test log10-3.m + +set test log2-1 +set prog_output "ans = 1" +do_test log2-1.m + +set test log2-2 +set prog_output "error:.*" +do_test log2-2.m + +set test log2-3 +set prog_output "error:.*" +do_test log2-3.m + +set test sin-1 +set prog_output "ans = 1" +do_test sin-1.m + +set test sin-2 +set prog_output "error:.*" +do_test sin-2.m + +set test sin-3 +set prog_output "error:.*" +do_test sin-3.m + +set test cos-1 +set prog_output "ans = 1" +do_test cos-1.m + +set test cos-2 +set prog_output "error:.*" +do_test cos-2.m + +set test cos-3 +set prog_output "error:.*" +do_test cos-3.m + +set test tan-1 +set prog_output "ans = 1" +do_test tan-1.m + +set test tan-2 +set prog_output "error:.*" +do_test tan-2.m + +set test tan-3 +set prog_output "error:.*" +do_test tan-3.m + +set test sec-1 +set prog_output "ans = 1" +do_test sec-1.m + +set test sec-2 +set prog_output "error:.*" +do_test sec-2.m + +set test sec-3 +set prog_output "error:.*" +do_test sec-3.m + +set test csc-1 +set prog_output "ans = 1" +do_test csc-1.m + +set test csc-2 +set prog_output "error:.*" +do_test csc-2.m + +set test csc-3 +set prog_output "error:.*" +do_test csc-3.m + +set test cot-1 +set prog_output "ans = 1" +do_test cot-1.m + +set test cot-2 +set prog_output "error:.*" +do_test cot-2.m + +set test cot-3 +set prog_output "error:.*" +do_test cot-3.m + +set test asin-1 +set prog_output "ans = 1" +do_test asin-1.m + +set test asin-2 +set prog_output "error:.*" +do_test asin-2.m + +set test asin-3 +set prog_output "error:.*" +do_test asin-3.m + +set test acos-1 +set prog_output "ans = 1" +do_test acos-1.m + +set test acos-2 +set prog_output "error:.*" +do_test acos-2.m + +set test acos-3 +set prog_output "error:.*" +do_test acos-3.m + +set test atan-1 +set prog_output "ans = 1" +do_test atan-1.m + +set test atan-2 +set prog_output "error:.*" +do_test atan-2.m + +set test atan-3 +set prog_output "error:.*" +do_test atan-3.m + +set test asec-1 +set prog_output "ans = 1" +do_test asec-1.m + +set test asec-2 +set prog_output "error:.*" +do_test asec-2.m + +set test asec-3 +set prog_output "error:.*" +do_test asec-3.m + +set test acsc-1 +set prog_output "ans = 1" +do_test acsc-1.m + +set test acsc-2 +set prog_output "error:.*" +do_test acsc-2.m + +set test acsc-3 +set prog_output "error:.*" +do_test acsc-3.m + +set test acot-1 +set prog_output "ans = 1" +do_test acot-1.m + +set test acot-2 +set prog_output "error:.*" +do_test acot-2.m + +set test acot-3 +set prog_output "error:.*" +do_test acot-3.m + +set test sinh-1 +set prog_output "ans = 1" +do_test sinh-1.m + +set test sinh-2 +set prog_output "error:.*" +do_test sinh-2.m + +set test sinh-3 +set prog_output "error:.*" +do_test sinh-3.m + +set test cosh-1 +set prog_output "ans = 1" +do_test cosh-1.m + +set test cosh-2 +set prog_output "error:.*" +do_test cosh-2.m + +set test cosh-3 +set prog_output "error:.*" +do_test cosh-3.m + +set test tanh-1 +set prog_output "ans = 1" +do_test tanh-1.m + +set test tanh-2 +set prog_output "error:.*" +do_test tanh-2.m + +set test tanh-3 +set prog_output "error:.*" +do_test tanh-3.m + +set test sech-1 +set prog_output "ans = 1" +do_test sech-1.m + +set test sech-2 +set prog_output "error:.*" +do_test sech-2.m + +set test sech-3 +set prog_output "error:.*" +do_test sech-3.m + +set test csch-1 +set prog_output "ans = 1" +do_test csch-1.m + +set test csch-2 +set prog_output "error:.*" +do_test csch-2.m + +set test csch-3 +set prog_output "error:.*" +do_test csch-3.m + +set test coth-1 +set prog_output "ans = 1" +do_test coth-1.m + +set test coth-2 +set prog_output "error:.*" +do_test coth-2.m + +set test coth-3 +set prog_output "error:.*" +do_test coth-3.m + +set test asinh-1 +set prog_output "ans = 1" +do_test asinh-1.m + +set test asinh-2 +set prog_output "error:.*" +do_test asinh-2.m + +set test asinh-3 +set prog_output "error:.*" +do_test asinh-3.m + +set test acosh-1 +set prog_output "ans = 1" +do_test acosh-1.m + +set test acosh-2 +set prog_output "error:.*" +do_test acosh-2.m + +set test acosh-3 +set prog_output "error:.*" +do_test acosh-3.m + +set test atanh-1 +set prog_output "ans = 1" +do_test atanh-1.m + +set test atanh-2 +set prog_output "error:.*" +do_test atanh-2.m + +set test atanh-3 +set prog_output "error:.*" +do_test atanh-3.m + +set test asech-1 +set prog_output "ans = 1" +do_test asech-1.m + +set test asech-2 +set prog_output "error:.*" +do_test asech-2.m + +set test asech-3 +set prog_output "error:.*" +do_test asech-3.m + +set test acsch-1 +set prog_output "ans = 1" +do_test acsch-1.m + +set test acsch-2 +set prog_output "error:.*" +do_test acsch-2.m + +set test acsch-3 +set prog_output "error:.*" +do_test acsch-3.m + +set test acoth-1 +set prog_output "ans = 1" +do_test acoth-1.m + +set test acoth-2 +set prog_output "error:.*" +do_test acoth-2.m + +set test acoth-3 +set prog_output "error:.*" +do_test acoth-3.m + +set test atan2-1 +set prog_output "ans = 1" +do_test atan2-1.m + +set test atan2-2 +set prog_output "\n... atan2:.*" +do_test atan2-2.m + +set test atan2-3 +set prog_output "\n... atan2:.*" +do_test atan2-3.m set test sum-1 set prog_output "ans = 1" @@ -378,7 +707,19 @@ # beta # betai -# bincoeff + +set test bincoeff-1 +set prog_output "ans = 1" +do_test bincoeff-1.m + +set test bincoeff-2 +set prog_output "usage:.*" +do_test bincoeff-2.m + +set test bincoeff-3 +set prog_output "usage.*" +do_test bincoeff-3.m + # erf # erfc # erfinv
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asec-1.m @@ -0,0 +1,7 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = [0, pi/6, pi/4, pi/3, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +x = [1, 2*rt3/3, rt2, 2, -2, -rt2, -2*rt3/3, -1]; +all (abs (asec (x) - v) < sqrt (eps)) + +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asec-3.m @@ -0,0 +1,1 @@ +asec (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asech-1.m @@ -0,0 +1,4 @@ +v = [0, pi*i]; +x = [1, -1]; +all (abs (asech (x) - v) < sqrt (eps)) +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asech-3.m @@ -0,0 +1,1 @@ +asech (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asin-1.m @@ -0,0 +1,7 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = [0, pi/6, pi/4, pi/3, pi/2, pi/3, pi/4, pi/6, 0]; +x = [0, 1/2, rt2/2, rt3/2, 1, rt3/2, rt2/2, 1/2, 0]; +all (abs (asin (x) - v) < sqrt (eps)) + +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asin-3.m @@ -0,0 +1,1 @@ +asin (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asinh-1.m @@ -0,0 +1,4 @@ +v = [0, pi/2*i, 0, -pi/2*i]; +x = [0, i, 0, -i]; +all (abs (asinh (x) - v) < sqrt (eps)) +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/asinh-3.m @@ -0,0 +1,1 @@ +asinh (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/atan-1.m @@ -0,0 +1,7 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = [0, pi/6, pi/4, pi/3, -pi/3, -pi/4, -pi/6, 0]; +x = [0, rt3/3, 1, rt3, -rt3, -1, -rt3/3, 0]; +all (abs (atan (x) - v) < sqrt (eps)) + +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/atan-3.m @@ -0,0 +1,1 @@ +atan (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/atan2-1.m @@ -0,0 +1,7 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +v = [0, pi/6, pi/4, pi/3, -pi/3, -pi/4, -pi/6, 0]; +y = [0, rt3, 1, rt3, -rt3, -1, -rt3, 0]; +x = [1, 3, 1, 1, 1, 1, 3, 1]; +all (abs (atan2 (y, x) - v) < sqrt (eps)) +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/atan2-3.m @@ -0,0 +1,1 @@ +atan2 (1, 2, 3)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/atanh-1.m @@ -0,0 +1,4 @@ +v = [0, 0]; +x = [0, 0]; +all (abs (atanh (x) - v) < sqrt (eps)) +
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/atanh-3.m @@ -0,0 +1,1 @@ +atanh (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/bincoeff-1.m @@ -0,0 +1,1 @@ +bincoeff (5, 2) == 10 && bincoeff (50, 6) == 15890700
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/bincoeff-2.m @@ -0,0 +1,1 @@ +bincoeff ()
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/bincoeff-3.m @@ -0,0 +1,1 @@ +bincoeff (1, 2, 3)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/cos-1.m @@ -0,0 +1,5 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +x = [0, pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +v = [1, rt3/2, rt2/2, 1/2, 0, -1/2, -rt2/2, -rt3/2, -1]; +all (abs (cos (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/cosh-1.m @@ -0,0 +1,3 @@ +x = [0, pi/2*i, pi*i, 3*pi/2*i]; +v = [1, 0, -1, 0]; +all (abs (cosh (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/cosh-3.m @@ -0,0 +1,1 @@ +cosh (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/cot-1.m @@ -0,0 +1,5 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +x = [pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6]; +v = [rt3, 1, rt3/3, 0, -rt3/3, -1, -rt3]; +all (abs (cot (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/coth-1.m @@ -0,0 +1,3 @@ +x = [pi/2*i, 3*pi/2*i]; +v = [0, 0]; +all (abs (coth (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/coth-3.m @@ -0,0 +1,1 @@ +coth (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/csc-1.m @@ -0,0 +1,5 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +x = [pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6]; +v = [2, rt2, 2*rt3/3, 1, 2*rt3/3, rt2, 2]; +all (abs (csc (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/csch-1.m @@ -0,0 +1,3 @@ +x = [pi/2*i, 3*pi/2*i]; +v = [-i, i]; +all (abs (csch (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/csch-3.m @@ -0,0 +1,1 @@ +csch (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/gcd-1.m @@ -0,0 +1,2 @@ +(gcd (200, 300, 50, 35) == gcd ([200, 300, 50, 35]) + && gcd ([200, 300, 50, 35]) == 35)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/gcd-3.m @@ -0,0 +1,2 @@ +s.a = 1; +gcd (s)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/lcm-1.m @@ -0,0 +1,1 @@ +lcm (3, 5, 7, 15) == lcm ([3, 5, 7, 15]) && lcm ([3, 5, 7,15]) == 105
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/lcm-3.m @@ -0,0 +1,2 @@ +s.a = 1; +lcm (s)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/log-1.m @@ -0,0 +1,1 @@ +all (abs (log ([1, e, e^2]) - [0, 1, 2]) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/log10-1.m @@ -0,0 +1,1 @@ +all (abs (log10 ([0.01, 0.1, 1, 10, 100]) - [-2, -1, 0, 1, 2]) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/log10-3.m @@ -0,0 +1,1 @@ +log10 (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/log2-1.m @@ -0,0 +1,1 @@ +all (abs (log2 ([1/4, 1/2, 1, 2, 4]) - [-2, -1, 0, 1, 2]) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/log2-3.m @@ -0,0 +1,1 @@ +log2 (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sec-1.m @@ -0,0 +1,5 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +x = [0, pi/6, pi/4, pi/3, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +v = [1, 2*rt3/3, rt2, 2, -2, -rt2, -2*rt3/3, -1]; +all (abs (sec (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sech-1.m @@ -0,0 +1,3 @@ +x = [0, pi*i]; +v = [1, -1]; +all (abs (sech (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sech-3.m @@ -0,0 +1,1 @@ +sech (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sin-1.m @@ -0,0 +1,5 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +x = [0, pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +v = [0, 1/2, rt2/2, rt3/2, 1, rt3/2, rt2/2, 1/2, 0]; +all (abs (sin (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sinh-1.m @@ -0,0 +1,3 @@ +x = [0, pi/2*i, pi*i, 3*pi/2*i]; +v = [0, i, 0, -i]; +all (abs (sinh (x) - v) < sqrt (eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/sinh-3.m @@ -0,0 +1,1 @@ +sinh (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/arith/tan-1.m @@ -0,0 +1,5 @@ +rt2 = sqrt (2); +rt3 = sqrt (3); +x = [0, pi/6, pi/4, pi/3, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +v = [0, rt3/3, 1, rt3, -rt3, -1, -rt3/3, 0]; +all (abs (tan (x) - v) < sqrt (eps))