text:
@testset "Welz Problems" begin
    (a, b, c, d, k, p, q, x, ) = @variables a b c d k p q x

    #= ::Package:: =#

    #= ::Title:: =#
    #=Martin*Welz - posts*on*Sci.Math.Symbolic=#

    #= ::Section::Closed:: =#
    #=4*June*2010=#

    #= [x*(x^2 + 3)/(2*a^2 + b^2*(x^2 + 1))^(5/2)*log((sqrt(2)*x*sqrt(2*a^2 + b^2*(x^2 + 1)) - 2*x*a + b*(x^2 + 1))/x), x, 0, sqrt(2)*(43*a^6 + 63*b^2*a^4 + 33*b^4*a^2 + 5*b^6)*(atan(b*(x/sqrt(2*a^2 + b^2)))/(6*b^4*sqrt(2*a^2 + b^2)*(3*a^2 + b^2)^3)) + sqrt(2)*(sqrt(4*a^2 + b^2) + a)^3*(3*a*sqrt(4*a^2 + b^2) - 7*a^2 - 2*b^2)*(log(sqrt(2)*(sqrt(4*a^2 + b^2) - a)*sqrt(2*a^2 + b^2*(x^2 + 1)) + b*x*sqrt(4*a^2 + b^2) + 2*a^2 - 2*b*x*a + b^2)/(6*b^4*(3*a^2 + b^2)^3)) + sqrt(2)*(sqrt(4*a^2 + b^2) - a)^3*(3*a*sqrt(4*a^2 + b^2) + 7*a^2 + 2*b^2)*(log(sqrt(2)*(sqrt(4*a^2 + b^2) + a)*sqrt(2*a^2 + b^2*(x^2 + 1)) + b*x*sqrt(4*a^2 + b^2) - 2*a^2 + 2*b*x*a - b^2)/(6*b^4*(3*a^2 + b^2)^3)) - (4*a^2 + b^2*(3*x^2 + 5))*(log((sqrt(2)*x*sqrt(2*a^2 + b^2*(x^2 + 1)) - 2*x*a + b*(x^2 + 1))/x)/(3*b^4*(2*a^2 + b^2*(x^2 + 1))^(3/2))) - (4*a^2 + 5*b^2)*(log((sqrt(2*a^2 + b^2*(x^2 + 1)) - sqrt(2*a^2 + b^2))/x)/(3*b^4*(2*a^2 + b^2)^(3/2))) + sqrt(2)*(2*a^2 + b^2)*(log(sqrt(2*a^2 + b^2*(x^2 + 1)) - sqrt(2)*a)/(6*b^4*a^3)) - sqrt(2)*(5*a^2 + b^2)*(8*a^6 + 9*b^2*a^4 + 6*b^4*a^2 + b^6)*(log(2*a^2 + b^2*(x^2 + 1))/(12*b^4*a^3*(3*a^2 + b^2)^3)) + sqrt(2)*(b^2 - a^2)*((sqrt(2)*sqrt(2*a^2 + b^2*(x^2 + 1))*(10*a^6 + 2*b*x*a^5 + 16*b^2*a^4 + 7*b^4*a^2 + b^6) + 12*a^7 + 6*b*x*a^6 + 16*b^2*a^5 + 5*b^3*x*a^4 + 7*b^4*a^3 + b^5*x*a^2 + b^6*a)/(6*b^4*a^2*(2*a^2 + b^2)*(2*a^2 + b^2*(x^2 + 1))*(3*a^2 + b^2)^2))] =#

    #= The*following*two*integrands*are*equivalent! =#
    @test_int [1/sqrt(1 - a*x), x, 1, -((2*sqrt(1 - a*x))/a)]
    @test_int [(log(a*x - 1) - 2*log(-sqrt(a*x - 1)))/(2*pi*sqrt(a*x - 1)), x, 5, -((2*sqrt(1 - a*x))/a), -((2*sqrt(-1 + a*x)*log(-sqrt(-1 + a*x)))/(a*pi)) + (sqrt(-1 + a*x)*log(-1 + a*x))/(a*pi)]

    #= ::Section::Closed:: =#
    #=6*June*2010=#

    #= [sqrt(b^2*x^2 + 2*a^2 + b^2)/(b^3*x^4 + 4*a*b^2*x^3 + 2*a^2*b*x^2 + 4*a*x*(2*a^2 + b^2) - b*(2*a^2 + b^2)), x, 0, 0]
    @test_int [sqrt(b^2*x^2 + 2*a^2 + b^2)/(b^3*x^6 + 4*a*b^2*x^5 + b*x^4*(2*a^2 + b^2) + 8*a*x^3*(a^2 + b^2) - b^3*x^2 + 4*a*x*(2*a^2 + b^2) - b*(2*a^2 + b^2)), x, 0, 0]
    @test_int [x/((b^2*x^2 + 2*a^2 + b^2)*((b*x^2 - 2*a*x + b)*sqrt(b^2*x^2 + 2*a^2 + b^2) + sqrt(2)*b^2*x^3 + sqrt(2)*x*(2*a^2 + b^2))), x, 0, 0] =#

    #= ::Section::Closed:: =#
    #=20*June*2010=#

    #= ::Subsubsection::Closed:: =#
    #=Problem #1=#

    @test_int [1/(sqrt(x^2 + 1) + 2*x)^2, x, 9, (4*x)/(3*(1 - 3*x^2)) - (2*sqrt(1 + x^2))/(3*(1 - 3*x^2)) - atanh(sqrt(3)*x)/(3*sqrt(3)) + atanh((1/2)*sqrt(3)*sqrt(1 + x^2))/(3*sqrt(3))]

    #= ::Subsubsection::Closed:: =#
    #=Problem #2=#

    @test_int [1/(sqrt(x^2 - 1)*(3*x^2 - 4)^2), x, 3, (3*x*sqrt(-1 + x^2))/(8*(4 - 3*x^2)) + (5/16)*atanh(x/(2*sqrt(-1 + x^2)))]

    #= ::Subsubsection::Closed:: =#
    #=Problem #3=#

    @test_int [1/(2*sqrt(x) + sqrt(x + 1))^2, x, 8, 8/(9*(1 - 3*x)) - (4*sqrt(x)*sqrt(1 + x))/(3*(1 - 3*x)) - (8*asinh(sqrt(x)))/9 + (10/9)*atanh((2*sqrt(x))/sqrt(1 + x)) + (5/9)*log(1 - 3*x)]

    #= ::Subsubsection::Closed:: =#
    #=Problem #4=#

    @test_int [sqrt(x^2 - 1)/(x - im)^2, x, 6, sqrt(-1 + x^2)/(im - x) - (im*atan((1 - im*x)/(sqrt(2)*sqrt(-1 + x^2))))/sqrt(2) + atanh(x/sqrt(-1 + x^2))]

    #= ::Subsubsection::Closed:: =#
    #=Problem #5=#

    @test_int [1/(sqrt(x^2 - 1)*(x^2 + 1)^2), x, 3, -((x*sqrt(-1 + x^2))/(4*(1 + x^2))) + (3*atanh((sqrt(2)*x)/sqrt(-1 + x^2)))/(4*sqrt(2))]

    #= ::Subsubsection::Closed:: =#
    #=Problem #6=#

    @test_int [1/(sqrt(x - 1)*(sqrt(x - 1) + sqrt(x))^2), x, 4, 2*sqrt(-1 + x) + (4/3)*(-1 + x)^(3/2) - (4*x^(3/2))/3]

    #= ::Subsubsection::Closed:: =#
    #=Problem #7=#

    @test_int [1/(sqrt(x^2 - 1)*(sqrt(x^2 - 1) + sqrt(x))^2), x, -18, (2 - 4*x)/(5*(sqrt(x) + sqrt(-1 + x^2))) + (1/25)*sqrt(-110 + 50*sqrt(5))*atan((1/2)*sqrt(2 + 2*sqrt(5))*sqrt(x)) - (1/50)*sqrt(-110 + 50*sqrt(5))*atan((sqrt(-2 + 2*sqrt(5))*sqrt(-1 + x^2))/(2 - (1 - sqrt(5))*x)) - (1/25)*sqrt(110 + 50*sqrt(5))*atanh((1/2)*sqrt(-2 + 2*sqrt(5))*sqrt(x)) - (1/50)*sqrt(110 + 50*sqrt(5))*atanh((sqrt(2 + 2*sqrt(5))*sqrt(-1 + x^2))/(2 - x - sqrt(5)*x))]

    @test_int [(sqrt(x) - sqrt(-1 + x^2))^2/((1 + x - x^2)^2*sqrt(-1 + x^2)), x, -25, (2 - 4*x)/(5*(sqrt(x) + sqrt(-1 + x^2))) + (1/25)*sqrt(-110 + 50*sqrt(5))*atan((1/2)*sqrt(2 + 2*sqrt(5))*sqrt(x)) - (1/50)*sqrt(-110 + 50*sqrt(5))*atan((sqrt(-2 + 2*sqrt(5))*sqrt(-1 + x^2))/(2 - (1 - sqrt(5))*x)) - (1/25)*sqrt(110 + 50*sqrt(5))*atanh((1/2)*sqrt(-2 + 2*sqrt(5))*sqrt(x)) - (1/50)*sqrt(110 + 50*sqrt(5))*atanh((sqrt(2 + 2*sqrt(5))*sqrt(-1 + x^2))/(2 - x - sqrt(5)*x))]

    @test_int [1/(sqrt(2)*(1 + x)^2*sqrt(-im + x^2)) + 1/(sqrt(2)*(1 + x)^2*sqrt(im + x^2)), x, 7, -(((1/2 + im/2)*sqrt(-im + x^2))/(sqrt(2)*(1 + x))) - ((1/2 - im/2)*sqrt(im + x^2))/(sqrt(2)*(1 + x)) + atanh((im + x)/(sqrt(1 - im)*sqrt(-im + x^2)))/((1 - im)^(3/2)*sqrt(2)) - atanh((im - x)/(sqrt(1 + im)*sqrt(im + x^2)))/((1 + im)^(3/2)*sqrt(2))]

    #= ::Subsubsection::Closed:: =#
    #=Problem #8=#

    @test_int [sqrt(sqrt(x^4 + 1) + x^2)/((x + 1)^2*sqrt(x^4 + 1)), x, 7, -(sqrt(1 - im*x^2)/(2*(1 + x))) - sqrt(1 + im*x^2)/(2*(1 + x)) - (1/4)*(1 - im)^(3/2)*atanh((1 + im*x)/(sqrt(1 - im)*sqrt(1 - im*x^2))) - (1/4)*(1 + im)^(3/2)*atanh((1 - im*x)/(sqrt(1 + im)*sqrt(1 + im*x^2)))]
    @test_int [sqrt(sqrt(x^4 + 1) + x^2)/((x + 1)*sqrt(x^4 + 1)), x, 5, (-(1/2))*sqrt(1 - im)*atanh((1 + im*x)/(sqrt(1 - im)*sqrt(1 - im*x^2))) - (1/2)*sqrt(1 + im)*atanh((1 - im*x)/(sqrt(1 + im)*sqrt(1 + im*x^2)))]
    @test_int [sqrt(sqrt(x^4 + 1) + x^2)/sqrt(x^4 + 1), x, 2, atanh((sqrt(2)*x)/sqrt(x^2 + sqrt(1 + x^4)))/sqrt(2)]
    @test_int [sqrt(sqrt(x^4 + 1) - x^2)/sqrt(x^4 + 1), x, 2, atan((sqrt(2)*x)/sqrt(-x^2 + sqrt(1 + x^4)))/sqrt(2)]

    #= ::Subsubsection::Closed:: =#
    #=Problem #9=#

    @test_int [((x - 1)^(3/2) + (x + 1)^(3/2))/((x + 1)^(3/2)*(x - 1)^(3/2)), x, 2, -(2/sqrt(-1 + x)) - 2/sqrt(1 + x)]

    #= ::Section::Closed:: =#
    #=15*August*2010=#

    @test_int [(x + sqrt(x^2 + a))^b, x, 3, -((a*(x + sqrt(a + x^2))^(-1 + b))/(2*(1 - b))) + (x + sqrt(a + x^2))^(1 + b)/(2*(1 + b))]
    @test_int [(x - sqrt(x^2 + a))^b, x, 3, -((a*(x - sqrt(a + x^2))^(-1 + b))/(2*(1 - b))) + (x - sqrt(a + x^2))^(1 + b)/(2*(1 + b))]
    @test_int [(x + sqrt(x^2 + a))^b/sqrt(x^2 + a), x, 2, (x + sqrt(a + x^2))^b/b]
    @test_int [(x - sqrt(x^2 + a))^b/sqrt(x^2 + a), x, 2, -((x - sqrt(a + x^2))^b/b)]

    @test_int [1/(a + b*ℯ^(p*x))^2, x, 3, 1/(a*(a + b*ℯ^(p*x))*p) + x/a^2 - log(a + b*ℯ^(p*x))/(a^2*p)]
    @test_int [1/(a*ℯ^(p*x) + b*ℯ^(-p*x))^2, x, 2, -(1/(2*a*(b + a*ℯ^(2*p*x))*p))]
    @test_int [x/(a*ℯ^(p*x) + b*ℯ^(-p*x))^2, x, 6, x/(2*a*b*p) - x/(2*a*(b + a*ℯ^(2*p*x))*p) - log(b + a*ℯ^(2*p*x))/(4*a*b*p^2)]

    #= ::Section::Closed:: =#
    #=2*September*2012=#

    #= ::Item:: =#
    #=Example*from*Welz's*paper "Two-term*Recurrence*Formulae*for*Indefinite*Algebraic*Integrals" available*at*https://arxiv.org/abs/1209.3758v2=#

    @test_int [(1 - x + 3*x^2)/((1 + x + x^2)^2*sqrt(1 - x + x^2)), x, 6, ((1 + x)*sqrt(1 - x + x^2))/(1 + x + x^2) + sqrt(2)*atan((sqrt(2)*(1 + x))/sqrt(1 - x + x^2)) - atanh((sqrt(2/3)*(1 - x))/sqrt(1 - x + x^2))/sqrt(6)]

    #= ::Section::Closed:: =#
    #=21*January*2013=#

    #= From*James*Davenport's*algint*package*documentation*for*Reduce =#
    @test_int [sqrt(x + sqrt(a^2 + x^2))/sqrt(a^2 + x^2), x, 2, 2*sqrt(x + sqrt(a^2 + x^2))]
    @test_int [sqrt(b*x + sqrt(a + b^2*x^2))/sqrt(a + b^2*x^2), x, 2, (2*sqrt(b*x + sqrt(a + b^2*x^2)))/b]

    @test_int [1/(x*sqrt(a^2 + x^2)*sqrt(x + sqrt(a^2 + x^2))), x, 5, -((2*atan(sqrt(x + sqrt(a^2 + x^2))/sqrt(a)))/a^(3/2)) - (2*atanh(sqrt(x + sqrt(a^2 + x^2))/sqrt(a)))/a^(3/2)]
    @test_int [sqrt(sqrt(a^2 + x^2) + x)/x, x, 6, 2*sqrt(x + sqrt(a^2 + x^2)) - 2*sqrt(a)*atan(sqrt(x + sqrt(a^2 + x^2))/sqrt(a)) - 2*sqrt(a)*atanh(sqrt(x + sqrt(a^2 + x^2))/sqrt(a))]

    #= ::Section::Closed:: =#
    #=17*September*2014=#

    @test_int [x^3*log(2 + x)^3*log(3 + x), x, 359, -((302177*x)/1152) + (8029*x^2)/2304 - (763*x^3)/3456 + (3*x^4)/256 + (377/64)*(2 + x)^2 - (71/216)*(2 + x)^3 + (3/256)*(2 + x)^4 + (2069/144)*log(2 + x) - (187/64)*x^2*log(2 + x) + (83/288)*x^3*log(2 + x) - (3/128)*x^4*log(2 + x) + (6733/32)*(2 + x)*log(2 + x) - (377/32)*(2 + x)^2*log(2 + x) + (71/72)*(2 + x)^3*log(2 + x) - (3/64)*(2 + x)^4*log(2 + x) - (43/12)*log(2 + x)^2 - (17/48)*x^3*log(2 + x)^2 + (3/64)*x^4*log(2 + x)^2 - (1251/16)*(2 + x)*log(2 + x)^2 + (273/32)*(2 + x)^2*log(2 + x)^2 - (3/4)*(2 + x)^3*log(2 + x)^2 + (3/64)*(2 + x)^4*log(2 + x)^2 + (65/4)*(2 + x)*log(2 + x)^3 - (33/8)*(2 + x)^2*log(2 + x)^3 + (3/4)*(2 + x)^3*log(2 + x)^3 - (1/16)*(2 + x)^4*log(2 + x)^3 + (3891/128)*log(3 + x) - (115/48)*x^2*log(3 + x) + (37/144)*x^3*log(3 + x) - (3/128)*x^4*log(3 + x) + (415/12)*(3 + x)*log(3 + x) - (4083/32)*log(2 + x)*log(3 + x) - 25*x*log(2 + x)*log(3 + x) + (13/4)*x^2*log(2 + x)*log(3 + x) - (7/12)*x^3*log(2 + x)*log(3 + x) + (3/32)*x^4*log(2 + x)*log(3 + x) + (963/16)*log(2 + x)^2*log(3 + x) + 6*x*log(2 + x)^2*log(3 + x) - (3/2)*x^2*log(2 + x)^2*log(3 + x) + (1/2)*x^3*log(2 + x)^2*log(3 + x) - (3/16)*x^4*log(2 + x)^2*log(3 + x) - (81/4)*log(2 + x)^3*log(3 + x) + (1/4)*x^4*log(2 + x)^3*log(3 + x) - (5609/96)*PolyLog(2, -2 - x) + (563/8)*log(2 + x)*PolyLog(2, -2 - x) - (195/4)*log(2 + x)^2*PolyLog(2, -2 - x) - (563/8)*PolyLog(3, -2 - x) + (195/2)*log(2 + x)*PolyLog(3, -2 - x) - (195/2)*PolyLog(4, -2 - x)]

    #= ::Section::Closed:: =#
    #= 12*January*2016=#

    @test_int [(sqrt(x^2 + b) + x)^a/sqrt(x^2 + b), x, 2, (x + sqrt(b + x^2))^a/a]

    @test_int [(sqrt(x^2 + b) + x)^a, x, 3, -((b*(x + sqrt(b + x^2))^(-1 + a))/(2*(1 - a))) + (x + sqrt(b + x^2))^(1 + a)/(2*(1 + a))]

    @test_int [(x^(3*a) + x^(2*a) + x^a)*(2*x^(2*a) + 3*x^a + 6)^(1/a), x, 2, (x^(1 + a)*(6 + 3*x^a + 2*x^(2*a))^(1 + 1/a))/(6*(1 + a))]

    @test_int [1/(x*(1 - x^2)^(1/3)), x, 5, (1/2)*sqrt(3)*atan((1 + 2*(1 - x^2)^(1/3))/sqrt(3)) - log(x)/2 + (3/4)*log(1 - (1 - x^2)^(1/3))]

    @test_int [1/(x*(1 - x^2)^(2/3)), x, 5, (-(1/2))*sqrt(3)*atan((1 + 2*(1 - x^2)^(1/3))/sqrt(3)) - log(x)/2 + (3/4)*log(1 - (1 - x^2)^(1/3))]

    @test_int [1/(1 - x^3)^(1/3), x, 1, -(atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3)) + (1/2)*log(x + (1 - x^3)^(1/3))]

    @test_int [1/(x*(1 - x^3)^(1/3)), x, 5, atan((1 + 2*(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) - log(x)/2 + (1/2)*log(1 - (1 - x^3)^(1/3))]

    @test_int [1/((1 + x)*(1 - x^3)^(1/3)), x, 1, -((sqrt(3)*atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/(2*2^(1/3))) - log((1 - x)*(1 + x)^2)/(4*2^(1/3)) + (3*log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3)))/(4*2^(1/3))]

    @test_int [x/((1 + x)*(1 - x^3)^(1/3)), x, 3, (sqrt(3)*atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/(2*2^(1/3)) - atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) + log((1 - x)*(1 + x)^2)/(4*2^(1/3)) + (1/2)*log(x + (1 - x^3)^(1/3)) - (3*log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3)))/(4*2^(1/3))]

    @test_int [1/(x*(x^2 - 3*x + 2)^(1/3)), x, -2, -((sqrt(3)*atan(1/sqrt(3) + (2^(1/3)*(2 - x))/(sqrt(3)*(2 - 3*x + x^2)^(1/3))))/(2*2^(1/3))) - log(2 - x)/(4*2^(1/3)) - log(x)/(2*2^(1/3)) + (3*log(2 - x - 2^(2/3)*(2 - 3*x + x^2)^(1/3)))/(4*2^(1/3))]

    @test_int [1/(x^3 - 3*x^2 + 7*x - 5)^(1/3), x, -5, (1/2)*sqrt(3)*atan(1/sqrt(3) + (2*(-1 + x))/(sqrt(3)*(-5 + 7*x - 3*x^2 + x^3)^(1/3))) + (1/4)*log(1 - x) - (3/4)*log(1 - x + (-5 + 7*x - 3*x^2 + x^3)^(1/3))]

    @test_int [1/(x*(x^2 - q))^(1/3), x, -5, (1/2)*sqrt(3)*atan(1/sqrt(3) + (2*x)/(sqrt(3)*(x*(-q + x^2))^(1/3))) + log(x)/4 - (3/4)*log(-x + (x*(-q + x^2))^(1/3))]

    @test_int [1/((x - 1)*(x^2 - 2*x + q))^(1/3), x, -5, (1/2)*sqrt(3)*atan(1/sqrt(3) + (2*(-1 + x))/(sqrt(3)*((-1 + x)*(q - 2*x + x^2))^(1/3))) + (1/4)*log(1 - x) - (3/4)*log(1 - x + ((-1 + x)*(q - 2*x + x^2))^(1/3))]

    @test_int [1/(x*((x - 1)*(x^2 - 2*q*x + q))^(1/3)), x, -2, (sqrt(3)*atan(1/sqrt(3) + (2*q^(1/3)*(-1 + x))/(sqrt(3)*((-1 + x)*(q - 2*q*x + x^2))^(1/3))))/(2*q^(1/3)) + log(1 - x)/(4*q^(1/3)) + log(x)/(2*q^(1/3)) - (3*log((-q^(1/3))*(-1 + x) + ((-1 + x)*(q - 2*q*x + x^2))^(1/3)))/(4*q^(1/3))]

    @test_int [(2 - (k + 1)*x)/((1 - (k + 1)*x)*(x*(1 - x)*(1 - k*x))^(1/3)), x, -3, (sqrt(3)*atan((1 + (2*k^(1/3)*x)/((1 - x)*x*(1 - k*x))^(1/3))/sqrt(3)))/k^(1/3) + log(x)/(2*k^(1/3)) + log(1 - (1 + k)*x)/(2*k^(1/3)) - (3*log((-k^(1/3))*x + ((1 - x)*x*(1 - k*x))^(1/3)))/(2*k^(1/3))]

    @test_int [(1 - k*x)/((1 + (k - 2)*x)*(x*(1 - x)*(1 - k*x))^(2/3)), x, -1, -((sqrt(3)*atan((1 + (2^(1/3)*(1 - k*x))/((1 - k)^(1/3)*((1 - x)*x*(1 - k*x))^(1/3)))/sqrt(3)))/(2^(2/3)*(1 - k)^(1/3))) + log(1 - (2 - k)*x)/(2^(2/3)*(1 - k)^(1/3)) + log(1 - k*x)/(2*2^(2/3)*(1 - k)^(1/3)) - (3*log(-1 + k*x + 2^(2/3)*(1 - k)^(1/3)*((1 - x)*x*(1 - k*x))^(1/3)))/(2*2^(2/3)*(1 - k)^(1/3))]

    @test_int [(a + b*x + c*x^2)/((1 - x + x^2)*(1 - x^3)^(1/3)), x, 19, ((a + b)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)) + ((a + b)*atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/(2*2^(1/3)*sqrt(3)) - (c*atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) - ((a - c)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)) + ((b + c)*atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)) + ((a + b)*log((1 - x)*(1 + x)^2))/(12*2^(1/3)) - ((a - c)*log(1 + x^3))/(6*2^(1/3)) - ((b + c)*log(1 + x^3))/(6*2^(1/3)) + ((a + b)*log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)))/(6*2^(1/3)) - ((a + b)*log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)))/(3*2^(1/3)) + ((b + c)*log(2^(1/3) - (1 - x^3)^(1/3)))/(2*2^(1/3)) + ((a - c)*log((-2^(1/3))*x - (1 - x^3)^(1/3)))/(2*2^(1/3)) + (1/2)*c*log(x + (1 - x^3)^(1/3)) - ((a + b)*log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3)))/(4*2^(1/3)), ((a + b)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)) + ((a + b)*atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/(2*2^(1/3)*sqrt(3)) - (c*atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) - (a*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)) + (c*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)) + ((b + c)*atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)) + ((a + b)*log((1 - x)*(1 + x)^2))/(12*2^(1/3)) - (a*log(1 + x^3))/(6*2^(1/3)) + (c*log(1 + x^3))/(6*2^(1/3)) - ((b + c)*log(1 + x^3))/(6*2^(1/3)) + ((a + b)*log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)))/(6*2^(1/3)) - ((a + b)*log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)))/(3*2^(1/3)) + ((b + c)*log(2^(1/3) - (1 - x^3)^(1/3)))/(2*2^(1/3)) + (a*log((-2^(1/3))*x - (1 - x^3)^(1/3)))/(2*2^(1/3)) - (c*log((-2^(1/3))*x - (1 - x^3)^(1/3)))/(2*2^(1/3)) + (1/2)*c*log(x + (1 - x^3)^(1/3)) - ((a + b)*log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3)))/(4*2^(1/3))]

    #= ::Section::Closed:: =#
    #= 27*March*2016=#

    @test_int [1/((1 + x + 2*x^2)^5*(3 - 2*x)^(11/2)), x, 19, -(19255/(395136*(3 - 2*x)^(9/2))) - 462025/(30118144*(3 - 2*x)^(7/2)) - 38491/(8605184*(3 - 2*x)^(5/2)) - 141045/(120472576*(3 - 2*x)^(3/2)) - 38225/(240945152*sqrt(3 - 2*x)) + x/(28*(3 - 2*x)^(9/2)*(1 + x + 2*x^2)^4) + (23 + 73*x)/(1176*(3 - 2*x)^(9/2)*(1 + x + 2*x^2)^3) + (1387 + 3049*x)/(32928*(3 - 2*x)^(9/2)*(1 + x + 2*x^2)^2) + (5*(3049 + 4377*x))/(153664*(3 - 2*x)^(9/2)*(1 + x + 2*x^2)) + (5*sqrt((1/2)*(149046503977 + 40815066112*sqrt(14)))*atan((sqrt(7 + 2*sqrt(14)) - 2*sqrt(3 - 2*x))/sqrt(-7 + 2*sqrt(14))))/3373232128 - (5*sqrt((1/2)*(149046503977 + 40815066112*sqrt(14)))*atan((sqrt(7 + 2*sqrt(14)) + 2*sqrt(3 - 2*x))/sqrt(-7 + 2*sqrt(14))))/3373232128 + (5*sqrt((1/2)*(-149046503977 + 40815066112*sqrt(14)))*log(3 + sqrt(14) - sqrt(7 + 2*sqrt(14))*sqrt(3 - 2*x) - 2*x))/6746464256 - (5*sqrt((1/2)*(-149046503977 + 40815066112*sqrt(14)))*log(3 + sqrt(14) + sqrt(7 + 2*sqrt(14))*sqrt(3 - 2*x) - 2*x))/6746464256]
    @test_int [1/((1 + x + 2*x^2)^10*(3 - 2*x)^(21/2)), x, 29, 4718120139975/(351733660450816*(3 - 2*x)^(19/2)) - 815900548375/(629418129227776*(3 - 2*x)^(17/2)) - 3029508823715/(1555033025150976*(3 - 2*x)^(15/2)) - 13515743021825/(13476952884641792*(3 - 2*x)^(13/2)) - 5846828446875/(14513641568075776*(3 - 2*x)^(11/2)) - 37283626871975/(261245548225363968*(3 - 2*x)^(9/2)) - 132355162272575/(2844673747342852096*(3 - 2*x)^(7/2)) - 11557581705725/(812763927812243456*(3 - 2*x)^(5/2)) - 46601678385075/(11378694989371408384*(3 - 2*x)^(3/2)) - 24229218097975/(22757389978742816768*sqrt(3 - 2*x)) + x/(63*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^9) + (53 + 173*x)/(7056*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^8) + (8477 + 21409*x)/(691488*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^7) + (5*(21409 + 47471*x))/(6453888*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^6) + (41*(47471 + 92875*x))/(90354432*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^5) + (41*(3436375 + 5677637*x))/(5059848192*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^4) + (451*(811091 + 998691*x))/(10119696384*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^3) + (451*(28962039 + 14627273*x))/(283351498752*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)^2) + (11275*(14627273 - 35058731*x))/(3966920982528*(3 - 2*x)^(19/2)*(1 + x + 2*x^2)) + (11275*sqrt((1/2)*(7 + 2*sqrt(14)))*(9756589235 + 2148932869*sqrt(14))*atan((sqrt(7 + 2*sqrt(14)) - 2*sqrt(3 - 2*x))/sqrt(-7 + 2*sqrt(14))))/318603459702399434752 - (11275*sqrt((1/2)*(7 + 2*sqrt(14)))*(9756589235 + 2148932869*sqrt(14))*atan((sqrt(7 + 2*sqrt(14)) + 2*sqrt(3 - 2*x))/sqrt(-7 + 2*sqrt(14))))/318603459702399434752 + (11275*(9756589235 - 2148932869*sqrt(14))*sqrt((1/2)*(-7 + 2*sqrt(14)))*log(3 + sqrt(14) - sqrt(7 + 2*sqrt(14))*sqrt(3 - 2*x) - 2*x))/637206919404798869504 - (11275*(9756589235 - 2148932869*sqrt(14))*sqrt((1/2)*(-7 + 2*sqrt(14)))*log(3 + sqrt(14) + sqrt(7 + 2*sqrt(14))*sqrt(3 - 2*x) - 2*x))/637206919404798869504]
    @test_int [1/((1 + x + 2*x^2)^20*(3 - 2*x)^(41/2)), x, 49, -(13056959628363355534285785425/(106924014357253562723941220352*(3 - 2*x)^(39/2))) - 3948194343291401740321996415/(202881463139404195937734623232*(3 - 2*x)^(37/2)) - 304688229262620222736480811/(537361713180043545997243056128*(3 - 2*x)^(35/2)) + 2124315846756567455653862925/(1688851098565851144562763890688*(3 - 2*x)^(33/2)) + 47657515074514118796095929535/(66632852434325399703658138959872*(3 - 2*x)^(31/2)) + 34911619993974714062172751985/(124667917457770102671360389021696*(3 - 2*x)^(29/2)) + 149066309808794760843017404825/(1624981820656451683095663001731072*(3 - 2*x)^(27/2)) + 15848613964169066543734380171/(601845118761648771516912222863360*(3 - 2*x)^(25/2)) + 11155168222970774232376891145/(1685166332532616560247354224017408*(3 - 2*x)^(23/2)) + 14011818498091020272474956375/(10110997995195699361484125344104448*(3 - 2*x)^(21/2)) + 173441368149804378661935869705/(896508488907352010051592447177261056*(3 - 2*x)^(19/2)) - 22724090823469905152713519545/(1604278348571050965355481221264572416*(3 - 2*x)^(17/2)) - 101190274412779618678573275245/(3963511214116714149701777134888943616*(3 - 2*x)^(15/2)) - 460503190416958283087439337135/(34350430522344855964082068502370844672*(3 - 2*x)^(13/2)) - 2211619588790911794826342607495/(406920484649315986036049119181931544576*(3 - 2*x)^(11/2)) - 143401467550777247627940437025/(73985542663511997461099839851260280832*(3 - 2*x)^(9/2)) - 4611053278117143010907562317585/(7250583181024175751187784305423507521536*(3 - 2*x)^(7/2)) - 405965372440630510720926890227/(2071595194578335928910795515835287863296*(3 - 2*x)^(5/2)) - 4986681479187781853417316522775/(87006998172290109014253411665082090258432*(3 - 2*x)^(3/2)) - 927027754781476746208047620505/(58004665448193406009502274443388060172288*sqrt(3 - 2*x)) + x/(133*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^19) + (113 + 373*x)/(33516*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^18) + (40657 + 107329*x)/(7976808*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^17) + (5*(751303 + 1831285*x))/(595601664*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^16) + (184959785 + 429411497*x)/(25015269888*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^15) + (41652915209 + 92630823167*x)/(4902992898048*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^14) + (2871555518177 + 6100156355517*x)/(297448235814912*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^13) + (77559130805859 + 156274047129113*x)/(7138757659557888*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^12) + (5*(2656658801194921 + 5020880176134289*x))/(1099368679571914752*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^11) + (45187921585208601 + 78752911037377255*x)/(3420258114223734784*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^10) + (6063974149878048635 + 9477172618423641847*x)/(430952522392190582784*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^9) + (691833601144925854831 + 919498192874055581221*x)/(48266682507925345271808*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^8) + (23*(919498192874055581221 + 908287136092467468517*x))/(1576711628592227945545728*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^7) + (115*(908287136092467468517 + 298281884944522225747*x))/(10187982830903626725064704*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^6) + (23*(2599313568802265110081 - 10426142448623187379187*x))/(20375965661807253450129408*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^5) - (23*(10426142448623187379187 + 27513723463194262383705*x))/(20018492580021161284337664*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^4) - (115*(26513224428169016478843 + 30673415406553789342019*x))/(76434244396444433994743808*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^3) - (115*(88411609113007981044643 - 5712269536245152162963*x))/(125891696652967303050166272*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)^2) + (115*(28561347681225760814815 + 965934812839019490346107*x))/(195831528126838026966925312*(3 - 2*x)^(39/2)*(1 + x + 2*x^2)) + (115*sqrt((1/2)*(7 + 2*sqrt(14)))*(30297118912219360725028693061 + 8061110911143276053983022787*sqrt(14))*atan((sqrt(7 + 2*sqrt(14)) - 2*sqrt(3 - 2*x))/sqrt(-7 + 2*sqrt(14))))/812065316274707684133031842207432842412032 - (115*sqrt((1/2)*(7 + 2*sqrt(14)))*(30297118912219360725028693061 + 8061110911143276053983022787*sqrt(14))*atan((sqrt(7 + 2*sqrt(14)) + 2*sqrt(3 - 2*x))/sqrt(-7 + 2*sqrt(14))))/812065316274707684133031842207432842412032 + (115*(30297118912219360725028693061 - 8061110911143276053983022787*sqrt(14))*sqrt((1/2)*(-7 + 2*sqrt(14)))*log(3 + sqrt(14) - sqrt(7 + 2*sqrt(14))*sqrt(3 - 2*x) - 2*x))/1624130632549415368266063684414865684824064 - (115*(30297118912219360725028693061 - 8061110911143276053983022787*sqrt(14))*sqrt((1/2)*(-7 + 2*sqrt(14)))*log(3 + sqrt(14) + sqrt(7 + 2*sqrt(14))*sqrt(3 - 2*x) - 2*x))/1624130632549415368266063684414865684824064]

    @test_int [1/((1 + x + 2*x^2)^5*(3 - 2*x + x^2)^(11/2)), x, 14, -((3450497 - 2004270*x)/(123480000*(3 - 2*x + x^2)^(9/2))) - (4878869 - 2578034*x)/(411600000*(3 - 2*x + x^2)^(7/2)) - (30316369 - 15043110*x)/(6860000000*(3 - 2*x + x^2)^(5/2)) - (63043297 - 29625922*x)/(41160000000*(3 - 2*x + x^2)^(3/2)) - (31*(7434109 - 3088870*x))/(411600000000*sqrt(3 - 2*x + x^2)) - (1 - 10*x)/(280*(3 - 2*x + x^2)^(9/2)*(1 + x + 2*x^2)^4) + (28 + 67*x)/(1050*(3 - 2*x + x^2)^(9/2)*(1 + x + 2*x^2)^3) + (5485 + 8878*x)/(117600*(3 - 2*x + x^2)^(9/2)*(1 + x + 2*x^2)^2) + (3*(8822 + 8233*x))/(343000*(3 - 2*x + x^2)^(9/2)*(1 + x + 2*x^2)) + (sqrt((1/70)*(151363871237318045 + 110320475741093888*sqrt(2)))*atan((sqrt(5/(7*(151363871237318045 + 110320475741093888*sqrt(2))))*(308108167 + 312239803*sqrt(2) + (932587773 + 620347970*sqrt(2))*x))/sqrt(3 - 2*x + x^2)))/137200000000 - (sqrt((1/70)*(-151363871237318045 + 110320475741093888*sqrt(2)))*atanh((sqrt(5/(7*(-151363871237318045 + 110320475741093888*sqrt(2))))*(308108167 - 312239803*sqrt(2) + (932587773 - 620347970*sqrt(2))*x))/sqrt(3 - 2*x + x^2)))/137200000000]
    @test_int [1/((1 + x + 2*x^2)^10*(3 - 2*x + x^2)^(21/2)), x, 24, (37358055634422583 - 14024622879097678*x)/(1840124479200000000*(3 - 2*x + x^2)^(19/2)) + (476849951294984711 - 125181871472148210*x)/(104273720488000000000*(3 - 2*x + x^2)^(17/2)) + (7851758375483333511 + 1942164996204584234*x)/(15641058073200000000000*(3 - 2*x + x^2)^(15/2)) - (11*(7502325106308201089 - 7813986379726516886*x))/(406667509903200000000000*(3 - 2*x + x^2)^(13/2)) - (3*(69053268515296359011 - 44840736195018286006*x))/(1147010925368000000000000*(3 - 2*x + x^2)^(11/2)) - (838519439380295335657 - 466189390555853643870*x)/(9384634843920000000000000*(3 - 2*x + x^2)^(9/2)) - (1117646664729238460189 - 568839749685437871554*x)/(31282116146400000000000000*(3 - 2*x + x^2)^(7/2)) - (6551405511565449301689 - 3127298559983309301910*x)/(521368602440000000000000000*(3 - 2*x + x^2)^(5/2)) - (4179039782398459850819 - 1886993445589652402694*x)/(1042737204880000000000000000*(3 - 2*x + x^2)^(3/2)) - (12105495874518671061833 - 5117656435043679338190*x)/(10427372048800000000000000000*sqrt(3 - 2*x + x^2)) - (1 - 10*x)/(630*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^9) + (887 + 2218*x)/(88200*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^8) + (14453 + 29371*x)/(1080450*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^7) + (8837931 + 17459234*x)/(605052000*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^6) + (447940041 + 813432205*x)/(26471025000*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^5) + (592729157441 + 911061463974*x)/(29647548000000*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^4) + (277010166219 + 310705340015*x)/(12353145000000*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^3) + (5488221294349 + 1384103301166*x)/(276710448000000*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)^2) - (37857197792117 + 146548895467025*x)/(2421216420000000*(3 - 2*x + x^2)^(19/2)*(1 + x + 2*x^2)) + (1/32282885600000000000000000)*(sqrt((1/70)*(81042225921274689605478944797800854846405 + 57305922523001707126026363878666500308992*sqrt(2)))*atan((1/sqrt(3 - 2*x + x^2))*(sqrt(5/(7*(81042225921274689605478944797800854846405 + 57305922523001707126026363878666500308992*sqrt(2))))*(272944589523248381749 + 191941026386645109841*sqrt(2) + (656826642296538601431 + 464885615909893491590*sqrt(2))*x)))) - (1/32282885600000000000000000)*(sqrt((1/70)*(-81042225921274689605478944797800854846405 + 57305922523001707126026363878666500308992*sqrt(2)))*atanh((1/sqrt(3 - 2*x + x^2))*(sqrt(5/(7*(-81042225921274689605478944797800854846405 + 57305922523001707126026363878666500308992*sqrt(2))))*(272944589523248381749 - 191941026386645109841*sqrt(2) + (656826642296538601431 - 464885615909893491590*sqrt(2))*x))))]
    #= [1/((1 + x + 2*x^2)^20*(3 - 2*x + x^2)^(41/2)), x, 44, -((3383098994350701191445410431293305057 - 4267253240538659853185782736614548266*x)/(525136027977674906956800000000000000000*(3 - 2*x + x^2)^(39/2))) - (78177705015622070276322636989526467357 - 46302218258158218301107776830095849518*x)/(10226333176407353451264000000000000000000*(3 - 2*x + x^2)^(37/2)) - (590941515369388885204630563227557418493 - 284553012686483535620642865600923199674*x)/(170438886273455890854400000000000000000000*(3 - 2*x + x^2)^(35/2)) - (762583115349707009263396051658444299451 - 316786081987045018642707627274029983850*x)/(661703911414593458611200000000000000000000*(3 - 2*x + x^2)^(33/2)) - (20504482297963009703756354886476682604921 - 7087722971997170533955928118157817528778*x)/(68376070846174657389824000000000000000000000*(3 - 2*x + x^2)^(31/2)) - (1094782756101056712471590885456644828438471 - 231319367589693551565762758087902994595834*x)/(19829060545390650643048960000000000000000000000*(3 - 2*x + x^2)^(29/2)) - (11012693190699376908809163895637681160105723 + 17696165071101966113331245255080607119456186*x)/(5353846347255475673623219200000000000000000000000*(3 - 2*x + x^2)^(27/2)) + (23*(18006082293219149330614702781906676996906581 - 12878862225352936849259678853843700644232934*x))/(102958583601066839877369600000000000000000000000000*(3 - 2*x + x^2)^(25/2)) + (3754355493750207391617343068085143489914966741 - 1976623777595197423359895741289079398167213586*x)/(1578698281883024878119667200000000000000000000000000*(3 - 2*x + x^2)^(23/2)) + (34322768124014799813009030113095008046843253 - 15319362686882129647628001638529620053980446*x)/(37439484945842487228134400000000000000000000000000*(3 - 2*x + x^2)^(21/2)) + (1953413335087203199033100669694117118003927337 - 733793240328640817816796967921215709697806706*x)/(7113502139710072573345536000000000000000000000000000*(3 - 2*x + x^2)^(19/2)) + (8322318541720916240549421691461341741448155507 - 2188425336528033679699131827282128928574446618*x)/(134366151527856926385415680000000000000000000000000000*(3 - 2*x + x^2)^(17/2)) + (137736099847510239083414355324468252291068692723 + 33478342054315312692979309199522921351750372786*x)/(20154922729178538957812352000000000000000000000000000000*(3 - 2*x + x^2)^(15/2)) - (1430395239362680496541085612662519163791606856135 - 1495983440171367688360072315937267940781419612058*x)/(524027990958642012903121152000000000000000000000000000000*(3 - 2*x + x^2)^(13/2)) - (46873324150704277658299560286668706773614009227097 - 30488099877102642762965997747126514882873436125826*x)/(19214359668483540473114442240000000000000000000000000000000*(3 - 2*x + x^2)^(11/2)) - (2090128362125698805507947714009988943496892649558547 - 1163930059835896170450961511486397522547379198063338*x)/(1729292370163518642580299801600000000000000000000000000000000*(3 - 2*x + x^2)^(9/2)) - (8369636990081146161067558056610779041437928173813933 - 4269376136031342769573244116290179332114846542231394*x)/(17292923701635186425802998016000000000000000000000000000000000*(3 - 2*x + x^2)^(7/2)) - (49166828083706788194824969884579797183621714007506697 - 23559210708081011868758976108072328010974084474928758*x)/(288215395027253107096716633600000000000000000000000000000000000*(3 - 2*x + x^2)^(5/2)) - (94521492350271713145340025542493858321141702707908121 - 43021608081072494822903916879274373698601078834559154*x)/(1729292370163518642580299801600000000000000000000000000000000000*(3 - 2*x + x^2)^(3/2)) - (279132222218499281305380296125539838445333294423861707 - 121216775195529638294422516813426829250767045105497738*x)/(17292923701635186425802998016000000000000000000000000000000000000*sqrt(3 - 2*x + x^2)) - (1 - 10*x)/(1330*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^19) + (1877 + 4778*x)/(418950*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^18) + (39403 + 85822*x)/(7122150*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^17) + (13*(233559 + 522986*x))/(531787200*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^16) + (87552089 + 193315879*x)/(13959414000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^15) + (383091931241 + 813307430102*x)/(54720902880000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^14) + (15997439501471 + 32531972209601*x)/(2074834234200000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^13) + (11661968128341449 + 22618400149542870*x)/(1394288605382400000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^12) + (3*(44358079769457553 + 81352009087314543*x))/(14911142029784000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^11) + (55501961232421996697 + 95060342178362451574*x)/(5964456811913600000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^10) + (4402445415670842624937 + 6915121726888913987767*x)/(469700973938196000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^9) + (9405293191839054568597199 + 13154801664162951037742138*x)/(1052130181621559040000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^8) + (33329414380999440825700335 + 39194075260407572910301649*x)/(4296198241621366080000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^7) + (3079446144576372279132551987 + 2588106060473365045793782354*x)/(555201003532607308800000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^6) + (51676596892030833963565793623 - 3738166859166819756452589047*x)/(24290043904551569760000000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^5) - (18477591983841452420673740004241 + 27597746968514352562858392071302*x)/(9068283057699252710400000000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^4) - (133360959223342832431783756808269 - 49432151929857088186548766720461*x)/(34006061466372197664000000000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^3) + (1057289143422928552044099202272635 + 2439572907056622740540415493441154*x)/(115414511643445034496000000000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)^2) + (27710574638863668700887240018723697 - 1800525975551829959478731340624273*x)/(336625658960048017280000000000000000*(3 - 2*x + x^2)^(39/2)*(1 + x + 2*x^2)) + (53*sqrt((1/70)*(879210910919588630492825297744872020413651017635360866499074296032260778656372643901 + 621696002391807670114685903911372073177064710967794175872353924738917423916160909312*sqrt(2)))*atan((1/sqrt(3 - 2*x + x^2))*(sqrt(5/(7*(879210910919588630492825297744872020413651017635360866499074296032260778656372643901 + 621696002391807670114685903911372073177064710967794175872353924738917423916160909312*sqrt(2))))*(896457640030471180988134177305100813179145 + 634009778425632881804463219060525222303381*sqrt(2) + (2164477196881736944597060615426151257785907 + 1530467418456104062792597396365626035482526*sqrt(2))*x))))/416873881065074944000000000000000000000000000000000000 - (53*sqrt((1/70)*(-879210910919588630492825297744872020413651017635360866499074296032260778656372643901 + 621696002391807670114685903911372073177064710967794175872353924738917423916160909312*sqrt(2)))*atanh((1/sqrt(3 - 2*x + x^2))*(sqrt(5/(7*(-879210910919588630492825297744872020413651017635360866499074296032260778656372643901 + 621696002391807670114685903911372073177064710967794175872353924738917423916160909312*sqrt(2))))*(896457640030471180988134177305100813179145 - 634009778425632881804463219060525222303381*sqrt(2) + (2164477196881736944597060615426151257785907 - 1530467418456104062792597396365626035482526*sqrt(2))*x))))/416873881065074944000000000000000000000000000000000000] =#

    #= ::Section::Closed:: =#
    #= 19*June*2016=#

    @test_int [(x - a - sqrt(a^2 + 1))/((x - a + sqrt(a^2 + 1))*sqrt((x - a)*(x^2 + 1))), x, -9, (-sqrt(2))*sqrt(a + sqrt(1 + a^2))*atan((sqrt(2)*sqrt(-a + sqrt(1 + a^2))*(-a + x))/sqrt((-a + x)*(1 + x^2)))]

    #= ::Section::Closed:: =#
    #= 17*August*2016=#

    @test_int [(a + b*x)/((3 + x^2)*(1 - x^2)^(1/3)), x, 7, (a*atan(sqrt(3)/x))/(2*2^(2/3)*sqrt(3)) + (sqrt(3)*b*atan((1 + (2 - 2*x^2)^(1/3))/sqrt(3)))/(2*2^(2/3)) + (a*atan((sqrt(3)*(1 - 2^(1/3)*(1 - x^2)^(1/3)))/x))/(2*2^(2/3)*sqrt(3)) - (a*atanh(x))/(6*2^(2/3)) + (a*atanh(x/(1 + 2^(1/3)*(1 - x^2)^(1/3))))/(2*2^(2/3)) - (b*log(3 + x^2))/(4*2^(2/3)) + (3*b*log(2^(2/3) - (1 - x^2)^(1/3)))/(4*2^(2/3))]
    @test_int [(a + b*x)/((3 - x^2)*(1 + x^2)^(1/3)), x, 7, -((a*atan(x))/(6*2^(2/3))) + (a*atan(x/(1 + 2^(1/3)*(1 + x^2)^(1/3))))/(2*2^(2/3)) - (sqrt(3)*b*atan((1 + 2^(1/3)*(1 + x^2)^(1/3))/sqrt(3)))/(2*2^(2/3)) - (a*atanh(sqrt(3)/x))/(2*2^(2/3)*sqrt(3)) - (a*atanh((sqrt(3)*(1 - 2^(1/3)*(1 + x^2)^(1/3)))/x))/(2*2^(2/3)*sqrt(3)) + (b*log(3 - x^2))/(4*2^(2/3)) - (3*b*log(2^(2/3) - (1 + x^2)^(1/3)))/(4*2^(2/3))]
    @test_int [1/(x*(3*x^2 - 6*x + 4)^(1/3)), x, 1, -(atan(1/sqrt(3) + (2^(2/3)*(2 - x))/(sqrt(3)*(4 - 6*x + 3*x^2)^(1/3)))/(2^(2/3)*sqrt(3))) - log(x)/(2*2^(2/3)) + log(6 - 3*x - 3*2^(1/3)*(4 - 6*x + 3*x^2)^(1/3))/(2*2^(2/3))]
    @test_int [x*(1 - x^3)^(1/3), x, 2, (1/3)*x^2*(1 - x^3)^(1/3) - atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/(3*sqrt(3)) - (1/6)*log(-x - (1 - x^3)^(1/3))]
    @test_int [(1 - x^3)^(1/3)/x, x, 6, (1 - x^3)^(1/3) - atan((1 + 2*(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) - log(x)/2 + (1/2)*log(1 - (1 - x^3)^(1/3))]
    @test_int [(1 - x^3)^(1/3)/(1 + x), x, 25, (1 - x^3)^(1/3) + (2^(1/3)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3))/(2^(2/3)*sqrt(3)) - atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) + (2^(1/3)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) - (2^(1/3)*atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) - (1/3)*2^(1/3)*log(1 + x^3) + log(2^(2/3) - (1 - x)/(1 - x^3)^(1/3))/(3*2^(2/3)) - log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(3*2^(2/3)) + (1/3)*2^(1/3)*log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)) - log(2*2^(1/3) + (1 - x)^2/(1 - x^3)^(2/3) + (2^(2/3)*(1 - x))/(1 - x^3)^(1/3))/(6*2^(2/3)) + log(2^(1/3) - (1 - x^3)^(1/3))/2^(2/3) - (1/2)*log(-x - (1 - x^3)^(1/3)) + log((-2^(1/3))*x - (1 - x^3)^(1/3))/2^(2/3)]
    @test_int [(1 - x^3)^(1/3)/(1 - x + x^2), x, 19, (sqrt(3)*atan((1 + (2*2^(1/3)*(-1 + x))/(1 - x^3)^(1/3))/sqrt(3)))/2^(2/3) + atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) - atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3))/(2^(2/3)*sqrt(3)) - atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3))/(2^(2/3)*sqrt(3)) - log(-3*(-1 + x)*(1 - x + x^2))/(2*2^(2/3)) + log(2^(1/3) - (1 - x^3)^(1/3))/(2*2^(2/3)) + (3*log((-2^(1/3))*(-1 + x) + (1 - x^3)^(1/3)))/(2*2^(2/3)) + (1/2)*log(x + (1 - x^3)^(1/3)) - log(2^(1/3)*x + (1 - x^3)^(1/3))/(2*2^(2/3)), (2^(1/3)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3))/(2^(2/3)*sqrt(3)) + atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) - (2^(1/3)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + log(1 + x^3)/(3*2^(2/3)) + log(2^(2/3) - (1 - x)/(1 - x^3)^(1/3))/(3*2^(2/3)) - log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(3*2^(2/3)) + (1/3)*2^(1/3)*log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)) - log(2*2^(1/3) + (1 - x)^2/(1 - x^3)^(2/3) + (2^(2/3)*(1 - x))/(1 - x^3)^(1/3))/(6*2^(2/3)) + (1/2)*log(-x - (1 - x^3)^(1/3)) - log((-2^(1/3))*x - (1 - x^3)^(1/3))/2^(2/3)]

    #= ::Section::Closed:: =#
    #= 22*September*2016=#

    #= [1/(x^3 - 3*x^2 + 7*x - 4)^(1/3), x, 0, 0]
    @test_int [1/(x*(3*x^2 - 6*x + 5)^(1/3)), x, 0, 0] =#

    @test_int [(1 - x^3)^(1/3)/(2 + x), x, 12, (1 - x^3)^(1/3) + (1/2)*x*AppellF1(1/3, -(1/3), 1, 4/3, x^3, -(x^3/8)) - (2*atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + 3^(1/6)*atan((1 - (3^(2/3)*x)/(1 - x^3)^(1/3))/sqrt(3)) - 3^(1/6)*atan(1/sqrt(3) + (2*(1 - x^3)^(1/3))/(3*3^(1/6))) - log(8 + x^3)/3^(1/3) + (1/2)*3^(2/3)*log(3^(2/3) - (1 - x^3)^(1/3)) - log(-x - (1 - x^3)^(1/3)) + (1/2)*3^(2/3)*log((-(1/2))*3^(2/3)*x - (1 - x^3)^(1/3))]
    @test_int [(2 + x)/((1 + x + x^2)*(2 + x^3)^(1/3)), x, 9, -((x^2*AppellF1(2/3, 1, 1/3, 5/3, x^3, -(x^3/2)))/(2*2^(1/3))) + (2*atan((1 + (2*3^(1/3)*x)/(2 + x^3)^(1/3))/sqrt(3)))/3^(5/6) + atan((3^(1/3) + 2*(2 + x^3)^(1/3))/3^(5/6))/3^(5/6) + log(1 - x^3)/(6*3^(1/3)) + log(3^(1/3) - (2 + x^3)^(1/3))/(2*3^(1/3)) - log(3^(1/3)*x - (2 + x^3)^(1/3))/3^(1/3)]

    #= ::Section::Closed:: =#
    #= 14*January*2017=#

    @test_int [(3 - 3*x + 30*x^2 + 160*x^3)/(9 + 24*x - 12*x^2 + 80*x^3 + 320*x^4), x, 1, (1/8)*log(9 + 24*x - 12*x^2 + 80*x^3 + 320*x^4)]
    @test_int [(3 + 12*x + 20*x^2)/(9 + 24*x - 12*x^2 + 80*x^3 + 320*x^4), x, 1, -(atan((7 - 40*x)/(5*sqrt(11)))/(2*sqrt(11))) + atan((57 + 30*x - 40*x^2 + 800*x^3)/(6*sqrt(11)))/(2*sqrt(11))]
    @test_int [-(84 + 576*x + 400*x^2 - 2560*x^3)/(9 + 24*x - 12*x^2 + 80*x^3 + 320*x^4), x, 2, 2*sqrt(11)*atan((7 - 40*x)/(5*sqrt(11))) - 2*sqrt(11)*atan((57 + 30*x - 40*x^2 + 800*x^3)/(6*sqrt(11))) + 2*log(9 + 24*x - 12*x^2 + 80*x^3 + 320*x^4)]

    #= ::Section::Closed:: =#
    #= 31*January*2017=#

    @test_int [sqrt(1 - x^4)/(1 + x^4), x, 1, (1/2)*atan((x*(1 + x^2))/sqrt(1 - x^4)) + (1/2)*atanh((x*(1 - x^2))/sqrt(1 - x^4))]
    @test_int [sqrt(1 + x^4)/(1 - x^4), x, 4, atan((sqrt(2)*x)/sqrt(1 + x^4))/(2*sqrt(2)) + atanh((sqrt(2)*x)/sqrt(1 + x^4))/(2*sqrt(2))]

    #= ::Section::Closed:: =#
    #= 7*February*2017=#

    @test_int [sqrt(1 + p*x^2 + x^4)/(1 - x^4), x, 4, (1/4)*sqrt(2 - p)*atan((sqrt(2 - p)*x)/sqrt(1 + p*x^2 + x^4)) + (1/4)*sqrt(2 + p)*atanh((sqrt(2 + p)*x)/sqrt(1 + p*x^2 + x^4))]
    @test_int [sqrt(1 + p*x^2 - x^4)/(1 + x^4), x, 1, -((sqrt(p + sqrt(4 + p^2))*atan((sqrt(p + sqrt(4 + p^2))*x*(p - sqrt(4 + p^2) - 2*x^2))/(2*sqrt(2)*sqrt(1 + p*x^2 - x^4))))/(2*sqrt(2))) + (sqrt(-p + sqrt(4 + p^2))*atanh((sqrt(-p + sqrt(4 + p^2))*x*(p + sqrt(4 + p^2) - 2*x^2))/(2*sqrt(2)*sqrt(1 + p*x^2 - x^4))))/(2*sqrt(2))]

    #= ::Section::Closed:: =#
    #= 28*August*2017=#

    #= [(3 + x^2)/((1 + x^2)*(1 + 6*x^2 + x^4)^(1/4)), x, 0, 0]
    @test_int [(3 - x^2)/((1 - x^2)*(1 - 6*x^2 + x^4)^(1/4)), x, 0, 0] =#

    @test_int [(a + b*x)/((2 - x^2)*(-1 + x^2)^(1/4)), x, 7, (a*atan(x/(sqrt(2)*(-1 + x^2)^(1/4))))/(2*sqrt(2)) - b*atan((-1 + x^2)^(1/4)) + (a*atanh(x/(sqrt(2)*(-1 + x^2)^(1/4))))/(2*sqrt(2)) + b*atanh((-1 + x^2)^(1/4))]
    @test_int [(a + b*x)/((2 + x^2)*(-1 - x^2)^(1/4)), x, 7, (a*atan(x/(sqrt(2)*(-1 - x^2)^(1/4))))/(2*sqrt(2)) + b*atan((-1 - x^2)^(1/4)) + (a*atanh(x/(sqrt(2)*(-1 - x^2)^(1/4))))/(2*sqrt(2)) - b*atanh((-1 - x^2)^(1/4))]

    @test_int [(a + b*x)/((2 - x^2)*(1 - x^2)^(1/4)), x, 3, (b*atan((1 - sqrt(1 - x^2))/(sqrt(2)*(1 - x^2)^(1/4))))/sqrt(2) + (1/2)*a*atan((1 - sqrt(1 - x^2))/(x*(1 - x^2)^(1/4))) + (b*atanh((1 + sqrt(1 - x^2))/(sqrt(2)*(1 - x^2)^(1/4))))/sqrt(2) + (1/2)*a*atanh((1 + sqrt(1 - x^2))/(x*(1 - x^2)^(1/4)))]
    @test_int [(a + b*x)/((2 + x^2)*(1 + x^2)^(1/4)), x, 3, -((b*atan((1 - sqrt(1 + x^2))/(sqrt(2)*(1 + x^2)^(1/4))))/sqrt(2)) - (1/2)*a*atan((1 + sqrt(1 + x^2))/(x*(1 + x^2)^(1/4))) - (1/2)*a*atanh((1 - sqrt(1 + x^2))/(x*(1 + x^2)^(1/4))) - (b*atanh((1 + sqrt(1 + x^2))/(sqrt(2)*(1 + x^2)^(1/4))))/sqrt(2)]

    #= ::Section::Closed:: =#
    #= 20*January*2018=#

    @test_int [x/((4 - x^3)*sqrt(1 - x^3)), x, 1, -(atan((sqrt(3)*(1 - 2^(1/3)*x))/sqrt(1 - x^3))/(3*2^(2/3)*sqrt(3))) + atan(sqrt(1 - x^3)/sqrt(3))/(3*2^(2/3)*sqrt(3)) - atanh((1 + 2^(1/3)*x)/sqrt(1 - x^3))/(3*2^(2/3)) + atanh(sqrt(1 - x^3))/(9*2^(2/3))]
    @test_int [x/((4 - d*x^3)*sqrt(-1 + d*x^3)), x, 1, -(atan((1 + 2^(1/3)*d^(1/3)*x)/sqrt(-1 + d*x^3))/(3*2^(2/3)*d^(2/3))) - atan(sqrt(-1 + d*x^3))/(9*2^(2/3)*d^(2/3)) - atanh((sqrt(3)*(1 - 2^(1/3)*d^(1/3)*x))/sqrt(-1 + d*x^3))/(3*2^(2/3)*sqrt(3)*d^(2/3)) - atanh(sqrt(-1 + d*x^3)/sqrt(3))/(3*2^(2/3)*sqrt(3)*d^(2/3))]

    @test_int [x/((x^3 + 8)*sqrt(x^3 - 1)), x, 8, (1/18)*atan((1 - x)^2/(3*sqrt(-1 + x^3))) + (1/18)*atan((1/3)*sqrt(-1 + x^3)) - atanh((sqrt(3)*(1 - x))/sqrt(-1 + x^3))/(6*sqrt(3))]
    @test_int [x/((8 - d*x^3)*sqrt(1 + d*x^3)), x, 8, -(atan((sqrt(3)*(1 + d^(1/3)*x))/sqrt(1 + d*x^3))/(6*sqrt(3)*d^(2/3))) + atanh((1 + d^(1/3)*x)^2/(3*sqrt(1 + d*x^3)))/(18*d^(2/3)) - atanh((1/3)*sqrt(1 + d*x^3))/(18*d^(2/3))]

    #= ::Section::Closed:: =#
    #= 25*January*2018=#

    @test_int [1/((3 - x^2)*(1 - 3*x^2)^(1/3)), x, 1, (1/4)*atan((1 - (1 - 3*x^2)^(1/3))/x) + atanh(x/sqrt(3))/(4*sqrt(3)) - atanh((1 - (1 - 3*x^2)^(1/3))^2/(3*sqrt(3)*x))/(4*sqrt(3))]
    @test_int [1/((3 + x^2)*(1 + 3*x^2)^(1/3)), x, 1, atan(x/sqrt(3))/(4*sqrt(3)) + atan((1 - (1 + 3*x^2)^(1/3))^2/(3*sqrt(3)*x))/(4*sqrt(3)) - (1/4)*atanh((1 - (1 + 3*x^2)^(1/3))/x)]

    @test_int [1/((3 + x^2)*(1 - x^2)^(1/3)), x, 1, atan(sqrt(3)/x)/(2*2^(2/3)*sqrt(3)) + atan((sqrt(3)*(1 - 2^(1/3)*(1 - x^2)^(1/3)))/x)/(2*2^(2/3)*sqrt(3)) - atanh(x)/(6*2^(2/3)) + atanh(x/(1 + 2^(1/3)*(1 - x^2)^(1/3)))/(2*2^(2/3))]
    @test_int [1/((3 - x^2)*(1 + x^2)^(1/3)), x, 1, -(atan(x)/(6*2^(2/3))) + atan(x/(1 + 2^(1/3)*(1 + x^2)^(1/3)))/(2*2^(2/3)) - atanh(sqrt(3)/x)/(2*2^(2/3)*sqrt(3)) - atanh((sqrt(3)*(1 - 2^(1/3)*(1 + x^2)^(1/3)))/x)/(2*2^(2/3)*sqrt(3))]

    #= ::Section::Closed:: =#
    #= 27*January*2018=#

    @test_int [(x + a)/((x - a)*sqrt(x^3 - x^2*(a^2 + 1) + a^2*x)), x, 4, -((2*sqrt(x)*sqrt(a^2 - (1 + a^2)*x + x^2)*atan(((1 - a)*sqrt(x))/sqrt(a^2 - (1 + a^2)*x + x^2)))/((1 - a)*sqrt(a^2*x - (1 + a^2)*x^2 + x^3)))]

    @test_int [(x + a - 2)/((x - a)*sqrt(x^3 + x^2*(a^2 - 2*a - 1) + a*x*(2 - a))), x, -5, 0]

    @test_int [(x*(2*a - 1) - a)/((x - a)*sqrt(x^3*(2*a - 1) - x^2*(a^2 + 2*a - 1) + a^2*x)), x, -7, log((-a^2 + 2*a*x + x^2 - 2*(x + sqrt((-(-1 + x))*x*(a^2 + x - 2*a*x))))/(a - x)^2)]

    #= ::Section::Closed:: =#
    #= 7*February*2018=#

    @test_int [(1 - 2^(1/3)*x)/((2^(2/3) + x)*sqrt(1 + x^3)), x, 2, (2*atan((sqrt(3)*(1 + 2^(1/3)*x))/sqrt(1 + x^3)))/sqrt(3)]

    #= ::Section::Closed:: =#
    #= 14*February*2018=#

    @test_int [(1 + x)/((-2 + x)*sqrt(1 + x^3)), x, 2, (-(2/3))*atanh((1 + x)^2/(3*sqrt(1 + x^3)))]

    #= ::Section::Closed:: =#
    #= 21*February*2018=#

    @test_int [x/((10 + 6*sqrt(3) + x^3)*sqrt(1 + x^3)), x, 1, -(((2 - sqrt(3))*atan((3^(1/4)*(1 + sqrt(3))*(1 + x))/(sqrt(2)*sqrt(1 + x^3))))/(2*sqrt(2)*3^(3/4))) - ((2 - sqrt(3))*atan(((1 - sqrt(3))*sqrt(1 + x^3))/(sqrt(2)*3^(3/4))))/(3*sqrt(2)*3^(3/4)) - ((2 - sqrt(3))*atanh((3^(1/4)*(1 + sqrt(3) - 2*x))/(sqrt(2)*sqrt(1 + x^3))))/(3*sqrt(2)*3^(1/4)) - ((2 - sqrt(3))*atanh((3^(1/4)*(1 - sqrt(3))*(1 + x))/(sqrt(2)*sqrt(1 + x^3))))/(6*sqrt(2)*3^(1/4))]
    @test_int [x/((10 - 6*sqrt(3) + x^3)*sqrt(1 + x^3)), x, 1, -(((2 + sqrt(3))*atan((3^(1/4)*(1 - sqrt(3) - 2*x))/(sqrt(2)*sqrt(1 + x^3))))/(3*sqrt(2)*3^(1/4))) - ((2 + sqrt(3))*atan((3^(1/4)*(1 + sqrt(3))*(1 + x))/(sqrt(2)*sqrt(1 + x^3))))/(6*sqrt(2)*3^(1/4)) + ((2 + sqrt(3))*atanh((3^(1/4)*(1 - sqrt(3))*(1 + x))/(sqrt(2)*sqrt(1 + x^3))))/(2*sqrt(2)*3^(3/4)) + ((2 + sqrt(3))*atanh(((1 + sqrt(3))*sqrt(1 + x^3))/(sqrt(2)*3^(3/4))))/(3*sqrt(2)*3^(3/4))]
    @test_int [x/((-10 - 6*sqrt(3) + x^3)*sqrt(-1 + x^3)), x, 1, ((2 - sqrt(3))*atan((3^(1/4)*(1 - sqrt(3))*(1 - x))/(sqrt(2)*sqrt(-1 + x^3))))/(6*sqrt(2)*3^(1/4)) + ((2 - sqrt(3))*atan((3^(1/4)*(1 + sqrt(3) + 2*x))/(sqrt(2)*sqrt(-1 + x^3))))/(3*sqrt(2)*3^(1/4)) + ((2 - sqrt(3))*atanh((3^(1/4)*(1 + sqrt(3))*(1 - x))/(sqrt(2)*sqrt(-1 + x^3))))/(2*sqrt(2)*3^(3/4)) - ((2 - sqrt(3))*atanh(((1 - sqrt(3))*sqrt(-1 + x^3))/(sqrt(2)*3^(3/4))))/(3*sqrt(2)*3^(3/4))]
    @test_int [x/((-10 + 6*sqrt(3) + x^3)*sqrt(-1 + x^3)), x, 1, -(((2 + sqrt(3))*atan((3^(1/4)*(1 - sqrt(3))*(1 - x))/(sqrt(2)*sqrt(-1 + x^3))))/(2*sqrt(2)*3^(3/4))) + ((2 + sqrt(3))*atan(((1 + sqrt(3))*sqrt(-1 + x^3))/(sqrt(2)*3^(3/4))))/(3*sqrt(2)*3^(3/4)) + ((2 + sqrt(3))*atanh((3^(1/4)*(1 + sqrt(3))*(1 - x))/(sqrt(2)*sqrt(-1 + x^3))))/(6*sqrt(2)*3^(1/4)) + ((2 + sqrt(3))*atanh((3^(1/4)*(1 - sqrt(3) + 2*x))/(sqrt(2)*sqrt(-1 + x^3))))/(3*sqrt(2)*3^(1/4))]

    #= ::Section::Closed:: =#
    #= 24*February*2018*via*email=#

    @test_int [(1 - sqrt(3) + x)/((1 + sqrt(3) + x)*sqrt(-4 + 4*sqrt(3)*x^2 + x^4)), x, 2, (1/3)*sqrt(-3 + 2*sqrt(3))*atanh((1 - sqrt(3) + x)^2/(sqrt(3*(-3 + 2*sqrt(3)))*sqrt(-4 + 4*sqrt(3)*x^2 + x^4)))]

    @test_int [(1 + sqrt(3) + x)/((1 - sqrt(3) + x)*sqrt(-4 - 4*sqrt(3)*x^2 + x^4)), x, 2, -(1/3)*sqrt(3 + 2*sqrt(3))*atan((1 + sqrt(3) + x)^2/(sqrt(3*(3 + 2*sqrt(3)))*sqrt(-4 - 4*sqrt(3)*x^2 + x^4)))]

    #= ::Section::Closed:: =#
    #= 1*March*2018=#

    @test_int [(x - 1)/((x + 1)*(x^3 + 2)^(1/3)), x, 1, sqrt(3)*atan((1 + (2*(2 + x))/(2 + x^3)^(1/3))/sqrt(3)) + log(1 + x) - (3/2)*log(2 + x - (2 + x^3)^(1/3))]

    @test_int [1/((x + 1)*(x^3 + 2)^(1/3)), x, 3, atan((1 + (2*x)/(2 + x^3)^(1/3))/sqrt(3))/(2*sqrt(3)) - (1/2)*sqrt(3)*atan((1 + (2*(2 + x))/(2 + x^3)^(1/3))/sqrt(3)) - (1/2)*log(1 + x) + (3/4)*log(2 + x - (2 + x^3)^(1/3)) - (1/4)*log(-x + (2 + x^3)^(1/3))]

    #= ::Section::Closed:: =#
    #= 1*April*2018=#

    #= [(x^2 + 2*x - 3)/((x^4 - 8*x^3 + 94*x^2 + 552*x + 657)*sqrt(x^3 - 15*x - 22)), x, 0, 0] =#

    #= ::Section::Closed:: =#
    #=26*September*2018=#

    @test_int [1/((1 - x^3)*(a + b*x^3)^(1/3)), x, 1, atan((1 + (2*(a + b)^(1/3)*x)/(a + b*x^3)^(1/3))/sqrt(3))/(sqrt(3)*(a + b)^(1/3)) + log(1 - x^3)/(6*(a + b)^(1/3)) - log((a + b)^(1/3)*x - (a + b*x^3)^(1/3))/(2*(a + b)^(1/3))]
    @test_int [(1 + x)/((1 + x + x^2)*(a + b*x^3)^(1/3)), x, 8, atan((1 + (2*(a + b)^(1/3)*x)/(a + b*x^3)^(1/3))/sqrt(3))/(sqrt(3)*(a + b)^(1/3)) + atan((1 + (2*(a + b*x^3)^(1/3))/(a + b)^(1/3))/sqrt(3))/(sqrt(3)*(a + b)^(1/3)) + log((a + b)^(1/3) - (a + b*x^3)^(1/3))/(2*(a + b)^(1/3)) - log((a + b)^(1/3)*x - (a + b*x^3)^(1/3))/(2*(a + b)^(1/3))]
    @test_int [x^2/((1 - x^3)*(a + b*x^3)^(1/3)), x, 5, -(atan((1 + (2*(a + b*x^3)^(1/3))/(a + b)^(1/3))/sqrt(3))/(sqrt(3)*(a + b)^(1/3))) + log(1 - x^3)/(6*(a + b)^(1/3)) - log((a + b)^(1/3) - (a + b*x^3)^(1/3))/(2*(a + b)^(1/3))]

    #= ::Section::Closed:: =#
    #=12*October*2018=#

    @test_int [1/((1 + x^3)*(1 - x^3)^(1/3)), x, 1, -(atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3))/(2^(1/3)*sqrt(3))) - log(1 + x^3)/(6*2^(1/3)) + log((-2^(1/3))*x - (1 - x^3)^(1/3))/(2*2^(1/3))]
    @test_int [x/((1 + x^3)*(1 - x^3)^(1/3)), x, 8, atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3))/(2^(1/3)*sqrt(3)) + atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3))/(2*2^(1/3)*sqrt(3)) + log((1 - x)*(1 + x)^2)/(12*2^(1/3)) + log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(6*2^(1/3)) - log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(3*2^(1/3)) - log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3))/(4*2^(1/3))]
    @test_int [x^2/((1 + x^3)*(1 - x^3)^(1/3)), x, 5, atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3))/(2^(1/3)*sqrt(3)) - log(1 + x^3)/(6*2^(1/3)) + log(2^(1/3) - (1 - x^3)^(1/3))/(2*2^(1/3))]

    #= Integrands*are*equal. =#
    @test_int [(1 + x)/((1 - x + x^2)*(1 - x^3)^(1/3)), x, -16, (sqrt(3)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/2^(1/3) + log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(2*2^(1/3)) - log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/2^(1/3)]
    @test_int [(1 + x)^2/((1 + x^3)*(1 - x^3)^(1/3)), x, -17, (sqrt(3)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/2^(1/3) + log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(2*2^(1/3)) - log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/2^(1/3)]

    @test_int [(1 - x)/((1 + x + x^2)*(1 + x^3)^(1/3)), x, -16, -((sqrt(3)*atan((1 - (2*2^(1/3)*(1 + x))/(1 + x^3)^(1/3))/sqrt(3)))/2^(1/3)) - log(1 + (2^(2/3)*(1 + x)^2)/(1 + x^3)^(2/3) - (2^(1/3)*(1 + x))/(1 + x^3)^(1/3))/(2*2^(1/3)) + log(1 + (2^(1/3)*(1 + x))/(1 + x^3)^(1/3))/2^(1/3)]

    #= Integrands*are*equal. =#
    @test_int [(1 - x^3)^(2/3)/(1 + x + x^2)^2, x, 5, 1/(1 - x^3)^(1/3) + x/(1 - x^3)^(1/3) - x^2*HypergeometricFunctions._₂F₁(2/3, 4/3, 5/3, x^3)]
    @test_int [(1 - x)/((1 + x + x^2)*(1 - x^3)^(1/3)), x, 5, 1/(1 - x^3)^(1/3) + x/(1 - x^3)^(1/3) - x^2*HypergeometricFunctions._₂F₁(2/3, 4/3, 5/3, x^3)]
    @test_int [(1 - x)^2/(1 - x^3)^(4/3), x, 3, (1 + (1 - 2*x)*x)/(1 - x^3)^(1/3) + x^2*HypergeometricFunctions._₂F₁(1/3, 2/3, 5/3, x^3)]

    #= ::Section::Closed:: =#
    #=16*October*2018=#

    @test_int [(1 - x^3)^(2/3), x, 2, (1/3)*x*(1 - x^3)^(2/3) - (2*atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3)))/(3*sqrt(3)) + (1/3)*log(x + (1 - x^3)^(1/3))]
    @test_int [(1 - x^3)^(2/3)/x, x, 6, (1/2)*(1 - x^3)^(2/3) + atan((1 + 2*(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) - log(x)/2 + (1/2)*log(1 - (1 - x^3)^(1/3))]
    @test_int [(1 - x^3)^(2/3)/(a + b*x), x, 13, (1 - x^3)^(2/3)/(2*b) - ((a^3 + b^3)*x^2*AppellF1(2/3, 1/3, 1, 5/3, x^3, -((b^3*x^3)/a^3)))/(2*a^2*b^2) + (a^2*atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3)))/(sqrt(3)*b^3) - ((a^3 + b^3)^(2/3)*atan((1 - (2*(a^3 + b^3)^(1/3)*x)/(a*(1 - x^3)^(1/3)))/sqrt(3)))/(sqrt(3)*b^3) + ((a^3 + b^3)^(2/3)*atan((1 + (2*b*(1 - x^3)^(1/3))/(a^3 + b^3)^(1/3))/sqrt(3)))/(sqrt(3)*b^3) + (a*x^2*HypergeometricFunctions._₂F₁(1/3, 2/3, 5/3, x^3))/(2*b^2) - ((a^3 + b^3)^(2/3)*log(a^3 + b^3*x^3))/(3*b^3) + ((a^3 + b^3)^(2/3)*log(-(((a^3 + b^3)^(1/3)*x)/a) - (1 - x^3)^(1/3)))/(2*b^3) - (a^2*log(x + (1 - x^3)^(1/3)))/(2*b^3) + ((a^3 + b^3)^(2/3)*log((a^3 + b^3)^(1/3) - b*(1 - x^3)^(1/3)))/(2*b^3)]

    #= ::Section::Closed:: =#
    #=17*October*2018=#

    @test_int [(1 - x^3)^(2/3)/(1 - x + x^2)^2, x, 13, -((1 - x^3)^(2/3)/(3*(1 + x^3))) + (x*(1 - x^3)^(2/3))/(3*(1 + x^3)) + (2*x^2*(1 - x^3)^(2/3))/(3*(1 + x^3)) - (2^(2/3)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/(3*sqrt(3)) - (2^(2/3)*atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3)))/(3*sqrt(3)) + (1/3)*x^2*HypergeometricFunctions._₂F₁(1/3, 2/3, 5/3, x^3) - log(2^(1/3) - (1 - x^3)^(1/3))/(3*2^(1/3)) + log((-2^(1/3))*x - (1 - x^3)^(1/3))/(3*2^(1/3))]

    @test_int [(1 - 2*x)*(1 - x^3)^(2/3)/(1 - x + x^2)^2, x, 14, (1 - x^3)^(2/3)/(1 - x + x^2) - (2*atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + (2^(2/3)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + (2^(2/3)*atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + log(2^(1/3) - (1 - x^3)^(1/3))/2^(1/3) - log((-2^(1/3))*x - (1 - x^3)^(1/3))/2^(1/3) + log(x + (1 - x^3)^(1/3)), (1 - x^3)^(2/3)/(1 + x^3) + (x*(1 - x^3)^(2/3))/(1 + x^3) - (2*atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + (2^(2/3)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + (2^(2/3)*atan((1 + 2^(2/3)*(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + log(2^(1/3) - (1 - x^3)^(1/3))/2^(1/3) + log((-2^(1/3))*x - (1 - x^3)^(1/3))/(3*2^(1/3)) - (2/3)*2^(2/3)*log((-2^(1/3))*x - (1 - x^3)^(1/3)) + log(x + (1 - x^3)^(1/3))]

    #= ::Section::Closed:: =#
    #=22*October*2018=#

    @test_int [(1 - x^3)^(2/3)/(1 + x), x, 5, (1/2)*(1 - x^3)^(2/3) - (sqrt(3)*atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/2^(1/3) + atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) + (1/2)*x^2*HypergeometricFunctions._₂F₁(1/3, 2/3, 5/3, x^3) - log((1 - x)*(1 + x)^2)/(2*2^(1/3)) - (1/2)*log(x + (1 - x^3)^(1/3)) + (3*log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3)))/(2*2^(1/3))]
    @test_int [(1 - x + x^2)*(1 - x^3)^(2/3)/(1 + x^3), x, 6, (1/2)*(1 - x^3)^(2/3) - (sqrt(3)*atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/2^(1/3) + atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) + (1/2)*x^2*HypergeometricFunctions._₂F₁(1/3, 2/3, 5/3, x^3) - log((1 - x)*(1 + x)^2)/(2*2^(1/3)) - (1/2)*log(x + (1 - x^3)^(1/3)) + (3*log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3)))/(2*2^(1/3))]

    #= ::Section::Closed:: =#
    #=24*October*2018=#

    @test_int [(1 - x^3)^(2/3)/(1 + x^3), x, 3, atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) - (2^(2/3)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) - log(1 + x^3)/(3*2^(1/3)) + log((-2^(1/3))*x - (1 - x^3)^(1/3))/2^(1/3) - (1/2)*log(x + (1 - x^3)^(1/3))]

    @test_int [x*(1 - x^3)^(2/3)/(1 + x^3), x, 10, (2^(2/3)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3))/(2^(1/3)*sqrt(3)) - (1/2)*x^2*HypergeometricFunctions._₂F₁(1/3, 2/3, 5/3, x^3) + log((1 - x)*(1 + x)^2)/(6*2^(1/3)) + log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(3*2^(1/3)) - (1/3)*2^(2/3)*log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)) - log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3))/(2*2^(1/3))]

    #= ::Section::Closed:: =#
    #=4*November*2018=#

    @test_int [(1 - x)*(1 - x^3)^(2/3)/(1 + x^3), x, -17, -((2^(2/3)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3)) - atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3))/(2^(1/3)*sqrt(3)) + atan((1 - (2*x)/(1 - x^3)^(1/3))/sqrt(3))/sqrt(3) - (2^(2/3)*atan((1 - (2*2^(1/3)*x)/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + (1/2)*x^2*HypergeometricFunctions._₂F₁(1/3, 2/3, 5/3, x^3) - log((1 - x)*(1 + x)^2)/(6*2^(1/3)) - log(1 + x^3)/(3*2^(1/3)) - log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(3*2^(1/3)) + (1/3)*2^(2/3)*log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)) + log((-2^(1/3))*x - (1 - x^3)^(1/3))/2^(1/3) - (1/2)*log(x + (1 - x^3)^(1/3)) + log(-1 + x + 2^(2/3)*(1 - x^3)^(1/3))/(2*2^(1/3))]

    #= [(1 + x^3)*(1 - x^3)^(2/3)/(1 + x^3 + x^6), x, 0, 0] =#

    @test_int [(1 - x^3)^(1/3)/(1 + x^3), x, 14, (2^(1/3)*atan((1 - (2*2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3)))/sqrt(3) + atan((1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/sqrt(3))/(2^(2/3)*sqrt(3)) + log(2^(2/3) - (1 - x)/(1 - x^3)^(1/3))/(3*2^(2/3)) - log(1 + (2^(2/3)*(1 - x)^2)/(1 - x^3)^(2/3) - (2^(1/3)*(1 - x))/(1 - x^3)^(1/3))/(3*2^(2/3)) + (1/3)*2^(1/3)*log(1 + (2^(1/3)*(1 - x))/(1 - x^3)^(1/3)) - log(2*2^(1/3) + (1 - x)^2/(1 - x^3)^(2/3) + (2^(2/3)*(1 - x))/(1 - x^3)^(1/3))/(6*2^(2/3))]
    end

max_stars_repo_path: test/0 Independent test suites/Welz Problems.jl


text:
@testset "sm" begin

    D_in = 5
    v1 = rand(D_in)
    v2 = rand(D_in)

    αs₁ = rand(3)
    αs₂ = rand(D_in, 3)
    γs = rand(D_in, 3)
    ωs = rand(D_in, 3)

    k1 = spectral_mixture_kernel(αs₁, γs, ωs)
    k2 = spectral_mixture_product_kernel(αs₂, γs, ωs)

    t = v1 - v2

    @test k1(v1, v2) ≈ sum(αs₁ .* exp.(-(t' * γs)'.^2 ./ 2) .* cospi.((t' * ωs)')) atol=1e-5

    @test isapprox(
        k2(v1, v2),
        prod(
            [sum(αs₂[i,:]' .* exp.(-(γs[i,:]' * t[i]).^2 ./ 2) .*
            cospi.(ωs[i,:]' * t[i])) for i in 1:length(t)],
        );
        atol=1e-5,
    )

    @test_throws DimensionMismatch spectral_mixture_kernel(rand(5) ,rand(4,3), rand(4,3))
    @test_throws DimensionMismatch spectral_mixture_kernel(rand(3) ,rand(4,3), rand(5,3))
    @test_throws DimensionMismatch spectral_mixture_product_kernel(rand(5,3) ,rand(4,3), rand(5,3))

    # Standardised tests. Choose input dims carefully.
    @testset "ColVecs" begin
        x0 = ColVecs(randn(D_in, 3))
        x1 = ColVecs(randn(D_in, 3))
        x2 = ColVecs(randn(D_in, 2))
        TestUtils.test_interface(k1, x0, x1, x2)
        TestUtils.test_interface(k2, x0, x1, x2)
    end
    @testset "RowVecs" begin
        x0 = RowVecs(randn(3, D_in))
        x1 = RowVecs(randn(3, D_in))
        x2 = RowVecs(randn(2, D_in))
        TestUtils.test_interface(k1, x0, x1, x2)
        TestUtils.test_interface(k2, x0, x1, x2)
    end
    # test_ADs(x->spectral_mixture_kernel(exp.(x[1:3]), reshape(x[4:18], 5, 3), reshape(x[19:end], 5, 3)), vcat(log.(αs₁), γs[:], ωs[:]), dims = [5,5])
    @test_broken "No tests passing (BaseKernel)"
end

ext: jl


text:
function StableRandomGenerator(arg0::RandomGenerator, arg1::jdouble, arg2::jdouble)
    return StableRandomGenerator((RandomGenerator, jdouble, jdouble), arg0, arg1, arg2)
end

function next_normalized_double(obj::StableRandomGenerator)
    return jcall(obj, "nextNormalizedDouble", jdouble, ())
end


text:
# Simple example of a homogeneous heat equation:
#
#           y
#             |
#             |     u_y = 0
#          Ly ----------------------------------
#             |                                |
#             |                                |
#             |                                |
#     u_x = 0 |    u_t - a(u_xx + u_yy) = 0    | u_x = 0
#             |                                |
#             |                                |
#             |                                |
#           -----------------------------------|-----  x
#                         u_y = 0              Lx
#
# Here, a>0 and the initial data is
#
#      u_0(x, y) = 1 + cos(pi x / Lx) cos(pi y / Ly).
#
# The exact solution is
#
#      u(x, y, t) = 1 + exp(-lambda t) cos(pi x / Lx) cos(pi y / Ly )
#
# with
#
#      lambda = a pi^2 ( 1 / Lx^2 + 1 / Ly^2 )
#
using PyPlot
using FinElt
using FinElt.PlanarPoisson
using LinearAlgebra: norm
include("ode23s.jl")

const a = 0.1
const Lx = 1.0
const Ly = 1.0
const lambda = a * pi^2 * ( 1/Lx^2 + 1/Ly^2 )
const T = 2.0

function exact_u(x, t)
    return 1 + exp(-lambda * t ) * cos(pi*x[1]/Lx) * cos(pi*x[2]/Ly)
end

function RHS(t, u, S)
    return -S * u
end

maxnorm(x) = norm(x, Inf)

start = time()
mesh = read_msh_file("../rectangle/rect2.msh")
dof = degrees_of_freedom(mesh, String[])
M = assembled_matrix("Omega", func_times_func!, 1.0, mesh, dof)
S = assembled_matrix("Omega", grad_dot_grad!, a, mesh, dof)
u0 = get_nodal_vals(x->exact_u(x,0.0), mesh)
t, u = ode23s((t,u)->RHS(t, u, S), u0, [0,T];
             reltol=1.0e-5, abstol=1.0e-5, mass=M, norm=maxnorm)

N = length(t)
err = zeros(N)
for n = 1:N
    un = get_nodal_vals(x->exact_u(x,t[n]), mesh)
    err[n] = maxnorm(un-u[n])
end

finish = time()
elapsed = finish - start

figure(1)
plot(t, err)
xlabel(L"t")
title("Error solving the heat equation")
grid(true)


text:
# ---
# title: 300. Longest Increasing Subsequence
# id: problem300
# author: Tian Jun
# date: 2020-10-31
# difficulty: Medium
# categories: Binary Search, Dynamic Programming
# link: <https://leetcode.com/problems/longest-increasing-subsequence/description/>
# hidden: true
# ---
#
# Given an integer array `nums`, return the length of the longest strictly
# increasing subsequence.
#
# A **subsequence** is a sequence that can be derived from an array by deleting
# some or no elements without changing the order of the remaining elements. For
# example, `[3,6,2,7]` is a subsequence of the array `[0,3,1,6,2,2,7]`.
#
#
#
# **Example 1:**
#
#
#
#     Input: nums = [10,9,2,5,3,7,101,18]
#     Output: 4
#     Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.
#
#
# **Example 2:**
#
#
#
#     Input: nums = [0,1,0,3,2,3]
#     Output: 4
#
#
# **Example 3:**
#
#
#
#     Input: nums = [7,7,7,7,7,7,7]
#     Output: 1
#
#
#
#
# **Constraints:**
#
#   * `1 <= nums.length <= 2500`
#   * `-104 <= nums[i] <= 104`
#
#
#
# **Follow up:**
#
#   * Could you come up with the `O(n2)` solution?
#   * Could you improve it to `O(n log(n))` time complexity?
#
#
## @lc code=start
using LeetCode

## add your code here:
## @lc code=end


text:
"""
    binary_brier_score(ytrue, yscore)

Computes the binary formulation of the Brier score, defined as:

```math
\\frac{1}{N}\\sum\\limits _{t=1}^{N}(f_t-o_t)^2 \\,\\!
```

Lower values are better. Best value is 0.
"""
function binary_brier_score(
        ytrue::AbstractVector{<:Integer},
        yscore::AbstractVector{<:AbstractFloat},
        )
    if length(ytrue) != length(yscore)
        error("length(ytrue) != length(yscore)")
    end
    if length(ytrue) == 0
        error("length(ytrue) == 0")
    end
    result = mean_square_error(ytrue, yscore)
    return result
end


text:
using Meganet, BenchmarkTools

const history = Pkg.dir("Meganet")*"//benchmarks//micro//bm_singleLayer.jld"

TYPE = Float32
K = getConvGEMMKernel(TYPE,[16,16],[3,3,64,64])
nex = 1000

nLayer = getBatchNormLayer(TYPE,[16*16;64],isTrainable=true)
L     = getSingleLayer(TYPE,K,nLayer)

theta = initTheta(L)

Y     = randn(TYPE,nFeatIn(L),nex)

function benchmarkApply()
    funcName = "apply"
    Zd,Z,tmp  = apply(L,theta,Y,true)
    @code_warntype apply(L,theta,Y,true)

    trial = @benchmark apply(L,theta,Y,true)
    Meganet.updatehistory!(history, trial, funcName)
    hist = JLD.load(history, funcName)
    judge(hist)
end

function benchmarkJYTmv()
    funcName = "JYTmv"
    _,_,tmp = apply(L,theta,Y,true)
    Zout = randn(TYPE,nFeatOut(L),nex)

    #Warmup
    Z1 =  JYTmv(L,copy(Zout),(TYPE)[],theta,Y,tmp);
    trial = @benchmark JYTmv(L,copy(Zout),(TYPE)[],theta,Y,tmp)
    Meganet.updatehistory!(history, trial, funcName)
    hist = JLD.load(history, funcName)
    judge(hist)
end

function benchmarkJthetaTmv()
    funcName = "JthetaTmv"
    _,_,tmp = apply(L,theta,Y,true)
    Zout = randn(TYPE,nFeatOut(L),nex)

    #Warmup
    Z1 =  JthetaTmv(L,copy(Zout),(TYPE)[],theta,Y,tmp);
    trial = @benchmark JthetaTmv(L,copy(Zout),(TYPE)[],theta,Y,tmp)
    Meganet.updatehistory!(history, trial, funcName)
    hist = JLD.load(history, funcName)
    judge(hist)
end

function benchmarkJTmv()
    funcName = "JTmv"
    _,_,tmp = apply(L,theta,Y,true)
    Zout = randn(TYPE,nFeatOut(L),nex)

    #Warmup
    Z1 =  JTmv(L,copy(Zout),(TYPE)[],theta,Y,tmp);
    trial = @benchmark JTmv(L,copy(Zout),(TYPE)[],theta,Y,tmp)
    Meganet.updatehistory!(history, trial, funcName)
    hist = JLD.load(history, funcName)
    judge(hist)
end

function benchmarkJYmv()
    funcName = "JYmv"
    _,_,tmp = apply(L,theta,Y,true)
    Zout = randn(TYPE,nFeatOut(L),nex)

    #Warmup
    Z1 =  JYmv(L,copy(Zout),theta,Y,tmp);
    trial = @benchmark JYmv(L,copy(Zout),theta,Y,tmp)
    Meganet.updatehistory!(history, trial, funcName)
    hist = JLD.load(history, funcName)
    judge(hist)
end

function benchmarkJmv()
    funcName = "Jmv"
    _,_,tmp = apply(L,theta,Y,true)
    Zout = randn(TYPE,nFeatOut(L),nex)
    dtheta = randn(TYPE, size(theta))
    #Warmup
    Z1 =  Jmv(L,copy(dtheta),copy(Zout),theta,Y,tmp);
    trial = @benchmark Jmv(L,copy(dtheta),copy(Zout),theta,Y,tmp)
    Meganet.updatehistory!(history, trial, funcName)
    hist = JLD.load(history, funcName)
    judge(hist)
end

function benchmarkJthetamv()
    funcName = "Jthetamv"
    _,_,tmp = apply(L,theta,Y,true)
    dtheta = randn(TYPE, size(theta))

    #Warmup
    Z1 =  Jthetamv(L,dtheta,theta,Y,tmp);
    trial = @benchmark Jthetamv(L,dtheta,theta,Y,tmp)
    Meganet.updatehistory!(history, trial, funcName)
    hist = JLD.load(history, funcName)
    judge(hist)
end


text:
__precompile__()

"""
The CouchDB API.

## Types

* `Client`
* `Database`
* `HTTPException`
* `QueryResult`
* `Selector`

## CouchDB instance API

* `createdb()`
* `connectdb()`
* `dbinfo()`
* `listdbs()`
* `deletedb()`

## CouchDB CRUD

* `createdoc()`
* `readdoc()`
* `updatedoc()`
* `deletedoc()`

## Attachments

* `put_attachment()`
* `get_attachment()`
* `delete_attachment()`

## Mango/Cloudant Query

* `mango_index()`
* `mango_query()`
* `paged_mango_query()`
* `listindexes()`
* `mango_deleteindex()`
* `and()`
* `or()`
* `nor()`
* `not()`
* `@q_str()`

## Views

* `view_index()`
* `view_query()`
* `alldocs()`

## Replication

* `changes()`
* `changes_streaming()`
* `revs_diff()`
* `bulk_get()`

## Geospatial (Cloudant only)

* `geo_index()`
* `geo_indexinfo()`
* `geo_query()`

## Auth (Cloudant only)

* `get_permissions()`
* `set_permissions()`
* `make_api_key()`
* `delete_api_key()`

## utils (Cloudant only)

* `retry_settings()`
* `retry_settings!()`
"""
module Couchzilla

using Requests
using URIParser
using JSON

import Requests: get, post, put, delete, requestfor, headers

include("utils.jl")
include("client.jl")
include("database.jl")
include("selector.jl")
include("mango.jl")
include("attachments.jl")
include("replication.jl")
include("views.jl")
include("tasks.jl")
include("geospatial.jl")
include("auth.jl")

export Client, Database, HTTPException
export createdb, connectdb, dbinfo, listdbs, deletedb
export updatedoc, deletedoc, createdoc, readdoc
export put_attachment, get_attachment, delete_attachment
export QueryResult, Selector, @q_str, and, or, nor, not
export mango_query, mango_index, listindexes, mango_deleteindex, paged_mango_query
export view_index, view_query, alldocs
export revs_diff, changes, changes_streaming, bulk_get
export geo_index, geo_indexinfo, geo_query
export retry_settings, retry_settings!
export get_permissions, set_permissions, make_api_key, delete_api_key

end # module


text:
"""
    test_objective_ObjectiveSense_MAX_SENSE(
        model::MOI.ModelLike,
        config::Config,
    )

Test setting objective sense to MAX_SENSE.
"""
function test_objective_ObjectiveSense_MAX_SENSE(
    model::MOI.ModelLike,
    ::Config{T},
) where {T}
    @requires MOI.supports(model, MOI.ObjectiveSense())
    MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
    @test MOI.get(model, MOI.ObjectiveSense()) == MOI.MAX_SENSE
    return
end

"""
    test_objective_ObjectiveSense_MIN_SENSE(
        model::MOI.ModelLike,
        config::Config,
    )

Test setting objective sense to MIN_SENSE.
"""
function test_objective_ObjectiveSense_MIN_SENSE(
    model::MOI.ModelLike,
    ::Config{T},
) where {T}
    @requires MOI.supports(model, MOI.ObjectiveSense())
    MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
    @test MOI.get(model, MOI.ObjectiveSense()) == MOI.MIN_SENSE
    return
end

"""
    test_objective_ObjectiveSense_FEASIBILITY_SENSE(
        model::MOI.ModelLike,
        config::Config,
    )

Test setting objective sense to FEASIBILITY_SENSE.
"""
function test_objective_ObjectiveSense_FEASIBILITY_SENSE(
    model::MOI.ModelLike,
    ::Config{T},
) where {T}
    @requires MOI.supports(model, MOI.ObjectiveSense())
    MOI.set(model, MOI.ObjectiveSense(), MOI.FEASIBILITY_SENSE)
    @test MOI.get(model, MOI.ObjectiveSense()) == MOI.FEASIBILITY_SENSE
end

"""
    test_objective_FEASIBILITY_SENSE_clears_objective(
        model::MOI.ModelLike,
        config::Config,
    )

Test setting objective sense to FEASIBILITY_SENSE  clears previous objective.
"""
function test_objective_FEASIBILITY_SENSE_clears_objective(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    @requires _supports(config, MOI.optimize!)
    x = MOI.add_variable(model)
    MOI.add_constraint(model, x, MOI.GreaterThan(T(1)))
    MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
    f = MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(T(1), x)], T(0))
    MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
    MOI.optimize!(model)
    @test isapprox(MOI.get(model, MOI.ObjectiveValue()), T(1), config)
    MOI.set(model, MOI.ObjectiveSense(), MOI.FEASIBILITY_SENSE)
    MOI.optimize!(model)
    @test isapprox(MOI.get(model, MOI.ObjectiveValue()), T(0), config)
    return
end

function setup_test(
    ::typeof(test_objective_FEASIBILITY_SENSE_clears_objective),
    model::MOIU.MockOptimizer,
    ::Config{T},
) where {T}
    MOIU.set_mock_optimize!(
        model,
        (mock::MOIU.MockOptimizer) ->
            MOIU.mock_optimize!(mock, MOI.OPTIMAL, (MOI.FEASIBLE_POINT, T[1])),
    )
    return
end

"""
    test_objective_get_ObjectiveFunction_ScalarAffineFunction(
        model::MOI.ModelLike,
        config::Config,
    )

Test get objective function.
"""
function test_objective_get_ObjectiveFunction_ScalarAffineFunction(
    model::MOI.ModelLike,
    ::Config{T},
) where {T}
    obj_attr = MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}()
    @requires MOI.supports(model, obj_attr)
    x = MOI.add_variable(model)
    f = MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(T(2), x)], T(1))
    MOI.set(model, obj_attr, f)
    @test_throws(
        InexactError,
        MOI.get(model, MOI.ObjectiveFunction{MOI.VariableIndex}()),
    )
    obj_fun = MOI.get(model, obj_attr)
    @test obj_fun ≈ f
    quad_obj_fun =
        MOI.get(model, MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{T}}())
    @test convert(MOI.ScalarAffineFunction{T}, quad_obj_fun) ≈ f
    _test_attribute_value_type(model, MOI.ObjectiveFunctionType())
    _test_attribute_value_type(model, obj_attr)
    return
