Skip to content

Commit 720e95d

Browse files
add better error checking for dual numbers
1 parent 123e404 commit 720e95d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "HypergeometricFunctions"
22
uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
3-
version = "0.3"
3+
version = "0.3.1"
44

55
[deps]
66
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"

src/specialfunctions.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
@inline errcheck(x, y, tol) = isfinite(x) && isfinite(y) && (norm(x-y) > max(norm(x), norm(y))*tol)
1+
@inline norm2(x) = norm(x)
2+
@inline norm2(x::Dual) = hypot(x.value, x.epsilon)
3+
4+
@inline errcheck(x, y, tol) = isfinite(x) && isfinite(y) && (norm2(x-y) > max(norm2(x), norm2(y))*tol)
25

36
# Same as in FastTransforms.jl
47
"""

0 commit comments

Comments
 (0)