Skip to content

Commit aebc798

Browse files
committed
tidy up
1 parent 9c70f59 commit aebc798

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/polynomials/standard-basis.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Evaluate `p(x)` using a compensation scheme of S. Graillat, Ph. Langlois, N. Lou
308308
309309
The Horner scheme has relative error given by
310310
311-
`|(p(x) - p̂(x))/p(x)| ≤ α ⋅ u ⋅ cond(p, x)`, where `u` is the precision (`2⁻⁵³`).
311+
`|(p(x) - p̂(x))/p(x)| ≤ α(n) ⋅ u ⋅ cond(p, x)`, where `u` is the precision (`2⁻⁵³ = eps()/2`)).
312312
313313
The compensated Horner scheme has relative error bounded by
314314

test/StandardBasis.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,12 @@ end
384384
p = f(x)
385385
e₁ = abs( (f(4/3) - p(4/3))/ p(4/3) )
386386
e₂ = abs( (f(4/3) - Polynomials.compensated_horner(p, 4/3))/ p(4/3) )
387-
@test cond(p, 4/3) > 1/eps()
388-
@test e₁ > sqrt(eps())
389-
@test e₂ <= 4eps()
387+
λ = cond(p, 4/3)
388+
u = eps()/2
389+
@test λ > 1/u
390+
@test e₁ <= 2 * 20 * u * λ
391+
@test e₁ > u^(1/4)
392+
@test e₂ <= u + u^2 * λ * 100
390393
end
391394
end
392395

0 commit comments

Comments
 (0)