end

"""
    test_objective_ObjectiveFunction_constant(
        model::MOI.ModelLike,
        config::Config,
    )

Test constant in linear objective,  if `config.solve=true` confirm that it
solves correctly, and if `config.duals=true`, check that the duals are computed
correctly.
"""
function test_objective_ObjectiveFunction_constant(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    obj_attr = MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}()
    @requires MOI.supports(model, obj_attr)
    x = MOI.add_variable(model)
    f = MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(T(2), x)], T(1))
    MOI.set(model, obj_attr, f)
    MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
    c = MOI.add_constraint(model, x, MOI.GreaterThan(T(1)))
    _test_model_solution(
        model,
        config;
        objective_value = T(3),
        variable_primal = [(x, T(1))],
        constraint_primal = [(c, T(1))],
        constraint_dual = [(c, T(2))],
    )
    return
end

function setup_test(
    ::typeof(test_objective_ObjectiveFunction_constant),
    model::MOIU.MockOptimizer,
    ::Config{T},
) where {T}
    MOIU.set_mock_optimize!(
        model,
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1]),
            MOI.FEASIBLE_POINT,
        ),
    )
    return
end

"""
    test_objective_ObjectiveFunction_blank(
        model::MOI.ModelLike,
        config::Config{T},
    ) where {T}

Test blank linear objective,  if `config.solve=true` confirm that it
solves correctly, and if `config.duals=true`, check that the duals are computed
correctly.
"""
function test_objective_ObjectiveFunction_blank(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    @requires _supports(config, MOI.optimize!)
    obj_attr = MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}()
    @requires MOI.supports(model, obj_attr)
    x = MOI.add_variable(model)
    f = MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(T(0), x)], T(0))
    MOI.set(model, obj_attr, f)
    MOI.optimize!(model)
    @test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
    @test isapprox(MOI.get(model, MOI.ObjectiveValue()), T(0), config)
    return
