Skip to content
Snippets Groups Projects
Commit 39a7af77 authored by liam's avatar liam
Browse files

Port special-functions/power.lisp, psi.lisp, synchrotron.lisp,

transport.lisp, trigonometry.lisp, zeta.lisp to new defun-gsl.


git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3096 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent 313da4b9
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
; description: Definition of GSLL system
; date:
; author: Liam Healy
; modified: Fri Jun 16 2006 - 22:21
; modified: Sat Jun 17 2006 - 23:03
;********************************************************
;;; $Id: $
......@@ -65,13 +65,12 @@
(:file "lambert")
(:file "legendre")
(:file "logarithm")
;;(:file "power")
;;(:file "psi")
;;(:file "synchrotron")
;;(:file "transport")
;;(:file "trigonometry")
;;(:file "zeta")
))
(:file "power")
(:file "psi")
(:file "synchrotron")
(:file "transport")
(:file "trigonometry")
(:file "zeta")))
#+future
(:file "sorting" :depends-on (init data))
#+future
......
......@@ -3,18 +3,21 @@
; description: Power
; date: Sun Apr 30 2006 - 22:46
; author: Liam M. Healy
; modified: Sun Apr 30 2006 - 22:48
; modified: Sat Jun 17 2006 - 22:26
;********************************************************
;;; $Id: $
(in-package :gsl)
(defun-gsl pow ((x :double) (n :int))
"gsl_sf_pow_int_e"
(defun-gsl pow (x n)
"gsl_sf_pow_int_e" ((x :double) (n :int) (ret sf-result))
:documentation "The power @math{x^n} for integer @var{n}. The
power is computed using the minimum number of multiplications. For
example, @math{x^8} is computed as @math{((x^2)^2)^2}, requiring only 3
multiplications. For reasons of efficiency, these functions do not
check for overflow or underflow conditions."
:return (sf-result))
check for overflow or underflow conditions.")
(lisp-unit:define-test power
(lisp-unit:assert-first-fp-equal
"0.525218750000d+03"
(pow 3.5d0 5)))
......@@ -3,7 +3,7 @@
; description: Psi (digamma) functions
; date: Mon May 1 2006 - 22:11
; author: Liam M. Healy
; modified: Mon May 1 2006 - 22:25
; modified: Sat Jun 17 2006 - 22:30
;********************************************************
;;; $Id: $
......@@ -16,23 +16,21 @@
(defgeneric psi (x)
(:documentation "The psi, or digamma, function."))
(defun-gsl psi ((n :int))
"gsl_sf_psi_int_e"
:method ((n fixnum))
:documentation "Domain: n integer, n > 0."
:return (sf-result))
(defun-gsl psi ((n fixnum))
"gsl_sf_psi_int_e" ((n :int) (ret sf-result))
:type :method
:export t
:documentation "Domain: n integer, n > 0.")
(defun-gsl psi ((x :double))
"gsl_sf_psi_e"
:method ((x double-float))
:documentation "Domain: x /= 0.0, -1.0, -2.0, ..."
:return (sf-result))
(defun-gsl psi ((x double-float))
"gsl_sf_psi_e" ((x :double) (ret sf-result))
:type :method
:documentation "Domain: x /= 0.0, -1.0, -2.0, ...")
(defun-gsl psi-1piy ((x :double))
"gsl_sf_psi_1piy_e"
(defun-gsl psi-1+iy (x)
"gsl_sf_psi_1piy_e" ((x :double) (ret sf-result))
:documentation "The real part of the digamma function
on the line @math{1+i y}, @math{\Re[\psi(1 + i y)]}."
:return (sf-result))
on the line @math{1+i y}, @math{\Re[\psi(1 + i y)]}.")
;;;;****************************************************************************
;;;; Trigamma Function
......@@ -41,35 +39,34 @@
(defgeneric psi-1 (x)
(:documentation "The Trigamma function."))
(defun-gsl psi-1 ((n :int))
"gsl_sf_psi_1_int_e"
:method ((n fixnum))
:documentation "Domain: n integer, n > 0."
:return (sf-result))
(defun-gsl psi-1 ((n fixnum))
"gsl_sf_psi_1_int_e" ((n :int) (ret sf-result))
:type :method
:documentation "Domain: n integer, n > 0.")
(defun-gsl psi-1 ((x :double))
"gsl_sf_psi_1_e"
:method ((x double-float))
:documentation "Domain: x /= 0.0, -1.0, -2.0, ..."
:return (sf-result))
(defun-gsl psi-1 ((x double-float))
"gsl_sf_psi_1_e" ((x :double) (ret sf-result))
:type :method
:documentation "Domain: x /= 0.0, -1.0, -2.0, ...")
;;;;****************************************************************************
;;;; Polygamma
;;;;****************************************************************************
(defun-gsl psi-n ((m :int) (x :double))
"gsl_sf_psi_n_e"
(defun-gsl psi-n (m x)
"gsl_sf_psi_n_e" ((m :int) (x :double) (ret sf-result))
:documentation "The polygamma function @math{\psi^@{(m)@}(x)} for
@math{m >= 0}, @math{x > 0}."
:return (sf-result))
@math{m >= 0}, @math{x > 0}.")
;;;;****************************************************************************
;;;; Examples and unit test
;;;;****************************************************************************
(lisp-unit:define-test psi
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.125611766843d+01" (PSI 4))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.125611766843d+01" (PSI 4.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.283822955737d+00" (PSI-1 4))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.283822955737d+00" (PSI-1 4.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "-0.800397322451d-01" (PSI-N 2 4.0d0)))
(lisp-unit:assert-first-fp-equal "0.125611766843d+01" (psi 4))
(lisp-unit:assert-first-fp-equal "0.125611766843d+01" (psi 4.0d0))
(lisp-unit:assert-first-fp-equal "0.714591515374d+00" (psi-1+iy 2.0d0))
(lisp-unit:assert-first-fp-equal "0.283822955737d+00" (psi-1 4))
(lisp-unit:assert-first-fp-equal "0.283822955737d+00" (psi-1 4.0d0))
(lisp-unit:assert-first-fp-equal "-0.800397322451d-01" (psi-n 2 4.0d0)))
......@@ -3,28 +3,26 @@
; description: Synchrotron functions
; date: Mon May 1 2006 - 22:29
; author: Liam M. Healy
; modified: Mon May 1 2006 - 22:30
; modified: Sat Jun 17 2006 - 22:32
;********************************************************
;;; $Id: $
(in-package :gsl)
(defun-gsl synchrotron-1 ((x :double))
"gsl_sf_synchrotron_1_e"
(defun-gsl synchrotron-1 (x)
"gsl_sf_synchrotron_1_e" ((x :double) (ret sf-result))
:documentation "The first synchrotron function
@math{x \int_x^\infty dt K_@{5/3@}(t)} for @math{x >= 0}."
:return (sf-result))
@math{x \int_x^\infty dt K_@{5/3@}(t)} for @math{x >= 0}.")
(defun-gsl synchrotron-2 ((x :double))
"gsl_sf_synchrotron_2_e"
(defun-gsl synchrotron-2 (x)
"gsl_sf_synchrotron_2_e" ((x :double) (ret sf-result))
:documentation "The second synchrotron function
@math{x K_@{2/3@}(x)} for @math{x >= 0}."
:return (sf-result))
@math{x K_@{2/3@}(x)} for @math{x >= 0}.")
;;;;****************************************************************************
;;;; Examples and unit test
;;;;****************************************************************************
(lisp-unit:define-test synchrotron
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.528273966979d-01" (SYNCHROTRON-1 4.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.469232058261d-01" (SYNCHROTRON-2 4.0d0)))
(lisp-unit:assert-first-fp-equal "0.528273966979d-01" (synchrotron-1 4.0d0))
(lisp-unit:assert-first-fp-equal "0.469232058261d-01" (synchrotron-2 4.0d0)))
......@@ -3,7 +3,7 @@
; description: Transport functions
; date: Mon May 1 2006 - 22:29
; author: Liam M. Healy
; modified: Thu May 4 2006 - 23:18
; modified: Sat Jun 17 2006 - 22:33
;********************************************************
;;; $Id: $
......@@ -14,32 +14,28 @@
;;; @c{$J(n,x) := \int_0^x dt \, t^n e^t /(e^t - 1)^2$}
;;; @math{J(n,x) := \int_0^x dt t^n e^t /(e^t - 1)^2}.
(defun-gsl transport-2 ((x :double))
"gsl_sf_transport_2_e"
:documentation "The transport function @math{J(2,x)}."
:return (sf-result))
(defun-gsl transport-2 (x)
"gsl_sf_transport_2_e" ((x :double) (ret sf-result))
:documentation "The transport function @math{J(2,x)}.")
(defun-gsl transport-3 ((x :double))
"gsl_sf_transport_3_e"
:documentation "The transport function @math{J(3,x)}."
:return (sf-result))
(defun-gsl transport-3 (x)
"gsl_sf_transport_3_e" ((x :double) (ret sf-result))
:documentation "The transport function @math{J(3,x)}.")
(defun-gsl transport-4 ((x :double))
"gsl_sf_transport_4_e"
:documentation "The transport function @math{J(4,x)}."
:return (sf-result))
(defun-gsl transport-4 (x)
"gsl_sf_transport_4_e" ((x :double) (ret sf-result))
:documentation "The transport function @math{J(4,x)}.")
(defun-gsl transport-5 ((x :double))
"gsl_sf_transport_5_e"
:documentation "The transport function @math{J(5,x)}."
:return (sf-result))
(defun-gsl transport-5 (x)
"gsl_sf_transport_5_e" ((x :double) (ret sf-result))
:documentation "The transport function @math{J(5,x)}.")
;;;;****************************************************************************
;;;; Examples and unit test
;;;;****************************************************************************
(lisp-unit:define-test transport
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.280666640456d+01" (TRANSPORT-2 4.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.457921743723d+01" (TRANSPORT-3 4.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.107319323930d+02" (TRANSPORT-4 4.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.294883390152d+02" (TRANSPORT-5 4.0d0)))
(lisp-unit:assert-first-fp-equal "0.280666640456d+01" (transport-2 4.0d0))
(lisp-unit:assert-first-fp-equal "0.457921743723d+01" (transport-3 4.0d0))
(lisp-unit:assert-first-fp-equal "0.107319323930d+02" (transport-4 4.0d0))
(lisp-unit:assert-first-fp-equal "0.294883390152d+02" (transport-5 4.0d0)))
......@@ -3,15 +3,12 @@
; description: Trigonometry
; date: Thu May 4 2006 - 22:58
; author: Liam M. Healy
; modified: Thu May 4 2006 - 23:41
; modified: Sat Jun 17 2006 - 22:59
;********************************************************
;;; $Id: $
(in-package :gsl)
;;; complex gsl-sin, gsl-cos, log-sin, need to return complex.
;;; restrict-symmetric, restrict-positive cause memory fault.
;;;;****************************************************************************
;;;; Circular Trigonometric Functions
;;;;****************************************************************************
......@@ -22,124 +19,152 @@
(defgeneric gsl-cos (x)
(:documentation "The cosine function @math{\sin(x)}."))
(defun-gsl gsl-sin ((x :double))
"gsl_sf_sin_e"
:method ((x double-float))
:return (sf-result))
(defun-gsl gsl-cos ((x :double))
"gsl_sf_cos_e"
:method ((x double-float))
:return (sf-result))
(defun-gsl hypotenuse ((x :double) (y :double))
"gsl_sf_hypot_e"
:documentation "The hypotenuse function @math{\sqrt@{x^2 + y^2@}}."
:return (sf-result))
(defun-gsl sinc ((x :double))
"gsl_sf_sinc_e"
:documentation "@math{\sinc(x) = \sin(\pi x) / (\pi x)}"
:return (sf-result))
(defun-gsl gsl-sin ((x double-float))
"gsl_sf_sin_e" ((x :double) (ret sf-result))
:type :method
:export t)
;;; Return complex
(defun-gsl gsl-sin (((realpart x) :double) ((imagpart x) :double))
(defun-gsl gsl-sin ((x complex))
"gsl_sf_complex_sin_e"
:method ((x complex))
:return (sf-result sf-result))
(defun-gsl gsl-cos (((realpart x) :double) ((imagpart x) :double))
(((realpart x) :double) ((imagpart x) :double)
(re-ret sf-result) (im-ret sf-result))
:type :method
:return ((complex (val re-ret) (val im-ret))
(complex (err re-ret) (err im-ret))))
(defun-gsl gsl-cos ((x double-float))
"gsl_sf_cos_e" ((x :double) (ret sf-result))
:type :method
:export t)
(defun-gsl gsl-cos ((x complex))
"gsl_sf_complex_cos_e"
:method ((x complex))
:return (sf-result sf-result))
(((realpart x) :double) ((imagpart x) :double)
(re-ret sf-result) (im-ret sf-result))
:type :method
:return ((complex (val re-ret) (val im-ret))
(complex (err re-ret) (err im-ret))))
(defun-gsl hypotenuse (x y)
"gsl_sf_hypot_e" ((x :double) (y :double) (ret sf-result))
:documentation "The hypotenuse function @math{\sqrt@{x^2 + y^2@}}.")
(defun-gsl sinc (x)
"gsl_sf_sinc_e" ((x :double) (ret sf-result))
:documentation "@math{\sinc(x) = \sin(\pi x) / (\pi x)}")
(defun-gsl log-sin (((realpart x) :double) ((imagpart x) :double))
(defun-gsl log-sin (x)
"gsl_sf_complex_logsin_e"
:method ((x complex))
(((realpart x) :double) ((imagpart x) :double)
(re-ret sf-result) (im-ret sf-result))
:documentation "This function computes the logarithm of the complex sine,
@math{\log(\sin(z_r + i z_i))} storing the real and imaginary parts in
@var{szr}, @var{szi}."
:return (sf-result sf-result))
:return ((complex (val re-ret) (val im-ret))
(complex (err re-ret) (err im-ret))))
;;;;****************************************************************************
;;;; Hyperbolic Trigonometric Functions
;;;;****************************************************************************
(defun-gsl log-sinh ((x :double))
"gsl_sf_lnsinh_e"
(defun-gsl log-sinh (x)
"gsl_sf_lnsinh_e" ((x :double) (ret sf-result))
:documentation "Logarithm of sinh function, special functions
These routines compute @math{\log(\sinh(x))} for @math{x > 0}."
:return (sf-result))
These routines compute @math{\log(\sinh(x))} for @math{x > 0}.")
(defun-gsl log-cosh ((x :double))
"gsl_sf_lncosh_e"
(defun-gsl log-cosh (x)
"gsl_sf_lncosh_e" ((x :double) (ret sf-result))
:documentation "Logarithm of cosh function, special functions
These routines compute @math{\log(\cosh(x))} for any @var{x}."
:return (sf-result))
These routines compute @math{\log(\cosh(x))} for any @var{x}.")
;;;;****************************************************************************
;;;; Conversion Functions
;;;;****************************************************************************
(defun-gsl polar-to-rectangular ((r :double) (theta :double))
(defun-gsl polar-to-rectangular (r theta)
"gsl_sf_polar_to_rect"
((r :double) (theta :double) (x sf-result) (y sf-result))
:documentation "Convert the polar coordinates (@var{r},@var{theta}) to
rectilinear coordinates (@var{x},@var{y}), @math{x = r\cos(\theta)},
@math{y = r\sin(\theta)}."
:return (sf-result sf-result))
:return ((val x) (val y) (err x) (err y)))
(defun-gsl rectangular-to-polar ((x :double) (y :double))
(defun-gsl rectangular-to-polar (x y)
"gsl_sf_rect_to_polar"
((x :double) (y :double) (r sf-result) (theta sf-result))
:documentation "Convert the rectilinear coordinates (@var{x},@var{y}) to
polar coordinates (@var{r},@var{theta}), such that @math{x =
r\cos(\theta)}, @math{y = r\sin(\theta)}. The argument @var{theta}
lies in the range @math{[-\pi, \pi]}."
:return (sf-result sf-result))
:return ((val r) (val theta) (err r) (err theta)))
;;;;****************************************************************************
;;;; Restriction Functions
;;;;****************************************************************************
;;; memory fault
(defun-gsl restrict-symmetric ((theta :double))
"gsl_sf_angle_restrict_symm_e"
(defun-gsl restrict-symmetric (theta)
"gsl_sf_angle_restrict_symm" ((theta :double))
:c-return :double
:documentation "Force the angle @var{theta} to lie in the range
@math{(-\pi,\pi]}."
:return (sf-result))
@math{(-\pi,\pi]}.")
(defun-gsl restrict-positive ((theta :double))
"gsl_sf_angle_restrict_pos_e"
(defun-gsl restrict-positive (theta)
"gsl_sf_angle_restrict_pos" ((theta :double))
:c-return :double
:documentation "Force the angle @var{theta} to lie in
the range @math{[0,2\pi)}."
:return (sf-result))
the range @math{[0,2\pi)}.")
;;;;****************************************************************************
;;;; Trigonometric Functions With Error Estimates
;;;;****************************************************************************
(defun-gsl sin-err ((x :double) (dx :double))
"gsl_sf_sin_err_e"
(defun-gsl sin-err (x dx)
"gsl_sf_sin_err_e" ((x :double) (dx :double) (ret sf-result))
:documentation "Compute the sine of an angle @var{x} with
an associated absolute error @var{dx}, @math{\sin(x \pm dx)}."
:return (sf-result))
an associated absolute error @var{dx}, @math{\sin(x \pm dx)}.")
(defun-gsl cos-err ((x :double) (dx :double))
"gsl_sf_cos_err_e"
(defun-gsl cos-err (x dx)
"gsl_sf_cos_err_e" ((x :double) (dx :double) (ret sf-result))
:documentation "The cosine of an angle @var{x} with an associated
absolute error @var{dx}, @math{\cos(x \pm dx)}."
:return (sf-result))
absolute error @var{dx}, @math{\cos(x \pm dx)}.")
;;;;****************************************************************************
;;;; Examples and unit test
;;;;****************************************************************************
(lisp-unit:define-test trigonometry
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.841470984808d+00" (GSL-SIN 1.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.540302305868d+00" (GSL-COS 1.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.223606797750d+01" (HYPOTENUSE 1.0d0 2.0d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.636619772368d+00" (SINC 0.5d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "-0.651822325947d+00" (LOG-SINH 0.5d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.120114506958d+00" (LOG-COSH 0.5d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.479425538604d+00" (SIN-ERR 0.5d0 0.01d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.877582561890d+00" (COS-ERR 0.5d0 0.01d0))
)
(lisp-unit:assert-first-fp-equal "0.841470984808d+00" (gsl-sin 1.0d0))
(lisp-unit:assert-equal
'("0.129845758142d+01" "0.634963914785d+00")
(lisp-unit::fp-string (gsl-sin #C(1.0d0 1.0d0))))
(lisp-unit:assert-first-fp-equal "0.540302305868d+00" (gsl-cos 1.0d0))
(lisp-unit:assert-equal
'("0.833730025131d+00" "-0.988897705763d+00")
(lisp-unit::fp-string (gsl-cos #C(1.0d0 1.0d0))))
(lisp-unit:assert-first-fp-equal
"0.223606797750d+01"
(hypotenuse 1.0d0 2.0d0))
(lisp-unit:assert-first-fp-equal "0.636619772368d+00" (sinc 0.5d0))
(lisp-unit:assert-equal
'("0.368383731425d+00" "0.454820233310d+00")
(lisp-unit::fp-string (log-sin #C(1.0d0 1.0d0))))
(lisp-unit:assert-first-fp-equal "-0.651822325947d+00" (log-sinh 0.5d0))
(lisp-unit:assert-first-fp-equal "0.120114506958d+00" (log-cosh 0.5d0))
(lisp-unit:assert-equal
'("0.108060461174d+01" "0.168294196962d+01")
(lisp-unit::fp-sequence
(subseq (multiple-value-list
(polar-to-rectangular 2.0d0 1.0d0))
0 2)))
(lisp-unit:assert-equal
'("0.223606797750d+01" "0.463647609001d+00")
(lisp-unit::fp-sequence
(subseq (multiple-value-list (rectangular-to-polar 2.0d0 1.0d0)) 0 2)))
(lisp-unit:assert-first-fp-equal
"-0.128318530718d+01"
(restrict-symmetric 5.0d0))
(lisp-unit:assert-first-fp-equal
"0.528318530718d+01"
(restrict-positive -1.0d0))
(lisp-unit:assert-first-fp-equal "0.479425538604d+00" (sin-err 0.5d0 0.01d0))
(lisp-unit:assert-first-fp-equal "0.877582561890d+00" (cos-err 0.5d0 0.01d0)))
......@@ -3,7 +3,7 @@
; description: Zeta functions
; date: Sat May 13 2006 - 23:27
; author: Liam M. Healy
; modified: Sat May 13 2006 - 23:52
; modified: Sat Jun 17 2006 - 23:02
;********************************************************
;;; $Id: $
......@@ -19,19 +19,18 @@
(defgeneric zeta (x)
(:documentation "The Riemann zeta function @math{\zeta(n)}."))
(defun-gsl zeta ((n :int))
"gsl_sf_zeta_int_e"
(defun-gsl zeta ((n fixnum))
"gsl_sf_zeta_int_e" ((n :int) (ret sf-result))
:type :method
:export t
:documentation "The Riemann zeta function @math{\zeta(n)}
for integer @var{n}, @math{n \ne 1}."
:method ((n fixnum))
:return (sf-result))
for integer @var{n}, @math{n \ne 1}.")
(defun-gsl zeta ((s :double))
"gsl_sf_zeta_e"
(defun-gsl zeta ((s double-float))
"gsl_sf_zeta_e" ((s :double) (ret sf-result))
:documentation "The Riemann zeta function @math{\zeta(s)}
for arbitrary @var{s}, @math{s \ne 1}."
:method ((s double-float))
:return (sf-result))
:type :method)
;;;;****************************************************************************
;;;; Riemann Zeta Function Minus One
......@@ -40,48 +39,45 @@
(defgeneric zeta-1 (x)
(:documentation "zeta - 1."))
(defun-gsl zeta-1 ((n :int))
"gsl_sf_zetam1_int_e"
(defun-gsl zeta-1 ((n fixnum))
"gsl_sf_zetam1_int_e" ((n :int) (ret sf-result))
:documentation "The Riemann zeta function @math{\zeta(n)}
for integer @var{n}, @math{n \ne 1}."
:method ((n fixnum))
:return (sf-result))
:type :method
:export t)
(defun-gsl zeta-1 ((s :double))
"gsl_sf_zetam1_e"
(defun-gsl zeta-1 ((s double-float))
"gsl_sf_zetam1_e" ((s :double) (ret sf-result))
:documentation "The Riemann zeta function @math{\zeta(s)}
for arbitrary @var{s}, @math{s \ne 1}."
:method ((s double-float))
:return (sf-result))
:type :method)
;;;;****************************************************************************
;;;; Hurwitz Zeta Function
;;;;****************************************************************************
(defun-gsl hurwitz-zeta ((s :double) (q :double))
"gsl_sf_hzeta_e"
(defun-gsl hurwitz-zeta (s q)
"gsl_sf_hzeta_e" ((s :double) (q :double) (ret sf-result))
:documentation "The Hurwitz zeta function @math{\zeta(s,q)} for
@math{s > 1}, @math{q > 0}."
:return (sf-result))
@math{s > 1}, @math{q > 0}.")
;;;;****************************************************************************
;;;; Eta Function
;;;;****************************************************************************
(defun-gsl eta ((s :double))
"gsl_sf_eta_e"
:documentation "The eta function @math{\eta(s)} for arbitrary @var{s}."
:return (sf-result))
(defun-gsl eta (s)
"gsl_sf_eta_e" ((s :double) (ret sf-result))
:documentation "The eta function @math{\eta(s)} for arbitrary @var{s}.")
;;;;****************************************************************************
;;;; Examples and unit test
;;;;****************************************************************************
(lisp-unit:define-test zeta
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.164493406685d+01" (ZETA 2))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.261237534869d+01" (ZETA 1.5d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.644934066848d+00" (ZETA-1 2))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.161237534869d+01" (ZETA-1 1.5d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.140377976886d+01"
(HURWITZ-ZETA 1.5d0 2.5d0))
(LISP-UNIT:ASSERT-FIRST-FP-EQUAL "0.765147024625d+00" (ETA 1.5d0)))
(lisp-unit:assert-first-fp-equal "0.164493406685d+01" (zeta 2))
(lisp-unit:assert-first-fp-equal "0.261237534869d+01" (zeta 1.5d0))
(lisp-unit:assert-first-fp-equal "0.644934066848d+00" (zeta-1 2))
(lisp-unit:assert-first-fp-equal "0.161237534869d+01" (zeta-1 1.5d0))
(lisp-unit:assert-first-fp-equal "0.140377976886d+01"
(hurwitz-zeta 1.5d0 2.5d0))
(lisp-unit:assert-first-fp-equal "0.765147024625d+00" (eta 1.5d0)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment