diff --git a/README.md b/README.md index 4275604..ea15f0f 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,13 @@ This package supports computing singular integrals involving Hilbert/Stieltjes/C log, and power law kernels. Some examples: + ```julia julia> using SingularIntegrals, ClassicalOrthogonalPolynomials -julia> P = Legendre(); x = axes(P,1); f = expand(P, exp); # expand exp(x) in Legendre polynomials +julia> P = Legendre(); x = axes(P, 1); f = expand(P, exp); # expand exp(x) in Legendre polynomials -julia> @time inv.(10 .- x') * f # Stieltjes: ∫_{-1}^1 exp(x)/(10-x) dx +julia> @time inv.(10 .- x') * f # Stieltjes: ∫₋₁¹ exp(x) / (10-x) dx 0.000034 seconds (22 allocations: 2.266 KiB) 0.24332755428373515 @@ -25,21 +26,21 @@ julia> @time inv.(0.1+0im .- x') * f - inv.(0.1-0im .- x') * f ≈ -2π*im*exp(0 0.000052 seconds (49 allocations: 6.031 KiB) true -julia> @time abs.(10 .- x') .^ 0.2 * f # Power law: ∫_{-1}^1 (10-x)^0.2 * exp(x) dx +julia> @time abs.(10 .- x') .^ 0.2 * f # Power law: ∫₋₁¹ (10-x)^0.2 * exp(x) dx 0.000077 seconds (21 allocations: 1.875 KiB) 3.7006631248289135 -julia> @time abs.(0.3 .- x') .^ 0.2 * f # ∫_{-1}^1 abs(0.3-x)^0.2 * exp(x) dx +julia> @time abs.(0.3 .- x') .^ 0.2 * f # ∫₋₁¹ abs(0.3-x)^0.2 * exp(x) dx 0.000040 seconds (25 allocations: 2.172 KiB) 1.9044201526740234 julia> W = Weighted(ChebyshevU()); f = expand(W, x -> exp(x) * sqrt(1-x^2)); -julia> @time log.(abs.(10 .- x')) * f # Log-kernel: ∫_{-1}^1 log(10-x) * exp(x) * sqrt(1-x^2) dx +julia> @time log.(abs.(10 .- x')) * f # Log-kernel: ∫₋₁¹ log(10-x) * exp(x) * sqrt(1-x^2) dx 0.000040 seconds (14 allocations: 400 bytes) 4.043032838853287 -julia> @time log.(abs.(0.3 .- x')) * f # ∫_{-1}^1 log(abs(0.3-x)) * exp(x) * sqrt(1-x^2) dx +julia> @time log.(abs.(0.3 .- x')) * f # ∫₋₁¹ log(abs(0.3-x)) * exp(x) * sqrt(1-x^2) dx 0.000035 seconds (116 allocations: 6.250 KiB) -2.320391559008445 ```