end

function setup_test(
    ::typeof(test_objective_ObjectiveFunction_blank),
    model::MOIU.MockOptimizer,
    ::Config{T},
) where {T}
    MOIU.set_mock_optimize!(
        model,
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[6//5]),
            MOI.FEASIBLE_POINT,
        ),
    )
    return
end

"""
    test_objective_ObjectiveFunction_VariableIndex(
        model::MOI.ModelLike,
        config::Config,
    )

Test VariableIndex objective,  if `config.solve=true` confirm that it
solves correctly, and if `config.duals=true`, check that the duals are computed
correctly.
"""
function test_objective_ObjectiveFunction_VariableIndex(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    @requires MOI.supports(model, MOI.ObjectiveFunction{MOI.VariableIndex}())
    x = MOI.add_variable(model)
    MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), x)
    MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
    c = MOI.add_constraint(model, x, MOI.GreaterThan(T(1)))
    _test_attribute_value_type(model, MOI.ObjectiveFunctionType())
    _test_attribute_value_type(
        model,
        MOI.ObjectiveFunction{MOI.VariableIndex}(),
    )
    _test_model_solution(
        model,
        config;
        objective_value = T(1),
        variable_primal = [(x, T(1))],
        constraint_primal = [(c, T(1))],
        constraint_dual = [(c, T(1))],
    )
    return
