Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
antik
gsll
Commits
1a7e83f1
Commit
1a7e83f1
authored
Nov 24, 2011
by
Liam M. Healy
Browse files
Fix special function return sf-result and sf-result-e10 type specifications
parent
630a69bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
special-functions/exponential-functions.lisp
View file @
1a7e83f1
;; Exponential functions
;; Liam Healy, Tue Mar 21 2006 - 17:05
;; Time-stamp: <2011-1
0
-2
9
2
3:37:02ED
T exponential-functions.lisp>
;; Time-stamp: <2011-1
1
-2
4
2
2:56:28ES
T exponential-functions.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -20,6 +20,8 @@
(
in-package
:gsl
)
;;; /usr/include/gsl/gsl_sf_exp.h
;;;;****************************************************************************
;;;; Exponential Functions
;;;;****************************************************************************
...
...
@@ -30,7 +32,7 @@
"The exponential function."
)
(
defmfun
exp-scaled
(
x
)
"gsl_sf_exp_e10_e"
((
x
:double
)
(
ret
sf-result-e10
))
"gsl_sf_exp_e10_e"
((
x
:double
)
(
ret
(
:pointer
(
:struct
sf-result-e10
))
))
:documentation
; FDL
"The exponential function scaled. This function may be useful if the value
of exp(x) would overflow the numeric range of double."
)
...
...
@@ -43,7 +45,8 @@
return the product y \exp(x)."
)
(
defmfun
exp-mult-scaled
(
x
y
)
"gsl_sf_exp_mult_e10_e"
((
x
:double
)
(
y
:double
)
(
ret
sf-result-e10
))
"gsl_sf_exp_mult_e10_e"
((
x
:double
)
(
y
:double
)
(
ret
(
:pointer
(
:struct
sf-result-e10
))))
:documentation
; FDL
"The product y \exp(x) with extended numeric range."
)
...
...
@@ -71,7 +74,8 @@
2(\exp(x)-1-x)/x^2 = 1 + x/3 + x^2/(3*4) + x^3/(3*4*5) + ..."
)
(
defmfun
exprel-n
(
n
x
)
"gsl_sf_exprel_n_e"
((
n
:int
)
(
x
:double
)
(
ret
(
:pointer
(
:struct
sf-result
))))
"gsl_sf_exprel_n_e"
((
n
:int
)
(
x
:double
)
(
ret
(
:pointer
(
:struct
sf-result
))))
:documentation
; FDL
"N-relative exponential, which is the n-th generalization
of the functions #'exprel and #'exprel-2."
)
...
...
@@ -88,7 +92,7 @@
(
defmfun
exp-err-scaled
(
x
dx
)
"gsl_sf_exp_err_e10_e"
((
x
:double
)
(
dx
:double
)
(
ret
sf-result-e10
))
((
x
:double
)
(
dx
:double
)
(
ret
(
:pointer
(
:struct
sf-result-e10
))
))
:documentation
; FDL
"Exponentiate x with an associated absolute error dx
and with extended numeric range."
)
...
...
@@ -103,7 +107,8 @@
(
defmfun
exp-mult-err-scaled
(
x
dx
y
dy
)
"gsl_sf_exp_mult_err_e10_e"
((
x
:double
)
(
dx
:double
)
(
y
:double
)
(
dy
:double
)
(
ret
sf-result-e10
))
((
x
:double
)
(
dx
:double
)
(
y
:double
)
(
dy
:double
)
(
ret
(
:pointer
(
:struct
sf-result-e10
))))
:documentation
; FDL
"The product y \exp(x) for the quantities x, y
with associated absolute errors dx, dy and with
...
...
special-functions/gamma.lisp
View file @
1a7e83f1
;; Gamma functions
;; Liam Healy, Thu Apr 27 2006 - 22:06
;; Time-stamp: <2011-1
0-30 00:37:46ED
T gamma.lisp>
;; Time-stamp: <2011-1
1-24 22:42:00ES
T gamma.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -56,7 +56,7 @@
(
ret
(
:pointer
(
:struct
sf-result
)))
(
sign
(
:pointer
:double
)))
:return
((
multiple-value-bind
(
val
err
)
(
cffi:
convert-from-foreign
ret
'
(
:pointer
(
:struct
sf-result
))
)
(
cffi:
mem-ref
ret
'
(
:struct
sf-result
))
(
values
val
(
cffi:mem-ref
sign
:double
)
err
)))
:documentation
; FDL
"Compute the sign of the gamma function and the logarithm of
...
...
@@ -166,9 +166,9 @@
The computed parameters are result =
log(|(a)_x|) and sgn = sgn((a)_x) where (a)_x :=
Gamma(a + x)/Gamma(a), subject to a, a+x not being negative integers."
:return
((
multiple-value-bind
(
val
err
)
(
cffi:convert-from-foreign
ret
'
(
:pointer
(
:struct
sf-result
))
)
(
values
val
(
cffi:mem-ref
sign
:double
)
err
))))
:return
((
multiple-value-bind
(
val
err
)
(
cffi:mem-ref
ret
'
(
:struct
sf-result
))
(
values
val
(
cffi:mem-ref
sign
:double
)
err
))))
(
defmfun
relative-pochammer
(
a
x
)
"gsl_sf_pochrel_e"
...
...
special-functions/hypergeometric.lisp
View file @
1a7e83f1
;; Hypergeometric function
;; Liam Healy, Fri Apr 28 2006 - 23:00
;; Time-stamp: <2011-1
0
-2
9
2
3
:4
0:22ED
T hypergeometric.lisp>
;; Time-stamp: <2011-1
1
-2
4
2
2
:4
6:31ES
T hypergeometric.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -18,6 +18,8 @@
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; /usr/include/gsl/gsl_sf_hyperg.h
(
in-package
:gsl
)
(
defmfun
hypergeometric-0F1
(
c
x
)
...
...
@@ -72,7 +74,7 @@
(
defmfun
hypergeometric-U-e10
((
m
integer
)
(
n
integer
)
x
)
"gsl_sf_hyperg_U_int_e10_e"
((
m
:int
)
(
n
:int
)
(
x
:double
)
(
ret
sf-result-e10
))
((
m
:int
)
(
n
:int
)
(
x
:double
)
(
ret
(
:pointer
(
:struct
sf-result-e10
))
))
:definition
:method
:export
t
:documentation
; FDL
...
...
@@ -82,7 +84,7 @@
(
defmfun
hypergeometric-U-e10
((
a
float
)
(
b
float
)
x
)
"gsl_sf_hyperg_U_e10_e"
((
a
:double
)
(
b
:double
)
(
x
:double
)
(
ret
sf-result-e10
))
((
a
:double
)
(
b
:double
)
(
x
:double
)
(
ret
(
:pointer
(
:struct
sf-result-e10
))
))
:definition
:method
:documentation
; FDL
"The confluent hypergeometric function
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment