Skip to content

Commit 0aca25e

Browse files
committed
Fix primitive /
1 parent f7a5726 commit 0aca25e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

benchmark/case1.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using TaylorDiff, BenchmarkTools
1+
using TaylorSeries, TaylorDiff, BenchmarkTools
22

33
function f(t, p, α, s)
44
x = 1.0 / (1.0 - s*(t+1)/(t-1))
@@ -16,5 +16,7 @@ p, α, s = (rand(N), rand(N), rand())
1616
p ./= sum(p)
1717

1818
# Test
19-
t = TaylorScalar{Float64, 20}(0.)
19+
t0 = Taylor1(eltype(p),m)
20+
t = TaylorScalar{Float64, 21}(0.)
21+
@btime f(t0, p, α, s);
2022
@btime f(t, p, α, s);

src/primitive.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ end
138138
ex = quote
139139
$ex
140140
$(Symbol('v', i)) = (va[$i] - +($([
141-
:($(binomial(i - 1, j)) * $(Symbol('v', j)) * vb[$i + 1 - $j])
141+
:($(binomial(i - 1, j - 1)) * $(Symbol('v', j)) * vb[$i + 1 - $j])
142142
for j = 1:i-1]...))) / vb[1]
143143
end
144144
end

0 commit comments

Comments
 (0)