end

function setup_test(
    ::typeof(test_objective_ObjectiveFunction_VariableIndex),
    model::MOIU.MockOptimizer,
    ::Config{T},
) where {T}
    MOIU.set_mock_optimize!(
        model,
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1]),
            MOI.FEASIBLE_POINT,
        ),
    )
    return
end

"""
    test_objective_qp_ObjectiveFunction_edge_cases(
        model::MOI.ModelLike,
        config::Config,
    )

Test various edge cases relating to quadratic programs (i.e., with a quadratic
objective function).

If `config.solve=true` confirm that it solves correctly.
"""
function test_objective_qp_ObjectiveFunction_edge_cases(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    obj_attr = MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{T}}()
    @requires MOI.supports(model, obj_attr)
    x = MOI.add_variables(model, 2)
    MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
    vc1 = MOI.add_constraint(model, x[1], MOI.GreaterThan(T(1)))
    @test vc1.value == x[1].value
    vc2 = MOI.add_constraint(model, x[2], MOI.GreaterThan(T(2)))
    @test vc2.value == x[2].value
    # Basic model
    # min x^2 + y^2 | x>=1, y>=2
    MOI.set(
        model,
        obj_attr,
        MOI.ScalarQuadraticFunction(
            MOI.ScalarQuadraticTerm.(T(2), x, x),  # quad
            MOI.ScalarAffineTerm{T}[],  # affine terms
            T(0),  # constant
        ),
    )
    _test_model_solution(
        model,
        config;
        objective_value = T(5),
        variable_primal = [(x[1], T(1)), (x[2], T(2))],
    )
    # Duplicate linear terms
    # min x + x + x^2 + y^2 | x>=1, y>=2
    MOI.set(
        model,
        obj_attr,
        MOI.ScalarQuadraticFunction(
            MOI.ScalarQuadraticTerm.(T(2), x, x),  # quad
            MOI.ScalarAffineTerm.(T(1), [x[1], x[1]]),  # affine terms
            T(0),  # constant
        ),
    )
    _test_model_solution(
        model,
        config;
        objective_value = T(7),
        variable_primal = [(x[1], T(1)), (x[2], T(2))],
    )
    # Duplicate diagonal terms
    # min x^2 + x^2 | x>=1, y>=2
    MOI.set(
        model,
        obj_attr,
        MOI.ScalarQuadraticFunction(
            MOI.ScalarQuadraticTerm.(T(2), [x[1], x[1]], [x[1], x[1]]),  # quad
            MOI.ScalarAffineTerm{T}[],  # affine terms
            T(0),  # constant
        ),
    )
    _test_model_solution(
        model,
        config;
        objective_value = T(2),
        variable_primal = [(x[1], T(1))],
    )
    # Duplicate off-diagonal terms" begin
    # min x^2 + 0.25x*y + 0.25y*x + 0.5x*y + y^2 | x>=1, y>=2
    MOI.set(
        model,
        obj_attr,
        MOI.ScalarQuadraticFunction(
            MOI.ScalarQuadraticTerm.(
                T[2, 1//4, 1//4, 1//2, 2],
                [x[1], x[1], x[2], x[1], x[2]],
                [x[1], x[2], x[1], x[2], x[2]],
            ),  # quad
            MOI.ScalarAffineTerm{T}[],  # affine terms
            T(0),  # constant
        ),
    )
    _test_model_solution(
        model,
        config;
        objective_value = T(7),
        variable_primal = [(x[1], T(1)), (x[2], T(2))],
    )
    return
end

function setup_test(
    ::typeof(test_objective_qp_ObjectiveFunction_edge_cases),
    model::MOIU.MockOptimizer,
    ::Config{T},
) where {T}
    MOIU.set_mock_optimize!(
        model,
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1, 2]),
        ),
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1, 2]),
        ),
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1, 2]),
        ),
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1, 2]),
        ),
    )
    return
