Skip to content

Commit dabcdd6

Browse files
committed
Fix compat issue
Signed-off-by: ErikQQY <[email protected]>
1 parent fa5bcc2 commit dabcdd6

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1616
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
1717

1818
[compat]
19+
ForwardDiff = "0.10.36"
1920
InvertedIndices = "1.3"
2021
QuadGK = "2.9"
2122
SpecialFunctions = "2.3"

test/Derivative.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ half_derivative_of_x_square_minus_1_at_1 = 5/(3*sqrt(π))
66
half_derivative_of_exp_at_1 =*erf(1)+1/sqrt(π)
77

88
@testset "Test Caputo Direct Fractional Derivative" begin
9-
@test isapprox(fracdiff(x->x, 0.5, 0, 1, 1e-8, CaputoDirect())[1], 2/sqrt(pi); atol = 1e-5)
10-
@test isapprox(fracdiff(x->x^5, 0.5, 0, 3.2, 1e-8, CaputoDirect())[1], 4.300306216488329e2; atol = 1e-5)
11-
@test isapprox(fracdiff(x->x^5, 0.25, 0, 3.2, 1e-8, CaputoDirect())[1], 382.1228113951680; atol = 1e-5)
12-
@test isapprox(fracdiff(x->(x-3)^3+(x+2)^2+5, 0.5, 0, 0.83, 1e-8, CaputoDirect())[1], 23.899930581118699; atol = 1e-5)
13-
@test isapprox(fracdiff(x->(x-3)^3+(x+2)^2+5, 0.25, 0, 0.83, 1e-8, CaputoDirect())[1], 22.96354626572943; atol = 1e-5)
14-
@test isapprox(fracdiff(x->cos(x), 0.5, 0, 0.34, 1e-8, CaputoDirect())[1], -0.147174774607683; atol = 1e-5)
15-
@test isapprox(fracdiff(x->cos(x), 0.25, 0, 0.34, 1e-8, CaputoDirect())[1], -0.093074344902431; atol = 1e-5)
16-
@test isapprox(fracdiff(x->exp(-x^2), 0.5, 0, 2.3, 1e-8, CaputoDirect())[1], -0.505891017154289; atol = 1e-5)
17-
@test isapprox(fracdiff(x->exp(-x^2), 0.25, 0, 2.3, 1e-8, CaputoDirect())[1], -0.762927553656252; atol = 1e-5)
9+
@test isapprox(fracdiff(x->x, 0.5, 0, 1, 1e-4, CaputoDirect())[1], 2/sqrt(pi); atol = 1e-5)
10+
@test isapprox(fracdiff(x->x^5, 0.5, 0, 3.2, 1e-4, CaputoDirect())[1], 4.300306216488329e2; atol = 1e-5)
11+
@test isapprox(fracdiff(x->x^5, 0.25, 0, 3.2, 1e-4, CaputoDirect())[1], 382.1228113951680; atol = 1e-5)
12+
@test isapprox(fracdiff(x->(x-3)^3+(x+2)^2+5, 0.5, 0, 0.83, 1e-4, CaputoDirect())[1], 23.899930581118699; atol = 1e-5)
13+
@test isapprox(fracdiff(x->(x-3)^3+(x+2)^2+5, 0.25, 0, 0.83, 1e-4, CaputoDirect())[1], 22.96354626572943; atol = 1e-5)
14+
@test isapprox(fracdiff(x->cos(x), 0.5, 0, 0.34, 1e-4, CaputoDirect())[1], -0.147174774607683; atol = 1e-5)
15+
@test isapprox(fracdiff(x->cos(x), 0.25, 0, 0.34, 1e-4, CaputoDirect())[1], -0.093074344902431; atol = 1e-5)
16+
@test isapprox(fracdiff(x->exp(-x^2), 0.5, 0, 2.3, 1e-4, CaputoDirect())[1], -0.505891017154289; atol = 1e-5)
17+
@test isapprox(fracdiff(x->exp(-x^2), 0.25, 0, 2.3, 1e-4, CaputoDirect())[1], -0.762927553656252; atol = 1e-5)
1818

1919
@test isapprox(fracdiff(x->x, 0.5, 0, [1, 2, 3], 0.0001, CaputoDirect()), [2/sqrt(pi), 1.5957691216057408, 1.9544100476116828]; atol=1e-3)
2020
end

test/Integral.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ using FractionalCalculus
22
using Test
33

44
@testset "Test Direct Fractional Integral" begin
5-
@test isapprox(fracint(x->x^4, 0.5, 0, 1.23, 1e-8, RLDirect())[1], 1.163931646862977; atol = 0.00001)
6-
@test isapprox(fracint(x->x^4, 0.25, 0, 1.23, 1e-8, RLDirect())[1], 1.64294134724409; atol = 0.00001)
7-
@test isapprox(fracint(x->x^4, 0.15, 0, 1.23, 1e-8, RLDirect())[1], 1.878978485456182; atol = 0.00001)
8-
@test isapprox(fracint(x->sin(x), 0.5, 0, 0.97, 1e-8, RLDirect())[1], 0.6442601778843754; atol = 0.00001)
9-
@test isapprox(fracint(x->sin(x), 0.25, 0, 0.97, 1e-8, RLDirect())[1], 0.7448298999485293; atol = 0.00001)
10-
@test isapprox(fracint(x->sin(x), 0.15, 0, 0.97, 1e-8, RLDirect())[1], 0.7802555196986999; atol = 0.00001)
5+
@test isapprox(fracint(x->x^4, 0.5, 0, 1.23, 1e-4, RLDirect())[1], 1.163931646862977; atol = 0.00001)
6+
@test isapprox(fracint(x->x^4, 0.25, 0, 1.23, 1e-4, RLDirect())[1], 1.64294134724409; atol = 0.00001)
7+
@test isapprox(fracint(x->x^4, 0.15, 0, 1.23, 1e-4, RLDirect())[1], 1.878978485456182; atol = 0.00001)
8+
@test isapprox(fracint(x->sin(x), 0.5, 0, 0.97, 1e-4, RLDirect())[1], 0.6442601778843754; atol = 0.00001)
9+
@test isapprox(fracint(x->sin(x), 0.25, 0, 0.97, 1e-4, RLDirect())[1], 0.7448298999485293; atol = 0.00001)
10+
@test isapprox(fracint(x->sin(x), 0.15, 0, 0.97, 1e-4, RLDirect())[1], 0.7802555196986999; atol = 0.00001)
1111
end
1212

1313
@testset "Test Piecewise Fractional Integral" begin

0 commit comments

Comments
 (0)