end

"""
    test_objective_qp_ObjectiveFunction_zero_ofdiag(
        model::MOI.ModelLike,
        config::Config,
    )

Test quadratic program with a zero off-diagonal term.

If `config.solve=true` confirm that it solves correctly.
"""
function test_objective_qp_ObjectiveFunction_zero_ofdiag(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    obj_attr = MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{T}}()
    @requires MOI.supports(model, obj_attr)
    x = MOI.add_variables(model, 2)
    MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
    vc1 = MOI.add_constraint(model, x[1], MOI.GreaterThan(T(1)))
    @test vc1.value == x[1].value
    vc2 = MOI.add_constraint(model, x[2], MOI.GreaterThan(T(2)))
    @test vc2.value == x[2].value
    MOI.set(
        model,
        obj_attr,
        MOI.ScalarQuadraticFunction(
            MOI.ScalarQuadraticTerm.(
                T[2, 0, 2],
                [x[1], x[1], x[2]],
                [x[1], x[2], x[2]],
            ),  # quad
            MOI.ScalarAffineTerm{T}[],  # affine terms
            T(0),  # constant
        ),
    )
    _test_model_solution(
        model,
        config;
        objective_value = T(5),
        variable_primal = [(x[1], T(1)), (x[2], T(2))],
    )
    return
end

function setup_test(
    ::typeof(test_objective_qp_ObjectiveFunction_zero_ofdiag),
    model::MOIU.MockOptimizer,
    ::Config{T},
) where {T}
    MOIU.set_mock_optimize!(
        model,
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1, 2]),
        ),
    )
    return
end

"""
    test_objective_ObjectiveFunction_duplicate_terms(
        model::MOI.ModelLike,
        config::Config,
    )

Test duplicate terms in linear objective, if `config.solve=true` confirm that it
solves correctly.
"""
function test_objective_ObjectiveFunction_duplicate_terms(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    x = MOI.add_variable(model)
    c = MOI.add_constraint(model, x, MOI.GreaterThan(T(1)))
    @test c.value == x.value
    MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
    MOI.set(
        model,
        MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}(),
        MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(T[2, 1], x), T(0)),
    )
    _test_model_solution(
        model,
        config;
        objective_value = T(3),
        variable_primal = [(x, T(1))],
        constraint_primal = [(c, T(1))],
        constraint_dual = [(c, T(3))],
    )
    return
end

function setup_test(
    ::typeof(test_objective_ObjectiveFunction_duplicate_terms),
    model::MOIU.MockOptimizer,
    ::Config{T},
) where {T}
    MOIU.set_mock_optimize!(
        model,
        (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!(
            mock,
            MOI.OPTIMAL,
            (MOI.FEASIBLE_POINT, T[1]),
            MOI.FEASIBLE_POINT,
        ),
    )
    return
end

"""
    test_objective_set_via_modify(
        model::MOI.ModelLike,
        config::Config{T},
    ) where {T}

Test that a ScalarAffineFunction can be set via modification without setting an
objective prior.
"""
function test_objective_set_via_modify(
    model::MOI.ModelLike,
    config::Config{T},
) where {T}
    attr = MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}()
    @requires MOI.supports(model, attr)
    @requires _supports(config, MOI.modify)
    @requires _supports(config, MOI.ScalarCoefficientChange)
    @test MOI.get(model, MOI.ListOfModelAttributesSet()) == []
    x = MOI.add_variable(model)
    MOI.modify(model, attr, MOI.ScalarCoefficientChange(x, T(1)))
    @test MOI.get(model, MOI.ListOfModelAttributesSet()) == [attr]
    return
end


text:
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

@recipe function f(polyarea::PolyArea)
  seriestype --> :path
  seriescolor --> :black
  label --> "polyarea"

  pchains = chains(polyarea)

  # plot outer chain
  @series begin
    first(pchains)
  end

  # plot inner chains
  for pchain in pchains[2:end]
    @series begin
      primary --> false
      pchain
    end
  end
end


text:
#=
Given an integer k and a string s, find the length of the longest substring that contains at most k distinct characters.

For example, given s = "abcba" and k = 2, the longest substring with k distinct characters is "bcb".
=#

function find_longest_substring(k::Int64, s::String)
    longest_substring = ""
    for char_index in 1:length(s)
        substring, length_substring = find_substring(k::Int64, s[char_index:end])
        if length_substring >= length(longest_substring)
            longest_substring = substring
        end
    end
    return longest_substring, length(longest_substring)
end

function find_substring(k::Int64, s::String)
    index = 1
    substring = ""
    allowed_char = [s[1]]
    while length(allowed_char) <= k && index < length(s)
        substring = substring * s[index:index]
        index = index + 1
        allowed_char = unique(append!(allowed_char, s[index]))
    end
    return substring, length(substring)
end

max_stars_repo_name: DominiqueCaron/daily-coding-problem

max_issues_repo_name: DominiqueCaron/daily-coding-problem

max_forks_repo_name: DominiqueCaron/daily-coding-problem


text:
using LinearAlgebra;

"""
Algorithm used to evaluate a bivariate function using the
    bivariate Schur-Parlett scheme.
    """
    @enum Algorithm begin
        Taylor
        Diag
        DiagNoHp
        User
    end

    abstract type BivMatTree end

    mutable struct BivMatTreeImpl <: BivMatTree
        A11::BivMatTree
        A22::BivMatTree
        kV::Float64
        V::Union{UpperTriangular, Nothing} # Eigenvector basis
        D::Union{Array, Nothing} # Diagonal matrix
        Ttilde::Union{Matrix, Nothing} # Perturbed Schur form
        ind::Union{Array{LinearAlgebra.BlasInt}, Nothing}
        sylv::Union{Matrix{ComplexF64}, Nothing}
    end

    struct BivMatTreeTail <: BivMatTree
    end

    function newBivMatTree()
        return BivMatTreeImpl(
        BivMatTreeTail(), # A11
        BivMatTreeTail(), # A22
        1.0, # kV
        nothing, # V
        nothing, # D
        nothing, # Ttilde
        nothing, # ind
        nothing) # Sylv
    end

    mutable struct Fun2MInfo
        nblocksA
        nblocksB
        time_schur_form
        time_blocking
        time_fun2mric
        time_sylvester
        time_diag
        maxdeg
        digits
    end

max_stars_repo_name: numpi/BivMatFun

max_issues_repo_name: numpi/BivMatFun

max_forks_repo_name: numpi/BivMatFun


text:
#!/Applications/Julia-0.3.9.app/Contents/Resources/julia/bin/julia

using Color

function compare_colors(color_a, color_b)
    # compare two colors, looking just at their LUV luminance values
    rx, gx, bx = color_a
    ry, gy, by = color_b
    hslx = convert(LUV, RGB(rx, gx, bx))
    hsly = convert(LUV, RGB(ry, gy, by))
    hslx.l > hsly.l
end

function draw_swatch(colorname, x, y, swatchwidth, swatchheight, color_values)
    r, g, b = color_values
    toplabel = """<text x="$(x)" y="$(y - 3)" fill="black" font-size="5px" font-family="Helvetica-Bold">$colorname</text>\n"""
    bottomlabel = """<text x="$(x)" y="$(y + swatchheight + 3)" font-size="3px" font-family="Helvetica">($r, $g, $b)</text>\n"""
    return  toplabel *
            bottomlabel *
            """<rect rx="2" ry="2" x="$(x)" y="$(y)" width="$(swatchwidth)" height="$(swatchheight)" fill="rgb($r, $g, $b)" /> \n """
end

function draw_synonym(colorname, x, y, swatchwidth, swatchheight)
    # add a synonym below the swatch
    return """<text x="$(x)" y="$(y + swatchheight + 3)" fill="black" font-size="3px" font-family="Helvetica-Bold">$colorname</text>\n"""
end

function make_color_table(image_width, image_height, output_file)
    # prepare synonym lists
    synonyms = Dict{Tuple, Array}()
    for color in Color.color_names
        col_name  = color[1]
        col_value = color[2]
        if haskey(synonyms, col_value)
            push!(synonyms[col_value], col_name)
        else
            synonyms[col_value] = [col_name]
        end
    end

    # calculate sizes of swatches
    aspect = image_width/image_height
    if aspect > 1
        n_rows = ceil(sqrt(length(synonyms)/aspect))
    else
        n_rows = ceil(sqrt(length(synonyms) * aspect))
    end
    n_cols = ceil(length(synonyms)/n_rows)

    margin = 30
    row_space = 25
    col_space = 15

    swatchwidth  = ((image_width  - margin - margin - (col_space * n_cols )) / n_cols)
    swatchheight = ((image_height - margin - margin - (row_space * n_rows )) / n_rows)

    # send output to file
    f = open(output_file, "w")

    # write svg header
    println(f, """<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="$(image_width)" height="$(image_height)"> \n
    <rect x="0" y="0" width="$(image_width)" height="$(image_height)" fill="white" /> \n """)

    # title
    println(f, """<text x="$(margin)" y="$(margin - margin/2)" font-size="14px" font-family="Helvetica-Bold">Color names in Color.jl, sorted by luminance</text>\n""")

    # x and y track position
    x = margin
    y = margin

    for color_values in sort(collect(keys(synonyms)), lt = (x,y) -> compare_colors(x,y))
        color_synonyms = sort(synonyms[color_values])
        print(f, draw_swatch(color_synonyms[1], x, y, swatchwidth, swatchheight, color_values))
        oldy = y # save the current position during excursion
        for synonym in color_synonyms[2:end]
            # draw the other names for this color
            y += 3
            print(f, draw_synonym(string("also: " * synonym), x, y, swatchwidth, swatchheight))
        end
        y = oldy
        if x > (image_width - swatchwidth - margin - margin)
            x = margin # next row
            y += swatchheight + row_space # gap between rows
        else
            x += swatchwidth + col_space  # gap between columns
        end
    end
    println(f, "</svg>")
    close(f)
end

make_color_table(1400, 1400, "/tmp/color_names_sorted.svg")


text:
export
    get_speeds

"""
    get_speeds(trajdata::Trajdata, carid::Int)
Get all of the speeds, in order, for the given vehicle in the trajdata
"""
function get_speeds(trajdata::Trajdata, carid::Int)
    retval = Float64[]
    for frame in 1 : nframes(trajdata)
        if iscarinframe(trajdata, carid, frame)
            state = get_state(trajdata, carid, frame)
            push!(retval, state.v)
        end
    end
    retval
end


text:
using AcuteML

@aml mutable struct inner "~"
    id1::Int, att"~"
    desc1::String, "~"
end

@aml mutable struct outer doc"outer"
    id2::Int, att"~"
    innerList::Vector{inner}, "inner"
end

i1 = inner(id1 = 1, desc1 = "desc1")
i2 = inner(id1 = 2, desc1 = "desc2")
o1 = outer(id2 = 3, innerList = [i1, i2])
pprint(o1)

pprint("./o1.xml", o1)

xml = readxml("./o1.xml")

o2 = outer(xml)

rm("./o1.xml")

max_stars_repo_name: aminya/AML

max_forks_repo_name: aminya/AML


text:
# shortcut for warping shape to the mean shape
warp_to_mean_shape{N}(m::AAModel, img::Array{Float64, N}, src_shape::Shape) =
    pa_warp(m.wparams, img, src_shape)

function q_params_to_affine(m::AAModel, q::Vector{Float64})
    t = m.wparams.trigs[1, :]
    base = zeros(2, 3)
    warped = zeros(2, 3)
    for i=1:3
        base[1, i] = m.s0[t[i]]
        base[2, i] = m.s0[m.np+t[i]]
        warped[1, i] = (base[1, i] + m.s_star[t[i], :] * q)[1]
        warped[2, i] = (base[2, i] + m.s_star[m.np+t[i], :] * q)[1]
    end

    den = ((base[1,2] - base[1,1]) * (base[2,3] - base[2,1]) -
           (base[2,2] - base[2,1]) * (base[1,3] - base[1,1]))

    # these are not barycentric coordinates, but are used similarly
    alpha = (-base[1,1] * (base[2,3] - base[2,1]) + base[2,1] * (base[1,3] - base[1,1])) / den
    beta  = (-base[2,1] * (base[1,2] - base[1,1]) + base[1,1] * (base[2,2] - base[2,1])) / den

    # we start with the translation component
    a1 = warped[1,1] + (warped[1,2] - warped[1,1]) * alpha + (warped[1,3] - warped[1,1]) * beta
    a4 = warped[2,1] + (warped[2,2] - warped[2,1]) * alpha + (warped[2,3] - warped[2,1]) * beta

    alpha = (base[2,3] - base[2,1]) / den
    beta  = (base[2,1] - base[2,2]) / den

    # relationships between original x coordinate and warped x and y coordinates
    a2 = (warped[1,2] - warped[1,1]) * alpha + (warped[1,3] - warped[1,1]) * beta
    a5 = (warped[2,2] - warped[2,1]) * alpha + (warped[2,3] - warped[2,1]) * beta

    alpha = (base[1,2] - base[1,1]) / den
    beta  = (base[1,1] - base[1,3]) / den

    # relationships between original y coordinate and warped x and y coordinates
    a3 = (warped[1,3] - warped[1,1]) * alpha + (warped[1,2] - warped[1,1]) * beta
    a6 = (warped[2,3] - warped[2,1]) * alpha + (warped[2,2] - warped[2,1]) * beta

    # store in matrix form
    # to be used in this way:
    #  shape * A + tr ==> N(shape, q)
    tr = [a1 a4]
    A = [a2 a5; a3 a6]
    return A, tr
end

function compose_warps(m::AAModel, shape::Shape, incr::Shape)
    nt = zeros(m.np)
    comp_warp = zeros(m.np, 2)
    ntrigs = size(m.wparams.trigs, 1)
    for i=1:ntrigs
        t = m.wparams.trigs[i, :]
        nt[t[1]] += 1
        nt[t[2]] += 1
        nt[t[3]] += 1
        for k=1:3
            t2 = copy(t)
            t2[1] = t[k]
            t2[k] = t[1]
            # vertices of the triangle in the mean shape
            i1 = m.s0[t2[1]]
            j1 = m.s0[m.np + t2[1]]
            i2 = m.s0[t2[2]]
            j2 = m.s0[m.np + t2[2]]
            i3 = m.s0[t2[3]]
            j3 = m.s0[m.np + t2[3]]

            i_coord = incr[t2[1], 1]
            j_coord = incr[t2[1], 2]

            den = (i2 - i1) * (j3 - j1) - (j2 - j1) * (i3 - i1)
            alpha = ((i_coord - i1) * (j3 - j1) -
                     (j_coord - j1) * (i3 - i1)) / den
            beta = ((j_coord - j1) * (i2 - i1) -
                    (i_coord - i1) * (j2 - j1)) / den
            comp_warp[t2[1], :] =
                (comp_warp[t2[1],:] +
                 alpha * (shape[t2[2],:] - shape[t2[1],:]) +
                 beta * (shape[t2[3],:] - shape[t2[1],:]))

        end
    end
    comp_warp = shape .+ comp_warp ./ repmat(nt, 1, 2)
    return comp_warp
end


text:
for T in (Float64, #=Float32=#)
    A3 = tensors[(Space(3), T)]
    A3x3 = tensors[(Space(3,3), T)]
    A3x3s = tensors[(Space(Symmetry(3,3)), T)]
    A3x3x3 = tensors[(Space(3,3,3), T)]
    A3x3x3x3 = tensors[(Space(3,3,3,3), T)]
    A3x3x3x3s = tensors[(Space(Symmetry(3,3),Symmetry(3,3)), T)]
    if run_array
        B3 = Array(A3)
        B3x3 = Array(A3x3)
        B3x3s = Array(A3x3s)
        B3x3x3 = Array(A3x3x3)
        B3x3x3x3 = Array(A3x3x3x3)
        B3x3x3x3s = Array(A3x3x3x3s)
    end

    # dot
    suite["Tensor"]["Space(3) ⋅ Space(3)"] = @benchmarkable $(Ref(A3))[] ⋅ $(Ref(A3))[]
    suite["Tensor"]["Space(3,3) ⋅ Space(3)"] = @benchmarkable $(Ref(A3x3))[] ⋅ $(Ref(A3))[]
    suite["Tensor"]["Space(Symmetry(3,3)) ⋅ Space(3)"] = @benchmarkable $(Ref(A3x3s)[]) ⋅ $(Ref(A3))[]
    if run_array
        suite["Array"]["Space(3) ⋅ Space(3)"] = @benchmarkable $(Ref(B3))[] ⋅ $(Ref(B3))[]
        suite["Array"]["Space(3,3) ⋅ Space(3)"] = @benchmarkable $(Ref(B3x3))[] * $(Ref(B3))[]
        suite["Array"]["Space(Symmetry(3,3)) ⋅ Space(3)"] = @benchmarkable $(Ref(B3x3s))[] * $(Ref(B3))[]
    end

    # double_contraction
    suite["Tensor"]["Space(3,3) ⊡ Space(3,3)"] = @benchmarkable $(Ref(A3x3))[] ⊡ $(Ref(A3x3))[]
    suite["Tensor"]["Space(Symmetry(3,3)) ⊡ Space(Symmetry(3,3))"] = @benchmarkable $(Ref(A3x3s))[] ⊡ $(Ref(A3x3s))[]
    suite["Tensor"]["Space(3,3,3) ⊡ Space(3,3)"] = @benchmarkable $(Ref(A3x3x3))[] ⊡ $(Ref(A3x3))[]
    suite["Tensor"]["Space(3,3,3,3) ⊡ Space(3,3)"] = @benchmarkable $(Ref(A3x3x3x3))[] ⊡ $(Ref(A3x3))[]
    suite["Tensor"]["Space(Symmetry(3,3),Symmetry(3,3)) ⊡ Space(Symmetry(3,3))"] = @benchmarkable $(Ref(A3x3x3x3s))[] ⊡ $(Ref(A3x3s))[]
    if run_array
        suite["Array"]["Space(3,3) ⊡ Space(3,3)"] = @benchmarkable $(Ref(B3x3))[] ⋅ $(Ref(B3x3))[]
        suite["Array"]["Space(Symmetry(3,3)) ⊡ Space(Symmetry(3,3))"] = @benchmarkable $(Ref(B3x3s))[] ⋅ $(Ref(B3x3s))[]
        suite["Array"]["Space(3,3,3) ⊡ Space(3,3)"] = @benchmarkable $(Ref(reshape(B3x3x3, 3, 9)))[] * $(Ref(reshape(B3x3, 9, 1)))[]
        suite["Array"]["Space(3,3,3,3) ⊡ Space(3,3)"] = @benchmarkable $(Ref(reshape(B3x3x3x3, 9, 9)))[] * $(Ref(reshape(B3x3, 9, 1)))[]
        suite["Array"]["Space(Symmetry(3,3),Symmetry(3,3)) ⊡ Space(Symmetry(3,3))"] = @benchmarkable $(Ref(reshape(B3x3x3x3s, 9, 9)))[] * $(Ref(reshape(B3x3s, 9, 1)))[]
    end

    # otimes
    suite["Tensor"]["Space(3) ⊗ Space(3)"] = @benchmarkable $(Ref(A3))[] ⊗ $(Ref(A3))[]
    if run_array
        suite["Array"]["Space(3) ⊗ Space(3)"] = @benchmarkable $(Ref(B3))[] * $(Ref(B3))[]'
    end

    # cross
    suite["Tensor"]["Space(3) × Space(3)"] = @benchmarkable $(Ref(A3))[] × $(Ref(A3))[]
    if run_array
        suite["Array"]["Space(3) × Space(3)"] = @benchmarkable $(Ref(B3))[] × $(Ref(B3))[]
    end

    # det
    suite["Tensor"]["det(Space(3,3))"] = @benchmarkable det($(Ref(A3x3))[])
    suite["Tensor"]["det(Space(Symmetry(3,3)))"] = @benchmarkable det($(Ref(A3x3s))[])
    if run_array
        suite["Array"]["det(Space(3,3))"] = @benchmarkable det($(Ref(B3x3))[])
        suite["Array"]["det(Space(Symmetry(3,3)))"] = @benchmarkable det($(Ref(B3x3s))[])
    end

    # inv
    suite["Tensor"]["inv(Space(3,3))"] = @benchmarkable inv($(Ref(A3x3))[])
    suite["Tensor"]["inv(Space(Symmetry(3,3)))"] = @benchmarkable inv($(Ref(A3x3s))[])
    suite["Tensor"]["inv(Space(3,3,3,3))"] = @benchmarkable inv($(Ref(A3x3x3x3))[])
    suite["Tensor"]["inv(Space(Symmetry(3,3),Symmetry(3,3)))"] = @benchmarkable inv($(Ref(A3x3x3x3s))[])
    if run_array
        suite["Array"]["inv(Space(3,3))"] = @benchmarkable inv($(Ref(B3x3))[])
        suite["Array"]["inv(Space(Symmetry(3,3)))"] = @benchmarkable inv($(Ref(B3x3s))[])
        suite["Array"]["inv(Space(3,3,3,3))"] = @benchmarkable inv($(Ref(reshape(B3x3x3x3, 9, 9)))[])
        suite["Array"]["inv(Space(Symmetry(3,3),Symmetry(3,3)))"] = @benchmarkable inv($(Ref(reshape(B3x3x3x3, 9, 9)))[]) # B3x3x3x3s is not invertible
    end
end


text:
module MyApp

using Example

greet() = print("Hello World!")

Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
    println("hello, world")
    @show Example.domath(5)
    @show sin(0.0)
    return 0
end

end # module


text:
### A Pluto.jl notebook ###
# v0.12.20

using Markdown
using InteractiveUtils

# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
    quote
        local el = $(esc(element))
        global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
        el
    end
end

# ╔═╡ b1a8e446-76c6-11eb-2474-874d4bc0a9cc
using Plots

# ╔═╡ e338d842-7719-11eb-35c6-efdf74875751
using PlutoUI

# ╔═╡ e80655b8-76c5-11eb-1438-85fd5054780b
next_logistic(x, growth_rate=2.6) = growth_rate .* x .* (1 .- x)

# ╔═╡ 54a5bd48-76c6-11eb-18fa-65a57e2be14f
begin
  x = 0:.001:1
  y = next_logistic.(x);
end

# ╔═╡ cf72f62e-76c6-11eb-3389-d343b8217f7b
plot(x, y, dpi=200, legend=false)

# ╔═╡ ddb1a95a-7730-11eb-0c51-19fc37d551eb
md"""
#### Negative feedback loop
In the sense, once an iteration get a high $x_n$, the next iteration $x_{n+1}$ will be mapped to a small value.

"""

# ╔═╡ 41ab4ace-76c8-11eb-1779-eb7d95ed3842
#@bind n Slider(1:100, default=1, show_value=true)

# ╔═╡ d3ae7692-7724-11eb-30d6-091451792d46
md"""
`n` $(@bind n Slider(1:1000, default=1, show_value=true))
$(html"
")
`x1` $(@bind x1 Slider(0:0.01:1, default=.4, show_value=true))
$(html"
")
`r` $(@bind r Slider(0:0.1:999_999_999, default=2.6, show_value=true))
"""

# ╔═╡ bfd9a498-76c7-11eb-07c7-ad7d1144d4d7
begin
  xn = x1
  for i in 1:n
    xn = next_logistic(xn, r)
  end
  xn
end

# ╔═╡ aebdfe54-7731-11eb-3ad4-e1a139ada52f
begin
  length = 50
  xs = [0. for _ in 1:length]
  xs[1] = x1
  for i in 2:length
	xs[i] = next_logistic(xs[i-1], r)
  end
  xs
end

# ╔═╡ 0e9528c8-7734-11eb-0e4a-bf65284ad4aa
md"""
**tweak** the intial population `x1` to observe that the convergent value changes
- not with `x1`
- but with `r`
"""

# ╔═╡ 79ddeee2-7733-11eb-2f04-0132bae963ff
begin
  good_dpi = 300
  plot(xs, dpi=good_dpi)
  scatter!(xs, dpi=good_dpi, ylims=(0,1),
		title="r = $r,  x1 = $(x1)\nxs[$(length)] = $(xs[end])", legend=false)
end

# ╔═╡ Cell order:
# ╠═e80655b8-76c5-11eb-1438-85fd5054780b
# ╠═b1a8e446-76c6-11eb-2474-874d4bc0a9cc
# ╠═54a5bd48-76c6-11eb-18fa-65a57e2be14f
# ╠═cf72f62e-76c6-11eb-3389-d343b8217f7b
# ╟─ddb1a95a-7730-11eb-0c51-19fc37d551eb
# ╠═e338d842-7719-11eb-35c6-efdf74875751
# ╠═41ab4ace-76c8-11eb-1779-eb7d95ed3842
# ╟─d3ae7692-7724-11eb-30d6-091451792d46
# ╠═bfd9a498-76c7-11eb-07c7-ad7d1144d4d7
# ╠═aebdfe54-7731-11eb-3ad4-e1a139ada52f
# ╟─0e9528c8-7734-11eb-0e4a-bf65284ad4aa
# ╟─79ddeee2-7733-11eb-2f04-0132bae963ff