text:
# Automatically generated using Clang.jl

############################# Manual Additions by jd-lara##################################

@static if Int == Int64
    const sunindextype = Int64
else
    const sunindextype = Int32
end

# begin enum ANONYMOUS_1
const ANONYMOUS_1 = UInt32
const PREC_NONE = (UInt32)(0)
const PREC_LEFT = (UInt32)(1)
const PREC_RIGHT = (UInt32)(2)
const PREC_BOTH = (UInt32)(3)
# end enum ANONYMOUS_1

# begin enum ANONYMOUS_2
const ANONYMOUS_2 = UInt32
const MODIFIED_GS = (UInt32)(1)
const CLASSICAL_GS = (UInt32)(2)
# end enum ANONYMOUS_

##########################################################################################
const ARK_NORMAL = Cint(1)
const ARK_ONE_STEP = Cint(2)
const ARK_SUCCESS = Cint(0)
const ARK_TSTOP_RETURN = Cint(1)
const ARK_ROOT_RETURN = Cint(2)
const ARK_WARNING = Cint(99)
const ARK_TOO_MUCH_WORK = Cint(-1)
const ARK_TOO_MUCH_ACC = Cint(-2)
const ARK_ERR_FAILURE = Cint(-3)
const ARK_CONV_FAILURE = Cint(-4)
const ARK_LINIT_FAIL = Cint(-5)
const ARK_LSETUP_FAIL = Cint(-6)
const ARK_LSOLVE_FAIL = Cint(-7)
const ARK_RHSFUNC_FAIL = Cint(-8)
const ARK_FIRST_RHSFUNC_ERR = Cint(-9)
const ARK_REPTD_RHSFUNC_ERR = Cint(-10)
const ARK_UNREC_RHSFUNC_ERR = Cint(-11)
const ARK_RTFUNC_FAIL = Cint(-12)
const ARK_LFREE_FAIL = Cint(-13)
const ARK_MASSINIT_FAIL = Cint(-14)
const ARK_MASSSETUP_FAIL = Cint(-15)
const ARK_MASSSOLVE_FAIL = Cint(-16)
const ARK_MASSFREE_FAIL = Cint(-17)
const ARK_MASSMULT_FAIL = Cint(-18)
const ARK_CONSTR_FAIL = Cint(-19)
const ARK_MEM_FAIL = Cint(-20)
const ARK_MEM_NULL = Cint(-21)
const ARK_ILL_INPUT = Cint(-22)
const ARK_NO_MALLOC = Cint(-23)
const ARK_BAD_K = Cint(-24)
const ARK_BAD_T = Cint(-25)
const ARK_BAD_DKY = Cint(-26)
const ARK_TOO_CLOSE = Cint(-27)
const ARK_POSTPROCESS_FAIL = Cint(-28)
const ARK_VECTOROP_ERR = Cint(-29)
const ARK_NLS_INIT_FAIL = Cint(-30)
const ARK_NLS_SETUP_FAIL = Cint(-31)
const ARK_NLS_SETUP_RECVR = Cint(-32)
const ARK_NLS_OP_ERR = Cint(-33)
const ARK_INNERSTEP_ATTACH_ERR = Cint(-34)
const ARK_INNERSTEP_FAIL = Cint(-35)
const ARK_OUTERTOINNER_FAIL = Cint(-36)
const ARK_INNERTOOUTER_FAIL = Cint(-37)
const ARK_USER_PREDICT_FAIL = Cint(-38)
const ARK_UNRECOGNIZED_ERROR = Cint(-99)
const ARKRhsFn = Ptr{Cvoid}
const ARKRootFn = Ptr{Cvoid}
const ARKEwtFn = Ptr{Cvoid}
const ARKRwtFn = Ptr{Cvoid}
const ARKErrHandlerFn = Ptr{Cvoid}
const ARKAdaptFn = Ptr{Cvoid}
const ARKExpStabFn = Ptr{Cvoid}
const ARKVecResizeFn = Ptr{Cvoid}
const ARKPostProcessStepFn = Ptr{Cvoid}
const ARKPostProcessFn = Ptr{Cvoid} #manually added
const HEUN_EULER_2_1_2 = Cint(0)
const DEFAULT_ERK_2 = HEUN_EULER_2_1_2
const BOGACKI_SHAMPINE_4_2_3 = Cint(1)
const DEFAULT_ERK_3 = BOGACKI_SHAMPINE_4_2_3
const ZONNEVELD_5_3_4 = Cint(3)
const DEFAULT_ERK_4 = ZONNEVELD_5_3_4
const CASH_KARP_6_4_5 = Cint(6)
const DEFAULT_ERK_5 = CASH_KARP_6_4_5
const VERNER_8_5_6 = Cint(10)
const DEFAULT_ERK_6 = VERNER_8_5_6
const FEHLBERG_13_7_8 = Cint(11)
const DEFAULT_ERK_8 = FEHLBERG_13_7_8
const SDIRK_2_1_2 = Cint(100)
const DEFAULT_DIRK_2 = SDIRK_2_1_2
const ARK324L2SA_DIRK_4_2_3 = Cint(104)
const DEFAULT_DIRK_3 = ARK324L2SA_DIRK_4_2_3
const SDIRK_5_3_4 = Cint(107)
const DEFAULT_DIRK_4 = SDIRK_5_3_4
const ARK548L2SA_DIRK_8_4_5 = Cint(111)
const DEFAULT_DIRK_5 = ARK548L2SA_DIRK_8_4_5
const ARK324L2SA_ERK_4_2_3 = Cint(2)
const DEFAULT_ARK_ETABLE_3 = ARK324L2SA_ERK_4_2_3
const ARK436L2SA_ERK_6_3_4 = Cint(4)
const DEFAULT_ARK_ETABLE_4 = ARK436L2SA_ERK_6_3_4
const ARK548L2SA_ERK_8_4_5 = Cint(9)
const DEFAULT_ARK_ETABLE_5 = ARK548L2SA_ERK_8_4_5
const DEFAULT_ARK_ITABLE_3 = ARK324L2SA_DIRK_4_2_3
const ARK436L2SA_DIRK_6_3_4 = Cint(109)
const DEFAULT_ARK_ITABLE_4 = ARK436L2SA_DIRK_6_3_4
const DEFAULT_ARK_ITABLE_5 = ARK548L2SA_DIRK_8_4_5
const ARKStepStagePredictFn = Ptr{Cvoid}
const ARKLocalFn = Ptr{Cvoid}
const ARKCommFn = Ptr{Cvoid}
const realtype = Cdouble

struct ARKodeButcherTableMem
    q::Cint
    p::Cint
    stages::Cint
    A::Ptr{Ptr{realtype}}
    c::Ptr{realtype}
    b::Ptr{realtype}
    d::Ptr{realtype}
end

const ARKodeButcherTable = Ptr{ARKodeButcherTableMem}
const BILLINGTON_3_3_2 = Cint(101)
const TRBDF2_3_3_2 = Cint(102)
const KVAERNO_4_2_3 = Cint(103)
const CASH_5_2_4 = Cint(105)
const CASH_5_3_4 = Cint(106)
const KVAERNO_5_3_4 = Cint(108)
const KVAERNO_7_4_5 = Cint(110)
const ARK437L2SA_DIRK_7_3_4 = Cint(112)
const ARK548L2SAb_DIRK_8_4_5 = Cint(113)
const MIN_DIRK_NUM = Cint(100)
const MAX_DIRK_NUM = Cint(113)
const SAYFY_ABURUB_6_3_4 = Cint(5)
const FEHLBERG_6_4_5 = Cint(7)
const DORMAND_PRINCE_7_4_5 = Cint(8)
const KNOTH_WOLKE_3_3 = Cint(12)
const ARK437L2SA_ERK_7_3_4 = Cint(13)
const ARK548L2SAb_ERK_8_4_5 = Cint(14)
const MIN_ERK_NUM = Cint(0)
const MAX_ERK_NUM = Cint(14)
const ARKLS_SUCCESS = Cint(0)
const ARKLS_MEM_NULL = Cint(-1)
const ARKLS_LMEM_NULL = Cint(-2)
const ARKLS_ILL_INPUT = Cint(-3)
const ARKLS_MEM_FAIL = Cint(-4)
const ARKLS_PMEM_NULL = Cint(-5)
const ARKLS_MASSMEM_NULL = Cint(-6)
const ARKLS_JACFUNC_UNRECVR = Cint(-7)
const ARKLS_JACFUNC_RECVR = Cint(-8)
const ARKLS_MASSFUNC_UNRECVR = Cint(-9)
const ARKLS_MASSFUNC_RECVR = Cint(-10)
const ARKLS_SUNMAT_FAIL = Cint(-11)
const ARKLS_SUNLS_FAIL = Cint(-12)
const ARKLsJacFn = Ptr{Cvoid}
const ARKLsMassFn = Ptr{Cvoid}
const ARKLsPrecSetupFn = Ptr{Cvoid}
const ARKLsPrecSolveFn = Ptr{Cvoid}
const ARKLsJacTimesSetupFn = Ptr{Cvoid}
const ARKLsJacTimesVecFn = Ptr{Cvoid}
const ARKLsLinSysFn = Ptr{Cvoid}
const ARKLsMassTimesSetupFn = Ptr{Cvoid}
const ARKLsMassTimesVecFn = Ptr{Cvoid}
const ARKLsMassPrecSetupFn = Ptr{Cvoid}
const ARKLsMassPrecSolveFn = Ptr{Cvoid}
const DEFAULT_MRI_TABLE_3 = KNOTH_WOLKE_3_3

CEnum.@cenum MRISTEP_ID::UInt32 begin
    MRISTEP_ARKSTEP = 0
end

const MRIStepPreInnerFn = Ptr{Cvoid}
const MRIStepPostInnerFn = Ptr{Cvoid}
const CV_ADAMS = Cint(1)
const CV_BDF = Cint(2)
const CV_NORMAL = Cint(1)
const CV_ONE_STEP = Cint(2)
const CV_SUCCESS = Cint(0)
const CV_TSTOP_RETURN = Cint(1)
const CV_ROOT_RETURN = Cint(2)
const CV_WARNING = Cint(99)
const CV_TOO_MUCH_WORK = Cint(-1)
const CV_TOO_MUCH_ACC = Cint(-2)
const CV_ERR_FAILURE = Cint(-3)
const CV_CONV_FAILURE = Cint(-4)
const CV_LINIT_FAIL = Cint(-5)
const CV_LSETUP_FAIL = Cint(-6)
const CV_LSOLVE_FAIL = Cint(-7)
const CV_RHSFUNC_FAIL = Cint(-8)
const CV_FIRST_RHSFUNC_ERR = Cint(-9)
const CV_REPTD_RHSFUNC_ERR = Cint(-10)
const CV_UNREC_RHSFUNC_ERR = Cint(-11)
const CV_RTFUNC_FAIL = Cint(-12)
const CV_NLS_INIT_FAIL = Cint(-13)
const CV_NLS_SETUP_FAIL = Cint(-14)
const CV_CONSTR_FAIL = Cint(-15)
const CV_NLS_FAIL = Cint(-16)
const CV_MEM_FAIL = Cint(-20)
const CV_MEM_NULL = Cint(-21)
const CV_ILL_INPUT = Cint(-22)
const CV_NO_MALLOC = Cint(-23)
const CV_BAD_K = Cint(-24)
const CV_BAD_T = Cint(-25)
const CV_BAD_DKY = Cint(-26)
const CV_TOO_CLOSE = Cint(-27)
const CV_VECTOROP_ERR = Cint(-28)
const CV_UNRECOGNIZED_ERR = Cint(-99)
const CVRhsFn = Ptr{Cvoid}
const CVRootFn = Ptr{Cvoid}
const CVEwtFn = Ptr{Cvoid}
const CVErrHandlerFn = Ptr{Cvoid}
const CVLocalFn = Ptr{Cvoid}
const CVCommFn = Ptr{Cvoid}
const CVDIAG_SUCCESS = Cint(0)
const CVDIAG_MEM_NULL = Cint(-1)
const CVDIAG_LMEM_NULL = Cint(-2)
const CVDIAG_ILL_INPUT = Cint(-3)
const CVDIAG_MEM_FAIL = Cint(-4)
const CVDIAG_INV_FAIL = Cint(-5)
const CVDIAG_RHSFUNC_UNRECVR = Cint(-6)
const CVDIAG_RHSFUNC_RECVR = Cint(-7)
const CVLsJacFn = Ptr{Cvoid}
const CVDlsJacFn = CVLsJacFn
const CVLS_SUCCESS = Cint(0)
const CVLS_MEM_NULL = Cint(-1)
const CVLS_LMEM_NULL = Cint(-2)
const CVLS_ILL_INPUT = Cint(-3)
const CVLS_MEM_FAIL = Cint(-4)
const CVLS_PMEM_NULL = Cint(-5)
const CVLS_JACFUNC_UNRECVR = Cint(-6)
const CVLS_JACFUNC_RECVR = Cint(-7)
const CVLS_SUNMAT_FAIL = Cint(-8)
const CVLS_SUNLS_FAIL = Cint(-9)
const CVLsPrecSetupFn = Ptr{Cvoid}
const CVLsPrecSolveFn = Ptr{Cvoid}
const CVLsJacTimesSetupFn = Ptr{Cvoid}
const CVLsJacTimesVecFn = Ptr{Cvoid}
const CVLsLinSysFn = Ptr{Cvoid}
const CVSpilsPrecSetupFn = CVLsPrecSetupFn
const CVSpilsPrecSolveFn = CVLsPrecSolveFn
const CVSpilsJacTimesSetupFn = CVLsJacTimesSetupFn
const CVSpilsJacTimesVecFn = CVLsJacTimesVecFn
const CV_SIMULTANEOUS = Cint(1)
const CV_STAGGERED = Cint(2)
const CV_STAGGERED1 = Cint(3)
const CV_CENTERED = Cint(1)
const CV_FORWARD = Cint(2)
const CV_HERMITE = Cint(1)
const CV_POLYNOMIAL = Cint(2)
const CV_NO_QUAD = Cint(-30)
const CV_QRHSFUNC_FAIL = Cint(-31)
const CV_FIRST_QRHSFUNC_ERR = Cint(-32)
const CV_REPTD_QRHSFUNC_ERR = Cint(-33)
const CV_UNREC_QRHSFUNC_ERR = Cint(-34)
const CV_NO_SENS = Cint(-40)
const CV_SRHSFUNC_FAIL = Cint(-41)
const CV_FIRST_SRHSFUNC_ERR = Cint(-42)
const CV_REPTD_SRHSFUNC_ERR = Cint(-43)
const CV_UNREC_SRHSFUNC_ERR = Cint(-44)
const CV_BAD_IS = Cint(-45)
const CV_NO_QUADSENS = Cint(-50)
const CV_QSRHSFUNC_FAIL = Cint(-51)
const CV_FIRST_QSRHSFUNC_ERR = Cint(-52)
const CV_REPTD_QSRHSFUNC_ERR = Cint(-53)
const CV_UNREC_QSRHSFUNC_ERR = Cint(-54)
const CV_NO_ADJ = Cint(-101)
const CV_NO_FWD = Cint(-102)
const CV_NO_BCK = Cint(-103)
const CV_BAD_TB0 = Cint(-104)
const CV_REIFWD_FAIL = Cint(-105)
const CV_FWD_FAIL = Cint(-106)
const CV_GETY_BADT = Cint(-107)
const CVQuadRhsFn = Ptr{Cvoid}
const CVSensRhsFn = Ptr{Cvoid}
const CVSensRhs1Fn = Ptr{Cvoid}
const CVQuadSensRhsFn = Ptr{Cvoid}
const CVRhsFnB = Ptr{Cvoid}
const CVRhsFnBS = Ptr{Cvoid}
const CVQuadRhsFnB = Ptr{Cvoid}
const CVQuadRhsFnBS = Ptr{Cvoid}

struct CVadjCheckPointRec
    my_addr::Ptr{Cvoid}
    next_addr::Ptr{Cvoid}
    t0::realtype
    t1::realtype
    nstep::Clong
    order::Cint
    step::realtype
end

const CVLocalFnB = Ptr{Cvoid}
const CVCommFnB = Ptr{Cvoid}
const CVDIAG_NO_ADJ = Cint(-101)
const CVLsJacFnB = Ptr{Cvoid}
const CVDlsJacFnB = CVLsJacFnB
const CVLsJacFnBS = Ptr{Cvoid}
const CVDlsJacFnBS = CVLsJacFnBS
const CVLS_NO_ADJ = Cint(-101)
const CVLS_LMEMB_NULL = Cint(-102)
const CVLsPrecSetupFnB = Ptr{Cvoid}
const CVLsPrecSetupFnBS = Ptr{Cvoid}
const CVLsPrecSolveFnB = Ptr{Cvoid}
const CVLsPrecSolveFnBS = Ptr{Cvoid}
const CVLsJacTimesSetupFnB = Ptr{Cvoid}
const CVLsJacTimesSetupFnBS = Ptr{Cvoid}
const CVLsJacTimesVecFnB = Ptr{Cvoid}
const CVLsJacTimesVecFnBS = Ptr{Cvoid}
const CVLsLinSysFnB = Ptr{Cvoid}
const CVLsLinSysFnBS = Ptr{Cvoid}
const CVSpilsPrecSetupFnB = CVLsPrecSetupFnB
const CVSpilsPrecSetupFnBS = CVLsPrecSetupFnBS
const CVSpilsPrecSolveFnB = CVLsPrecSolveFnB
const CVSpilsPrecSolveFnBS = CVLsPrecSolveFnBS
const CVSpilsJacTimesSetupFnB = CVLsJacTimesSetupFnB
const CVSpilsJacTimesSetupFnBS = CVLsJacTimesSetupFnBS
const CVSpilsJacTimesVecFnB = CVLsJacTimesVecFnB
const CVSpilsJacTimesVecFnBS = CVLsJacTimesVecFnBS
const IDA_NORMAL = Cint(1)
const IDA_ONE_STEP = Cint(2)
const IDA_YA_YDP_INIT = Cint(1)
const IDA_Y_INIT = Cint(2)
const IDA_SUCCESS = Cint(0)
const IDA_TSTOP_RETURN = Cint(1)
const IDA_ROOT_RETURN = Cint(2)
const IDA_WARNING = Cint(99)
const IDA_TOO_MUCH_WORK = Cint(-1)
const IDA_TOO_MUCH_ACC = Cint(-2)
const IDA_ERR_FAIL = Cint(-3)
const IDA_CONV_FAIL = Cint(-4)
const IDA_LINIT_FAIL = Cint(-5)
const IDA_LSETUP_FAIL = Cint(-6)
const IDA_LSOLVE_FAIL = Cint(-7)
const IDA_RES_FAIL = Cint(-8)
const IDA_REP_RES_ERR = Cint(-9)
const IDA_RTFUNC_FAIL = Cint(-10)
const IDA_CONSTR_FAIL = Cint(-11)
const IDA_FIRST_RES_FAIL = Cint(-12)
const IDA_LINESEARCH_FAIL = Cint(-13)
const IDA_NO_RECOVERY = Cint(-14)
const IDA_NLS_INIT_FAIL = Cint(-15)
const IDA_NLS_SETUP_FAIL = Cint(-16)
const IDA_NLS_FAIL = Cint(-17)
const IDA_MEM_NULL = Cint(-20)
const IDA_MEM_FAIL = Cint(-21)
const IDA_ILL_INPUT = Cint(-22)
const IDA_NO_MALLOC = Cint(-23)
const IDA_BAD_EWT = Cint(-24)
const IDA_BAD_K = Cint(-25)
const IDA_BAD_T = Cint(-26)
const IDA_BAD_DKY = Cint(-27)
const IDA_VECTOROP_ERR = Cint(-28)
const IDA_UNRECOGNIZED_ERROR = Cint(-99)
const IDAResFn = Ptr{Cvoid}
const IDARootFn = Ptr{Cvoid}
const IDAEwtFn = Ptr{Cvoid}
const IDAErrHandlerFn = Ptr{Cvoid}
const IDABBDLocalFn = Ptr{Cvoid}
const IDABBDCommFn = Ptr{Cvoid}
const IDALsJacFn = Ptr{Cvoid}
const IDADlsJacFn = IDALsJacFn
const IDALS_SUCCESS = Cint(0)
const IDALS_MEM_NULL = Cint(-1)
const IDALS_LMEM_NULL = Cint(-2)
const IDALS_ILL_INPUT = Cint(-3)
const IDALS_MEM_FAIL = Cint(-4)
const IDALS_PMEM_NULL = Cint(-5)
const IDALS_JACFUNC_UNRECVR = Cint(-6)
const IDALS_JACFUNC_RECVR = Cint(-7)
const IDALS_SUNMAT_FAIL = Cint(-8)
const IDALS_SUNLS_FAIL = Cint(-9)
const IDALsPrecSetupFn = Ptr{Cvoid}
const IDALsPrecSolveFn = Ptr{Cvoid}
const IDALsJacTimesSetupFn = Ptr{Cvoid}
const IDALsJacTimesVecFn = Ptr{Cvoid}
const IDASpilsPrecSetupFn = IDALsPrecSetupFn
const IDASpilsPrecSolveFn = IDALsPrecSolveFn
const IDASpilsJacTimesSetupFn = IDALsJacTimesSetupFn
const IDASpilsJacTimesVecFn = IDALsJacTimesVecFn
const IDA_SIMULTANEOUS = Cint(1)
const IDA_STAGGERED = Cint(2)
const IDA_CENTERED = Cint(1)
const IDA_FORWARD = Cint(2)
const IDA_HERMITE = Cint(1)
const IDA_POLYNOMIAL = Cint(2)
const IDA_NO_QUAD = Cint(-30)
const IDA_QRHS_FAIL = Cint(-31)
const IDA_FIRST_QRHS_ERR = Cint(-32)
const IDA_REP_QRHS_ERR = Cint(-33)
const IDA_NO_SENS = Cint(-40)
const IDA_SRES_FAIL = Cint(-41)
const IDA_REP_SRES_ERR = Cint(-42)
const IDA_BAD_IS = Cint(-43)
const IDA_NO_QUADSENS = Cint(-50)
const IDA_QSRHS_FAIL = Cint(-51)
const IDA_FIRST_QSRHS_ERR = Cint(-52)
const IDA_REP_QSRHS_ERR = Cint(-53)
const IDA_NO_ADJ = Cint(-101)
const IDA_NO_FWD = Cint(-102)
const IDA_NO_BCK = Cint(-103)
const IDA_BAD_TB0 = Cint(-104)
const IDA_REIFWD_FAIL = Cint(-105)
const IDA_FWD_FAIL = Cint(-106)
const IDA_GETY_BADT = Cint(-107)
const IDAQuadRhsFn = Ptr{Cvoid}
const IDASensResFn = Ptr{Cvoid}
const IDAQuadSensRhsFn = Ptr{Cvoid}
const IDAResFnB = Ptr{Cvoid}
const IDAResFnBS = Ptr{Cvoid}
const IDAQuadRhsFnB = Ptr{Cvoid}
const IDAQuadRhsFnBS = Ptr{Cvoid}

struct IDAadjCheckPointRec
    my_addr::Ptr{Cvoid}
    next_addr::Ptr{Cvoid}
    t0::realtype
    t1::realtype
    nstep::Clong
    order::Cint
    step::realtype
end

const IDABBDLocalFnB = Ptr{Cvoid}
const IDABBDCommFnB = Ptr{Cvoid}
const IDALsJacFnB = Ptr{Cvoid}
const IDADlsJacFnB = IDALsJacFnB
const IDALsJacFnBS = Ptr{Cvoid}
const IDADlsJacFnBS = IDALsJacFnBS
const IDALS_NO_ADJ = Cint(-101)
const IDALS_LMEMB_NULL = Cint(-102)
const IDALsPrecSetupFnB = Ptr{Cvoid}
const IDALsPrecSetupFnBS = Ptr{Cvoid}
const IDALsPrecSolveFnB = Ptr{Cvoid}
const IDALsPrecSolveFnBS = Ptr{Cvoid}
const IDALsJacTimesSetupFnB = Ptr{Cvoid}
const IDALsJacTimesSetupFnBS = Ptr{Cvoid}
const IDALsJacTimesVecFnB = Ptr{Cvoid}
const IDALsJacTimesVecFnBS = Ptr{Cvoid}
const IDASpilsPrecSetupFnB = IDALsPrecSetupFnB
const IDASpilsPrecSetupFnBS = IDALsPrecSetupFnBS
const IDASpilsPrecSolveFnB = IDALsPrecSolveFnB
const IDASpilsPrecSolveFnBS = IDALsPrecSolveFnBS
const IDASpilsJacTimesSetupFnB = IDALsJacTimesSetupFnB
const IDASpilsJacTimesSetupFnBS = IDALsJacTimesSetupFnBS
const IDASpilsJacTimesVecFnB = IDALsJacTimesVecFnB
const IDASpilsJacTimesVecFnBS = IDALsJacTimesVecFnBS
const KIN_SUCCESS = Cint(0)
const KIN_INITIAL_GUESS_OK = Cint(1)
const KIN_STEP_LT_STPTOL = Cint(2)
const KIN_WARNING = Cint(99)
const KIN_MEM_NULL = Cint(-1)
const KIN_ILL_INPUT = Cint(-2)
const KIN_NO_MALLOC = Cint(-3)
const KIN_MEM_FAIL = Cint(-4)
const KIN_LINESEARCH_NONCONV = Cint(-5)
const KIN_MAXITER_REACHED = Cint(-6)
const KIN_MXNEWT_5X_EXCEEDED = Cint(-7)
const KIN_LINESEARCH_BCFAIL = Cint(-8)
const KIN_LINSOLV_NO_RECOVERY = Cint(-9)
const KIN_LINIT_FAIL = Cint(-10)
const KIN_LSETUP_FAIL = Cint(-11)
const KIN_LSOLVE_FAIL = Cint(-12)
const KIN_SYSFUNC_FAIL = Cint(-13)
const KIN_FIRST_SYSFUNC_ERR = Cint(-14)
const KIN_REPTD_SYSFUNC_ERR = Cint(-15)
const KIN_VECTOROP_ERR = Cint(-16)
const KIN_ETACHOICE1 = Cint(1)
const KIN_ETACHOICE2 = Cint(2)
const KIN_ETACONSTANT = Cint(3)
const KIN_NONE = Cint(0)
const KIN_LINESEARCH = Cint(1)
const KIN_PICARD = Cint(2)
const KIN_FP = Cint(3)
const KINSysFn = Ptr{Cvoid}
const KINErrHandlerFn = Ptr{Cvoid}
const KINInfoHandlerFn = Ptr{Cvoid}
const KINBBDPRE_SUCCESS = Cint(0)
const KINBBDPRE_PDATA_NULL = Cint(-11)
const KINBBDPRE_FUNC_UNRECVR = Cint(-12)
const KINBBDCommFn = Ptr{Cvoid}
const KINBBDLocalFn = Ptr{Cvoid}
const KINLsJacFn = Ptr{Cvoid}
const KINDlsJacFn = KINLsJacFn
const KINLS_SUCCESS = Cint(0)
const KINLS_MEM_NULL = Cint(-1)
const KINLS_LMEM_NULL = Cint(-2)
const KINLS_ILL_INPUT = Cint(-3)
const KINLS_MEM_FAIL = Cint(-4)
const KINLS_PMEM_NULL = Cint(-5)
const KINLS_JACFUNC_ERR = Cint(-6)
const KINLS_SUNMAT_FAIL = Cint(-7)
const KINLS_SUNLS_FAIL = Cint(-8)
const KINLsPrecSetupFn = Ptr{Cvoid}
const KINLsPrecSolveFn = Ptr{Cvoid}
const KINLsJacTimesVecFn = Ptr{Cvoid}
const KINSpilsPrecSetupFn = KINLsPrecSetupFn
const KINSpilsPrecSolveFn = KINLsPrecSolveFn
const KINSpilsJacTimesVecFn = KINLsJacTimesVecFn
#const sunindextype = Int64

struct _generic_N_Vector_Ops
    nvgetvectorid::Ptr{Cvoid}
    nvclone::Ptr{Cvoid}
    nvcloneempty::Ptr{Cvoid}
    nvdestroy::Ptr{Cvoid}
    nvspace::Ptr{Cvoid}
    nvgetarraypointer::Ptr{Cvoid}
    nvsetarraypointer::Ptr{Cvoid}
    nvgetcommunicator::Ptr{Cvoid}
    nvgetlength::Ptr{Cvoid}
    nvlinearsum::Ptr{Cvoid}
    nvconst::Ptr{Cvoid}
    nvprod::Ptr{Cvoid}
    nvdiv::Ptr{Cvoid}
    nvscale::Ptr{Cvoid}
    nvabs::Ptr{Cvoid}
    nvinv::Ptr{Cvoid}
    nvaddconst::Ptr{Cvoid}
    nvdotprod::Ptr{Cvoid}
    nvmaxnorm::Ptr{Cvoid}
    nvwrmsnorm::Ptr{Cvoid}
    nvwrmsnormmask::Ptr{Cvoid}
    nvmin::Ptr{Cvoid}
    nvwl2norm::Ptr{Cvoid}
    nvl1norm::Ptr{Cvoid}
    nvcompare::Ptr{Cvoid}
    nvinvtest::Ptr{Cvoid}
    nvconstrmask::Ptr{Cvoid}
    nvminquotient::Ptr{Cvoid}
    nvlinearcombination::Ptr{Cvoid}
    nvscaleaddmulti::Ptr{Cvoid}
    nvdotprodmulti::Ptr{Cvoid}
    nvlinearsumvectorarray::Ptr{Cvoid}
    nvscalevectorarray::Ptr{Cvoid}
    nvconstvectorarray::Ptr{Cvoid}
    nvwrmsnormvectorarray::Ptr{Cvoid}
    nvwrmsnormmaskvectorarray::Ptr{Cvoid}
    nvscaleaddmultivectorarray::Ptr{Cvoid}
    nvlinearcombinationvectorarray::Ptr{Cvoid}
    nvdotprodlocal::Ptr{Cvoid}
    nvmaxnormlocal::Ptr{Cvoid}
    nvminlocal::Ptr{Cvoid}
    nvl1normlocal::Ptr{Cvoid}
    nvinvtestlocal::Ptr{Cvoid}
    nvconstrmasklocal::Ptr{Cvoid}
    nvminquotientlocal::Ptr{Cvoid}
    nvwsqrsumlocal::Ptr{Cvoid}
    nvwsqrsummasklocal::Ptr{Cvoid}
end

const N_Vector_Ops = Ptr{_generic_N_Vector_Ops}

struct _generic_N_Vector
    content::Ptr{Cvoid}
    ops::N_Vector_Ops
end

const N_Vector = Ptr{_generic_N_Vector}

struct _N_VectorContent_ManyVector
    num_subvectors::sunindextype
    global_length::sunindextype
    subvec_array::Ptr{N_Vector}
    own_data::Cint
end

const N_VectorContent_ManyVector = Ptr{_N_VectorContent_ManyVector}

# Skipping MacroDefinition: NV_CONTENT_S ( v ) ( ( N_VectorContent_Serial ) ( v -> content ) )
# Skipping MacroDefinition: NV_LENGTH_S ( v ) ( NV_CONTENT_S ( v ) -> length )
# Skipping MacroDefinition: NV_OWN_DATA_S ( v ) ( NV_CONTENT_S ( v ) -> own_data )
# Skipping MacroDefinition: NV_DATA_S ( v ) ( NV_CONTENT_S ( v ) -> data )
# Skipping MacroDefinition: NV_Ith_S ( v , i ) ( NV_DATA_S ( v ) [ i ] )

struct _N_VectorContent_Serial
    length::sunindextype
    own_data::Cint
    data::Ptr{realtype}
end

const N_VectorContent_Serial = Ptr{_N_VectorContent_Serial}
const SUNDIALS_VERSION = "5.1.0"
const SUNDIALS_VERSION_MAJOR = Cint(5)
const SUNDIALS_VERSION_MINOR = Cint(1)
const SUNDIALS_VERSION_PATCH = Cint(0)
const SUNDIALS_VERSION_LABEL = ""

# Skipping MacroDefinition: SUNDIALS_F77_FUNC ( name , NAME ) name ## _64_
# Skipping MacroDefinition: SUNDIALS_F77_FUNC_ ( name , NAME ) name ## _64_

const SUNDIALS_DOUBLE_PRECISION = Cint(1)
const SUNDIALS_INT64_T = Cint(1)
#const SUNDIALS_INDEX_TYPE = int64_t
const SUNDIALS_MPI_COMM_F2C = Cint(0)
const SUNDIALS_DENSE = Cint(1)
const SUNDIALS_BAND = Cint(2)

# Skipping MacroDefinition: DENSE_COL ( A , j ) ( ( A -> cols ) [ j ] )
# Skipping MacroDefinition: DENSE_ELEM ( A , i , j ) ( ( A -> cols ) [ j ] [ i ] )
# Skipping MacroDefinition: BAND_COL ( A , j ) ( ( ( A -> cols ) [ j ] ) + ( A -> s_mu ) )
# Skipping MacroDefinition: BAND_COL_ELEM ( col_j , i , j ) ( col_j [ ( i ) - ( j ) ] )
# Skipping MacroDefinition: BAND_ELEM ( A , i , j ) ( ( A -> cols ) [ j ] [ ( i ) - ( j ) + ( A -> s_mu ) ] )

struct _DlsMat
    type::Cint
    M::sunindextype
    N::sunindextype
    ldim::sunindextype
    mu::sunindextype
    ml::sunindextype
    s_mu::sunindextype
    data::Ptr{realtype}
    ldata::sunindextype
    cols::Ptr{Ptr{realtype}}
end

const DlsMat = Ptr{_DlsMat}
const FCMIX_CVODE = Cint(1)
const FCMIX_IDA = Cint(2)
const FCMIX_KINSOL = Cint(3)
const FCMIX_ARKODE = Cint(4)
const ATimesFn = Ptr{Cvoid}
const PSetupFn = Ptr{Cvoid}
const PSolveFn = Ptr{Cvoid}

# Skipping MacroDefinition: dcopy_f77 SUNDIALS_F77_FUNC ( dcopy , DCOPY )
# Skipping MacroDefinition: dscal_f77 SUNDIALS_F77_FUNC ( dscal , DSCAL )
# Skipping MacroDefinition: dgemv_f77 SUNDIALS_F77_FUNC ( dgemv , DGEMV )
# Skipping MacroDefinition: dtrsv_f77 SUNDIALS_F77_FUNC ( dtrsv , DTRSV )
# Skipping MacroDefinition: dsyrk_f77 SUNDIALS_F77_FUNC ( dsyrk , DSKYR )
# Skipping MacroDefinition: dgbtrf_f77 SUNDIALS_F77_FUNC ( dgbtrf , DGBTRF )
# Skipping MacroDefinition: dgbtrs_f77 SUNDIALS_F77_FUNC ( dgbtrs , DGBTRS )
# Skipping MacroDefinition: dgetrf_f77 SUNDIALS_F77_FUNC ( dgetrf , DGETRF )
# Skipping MacroDefinition: dgetrs_f77 SUNDIALS_F77_FUNC ( dgetrs , DGETRS )
# Skipping MacroDefinition: dgeqp3_f77 SUNDIALS_F77_FUNC ( dgeqp3 , DGEQP3 )
# Skipping MacroDefinition: dgeqrf_f77 SUNDIALS_F77_FUNC ( dgeqrf , DGEQRF )
# Skipping MacroDefinition: dormqr_f77 SUNDIALS_F77_FUNC ( dormqr , DORMQR )
# Skipping MacroDefinition: dpotrf_f77 SUNDIALS_F77_FUNC ( dpotrf , DPOTRF )
# Skipping MacroDefinition: dpotrs_f77 SUNDIALS_F77_FUNC ( dpotrs , DPOTRS )
# Skipping MacroDefinition: scopy_f77 SUNDIALS_F77_FUNC ( scopy , SCOPY )
# Skipping MacroDefinition: sscal_f77 SUNDIALS_F77_FUNC ( sscal , SSCAL )
# Skipping MacroDefinition: sgemv_f77 SUNDIALS_F77_FUNC ( sgemv , SGEMV )
# Skipping MacroDefinition: strsv_f77 SUNDIALS_F77_FUNC ( strsv , STRSV )
# Skipping MacroDefinition: ssyrk_f77 SUNDIALS_F77_FUNC ( ssyrk , SSKYR )
# Skipping MacroDefinition: sgbtrf_f77 SUNDIALS_F77_FUNC ( sgbtrf , SGBTRF )
# Skipping MacroDefinition: sgbtrs_f77 SUNDIALS_F77_FUNC ( sgbtrs , SGBTRS )
# Skipping MacroDefinition: sgetrf_f77 SUNDIALS_F77_FUNC ( sgetrf , SGETRF )
# Skipping MacroDefinition: sgetrs_f77 SUNDIALS_F77_FUNC ( sgetrs , SGETRS )
# Skipping MacroDefinition: sgeqp3_f77 SUNDIALS_F77_FUNC ( sgeqp3 , SGEQP3 )
# Skipping MacroDefinition: sgeqrf_f77 SUNDIALS_F77_FUNC ( sgeqrf , SGEQRF )
# Skipping MacroDefinition: sormqr_f77 SUNDIALS_F77_FUNC ( sormqr , SORMQR )
# Skipping MacroDefinition: spotrf_f77 SUNDIALS_F77_FUNC ( spotrf , SPOTRF )
# Skipping MacroDefinition: spotrs_f77 SUNDIALS_F77_FUNC ( spotrs , SPOTRS )

const SUNLS_SUCCESS = Cint(0)
const SUNLS_MEM_NULL = Cint(-801)
const SUNLS_ILL_INPUT = Cint(-802)
const SUNLS_MEM_FAIL = Cint(-803)
const SUNLS_ATIMES_FAIL_UNREC = Cint(-804)
const SUNLS_PSET_FAIL_UNREC = Cint(-805)
const SUNLS_PSOLVE_FAIL_UNREC = Cint(-806)
const SUNLS_PACKAGE_FAIL_UNREC = Cint(-807)
const SUNLS_GS_FAIL = Cint(-808)
const SUNLS_QRSOL_FAIL = Cint(-809)
const SUNLS_VECTOROP_ERR = Cint(-810)
const SUNLS_RES_REDUCED = Cint(801)
const SUNLS_CONV_FAIL = Cint(802)
const SUNLS_ATIMES_FAIL_REC = Cint(803)
const SUNLS_PSET_FAIL_REC = Cint(804)
const SUNLS_PSOLVE_FAIL_REC = Cint(805)
const SUNLS_PACKAGE_FAIL_REC = Cint(806)
const SUNLS_QRFACT_FAIL = Cint(807)
const SUNLS_LUFACT_FAIL = Cint(808)

CEnum.@cenum SUNLinearSolver_Type::UInt32 begin
    SUNLINEARSOLVER_DIRECT = 0
    SUNLINEARSOLVER_ITERATIVE = 1
    SUNLINEARSOLVER_MATRIX_ITERATIVE = 2
end

CEnum.@cenum SUNLinearSolver_ID::UInt32 begin
    SUNLINEARSOLVER_BAND = 0
    SUNLINEARSOLVER_DENSE = 1
    SUNLINEARSOLVER_KLU = 2
    SUNLINEARSOLVER_LAPACKBAND = 3
    SUNLINEARSOLVER_LAPACKDENSE = 4
    SUNLINEARSOLVER_PCG = 5
    SUNLINEARSOLVER_SPBCGS = 6
    SUNLINEARSOLVER_SPFGMR = 7
    SUNLINEARSOLVER_SPGMR = 8
    SUNLINEARSOLVER_SPTFQMR = 9
    SUNLINEARSOLVER_SUPERLUDIST = 10
    SUNLINEARSOLVER_SUPERLUMT = 11
    SUNLINEARSOLVER_CUSOLVERSP_BATCHQR = 12
    SUNLINEARSOLVER_CUSTOM = 13
end

struct _generic_SUNLinearSolver_Ops
    gettype::Ptr{Cvoid}
    getid::Ptr{Cvoid}
    setatimes::Ptr{Cvoid}
    setpreconditioner::Ptr{Cvoid}
    setscalingvectors::Ptr{Cvoid}
    initialize::Ptr{Cvoid}
    setup::Ptr{Cvoid}
    solve::Ptr{Cvoid}
    numiters::Ptr{Cvoid}
    resnorm::Ptr{Cvoid}
    lastflag::Ptr{Cvoid}
    space::Ptr{Cvoid}
    resid::Ptr{Cvoid}
    free::Ptr{Cvoid}
end

const SUNLinearSolver_Ops = Ptr{_generic_SUNLinearSolver_Ops}

struct _generic_SUNLinearSolver
    content::Ptr{Cvoid}
    ops::SUNLinearSolver_Ops
end

const SUNLinearSolver = Ptr{_generic_SUNLinearSolver}

# Skipping MacroDefinition: SUNMIN ( A , B ) ( ( A ) < ( B ) ? ( A ) : ( B ) )
# Skipping MacroDefinition: SUNMAX ( A , B ) ( ( A ) > ( B ) ? ( A ) : ( B ) )
# Skipping MacroDefinition: SUNSQR ( A ) ( ( A ) * ( A ) )
# Skipping MacroDefinition: SUNRsqrt ( x ) ( ( x ) <= RCONST ( 0.0 ) ? ( RCONST ( 0.0 ) ) : ( ( realtype ) sqrt ( ( double ) ( x ) ) ) )
# Skipping MacroDefinition: SUNRabs ( x ) ( ( realtype ) fabs ( ( double ) ( x ) ) )
# Skipping MacroDefinition: SUNRexp ( x ) ( ( realtype ) exp ( ( double ) ( x ) ) )
# Skipping MacroDefinition: SUNRceil ( x ) ( ( realtype ) ceil ( ( double ) ( x ) ) )

const SUNMAT_SUCCESS = Cint(0)
const SUNMAT_ILL_INPUT = Cint(-701)
const SUNMAT_MEM_FAIL = Cint(-702)
const SUNMAT_OPERATION_FAIL = Cint(-703)
const SUNMAT_MATVEC_SETUP_REQUIRED = Cint(-704)

CEnum.@cenum SUNMatrix_ID::UInt32 begin
    SUNMATRIX_DENSE = 0
    SUNMATRIX_BAND = 1
    SUNMATRIX_SPARSE = 2
    SUNMATRIX_SLUNRLOC = 3
    SUNMATRIX_CUSTOM = 4
end

struct _generic_SUNMatrix_Ops
    getid::Ptr{Cvoid}
    clone::Ptr{Cvoid}
    destroy::Ptr{Cvoid}
    zero::Ptr{Cvoid}
    copy::Ptr{Cvoid}
    scaleadd::Ptr{Cvoid}
    scaleaddi::Ptr{Cvoid}
    matvecsetup::Ptr{Cvoid}
    matvec::Ptr{Cvoid}
    space::Ptr{Cvoid}
end

const SUNMatrix_Ops = Ptr{_generic_SUNMatrix_Ops}

struct _generic_SUNMatrix
    content::Ptr{Cvoid}
    ops::SUNMatrix_Ops
end

const SUNMatrix = Ptr{_generic_SUNMatrix}
#const MPI_SUNREALTYPE = MPI_DOUBLE
#const MPI_SUNINDEXTYPE = MPI_INT64_T
#const PVEC_REAL_MPI_TYPE = MPI_SUNREALTYPE
#const PVEC_INTEGER_MPI_TYPE = MPI_SUNINDEXTYPE
const SUN_NLS_SUCCESS = Cint(0)
const SUN_NLS_CONTINUE = Cint(901)
const SUN_NLS_CONV_RECVR = Cint(902)
const SUN_NLS_MEM_NULL = Cint(-901)
const SUN_NLS_MEM_FAIL = Cint(-902)
const SUN_NLS_ILL_INPUT = Cint(-903)
const SUN_NLS_VECTOROP_ERR = Cint(-904)
const SUN_NLS_EXT_FAIL = Cint(-905)

struct _generic_SUNNonlinearSolver_Ops
    gettype::Ptr{Cvoid}
    initialize::Ptr{Cvoid}
    setup::Ptr{Cvoid}
    solve::Ptr{Cvoid}
    free::Ptr{Cvoid}
    setsysfn::Ptr{Cvoid}
    setlsetupfn::Ptr{Cvoid}
    setlsolvefn::Ptr{Cvoid}
    setctestfn::Ptr{Cvoid}
    setmaxiters::Ptr{Cvoid}
    getnumiters::Ptr{Cvoid}
    getcuriter::Ptr{Cvoid}
    getnumconvfails::Ptr{Cvoid}
end

const SUNNonlinearSolver_Ops = Ptr{_generic_SUNNonlinearSolver_Ops}

struct _generic_SUNNonlinearSolver
    content::Ptr{Cvoid}
    ops::SUNNonlinearSolver_Ops
end

const SUNNonlinearSolver = Ptr{_generic_SUNNonlinearSolver}
const SUNNonlinSolSysFn = Ptr{Cvoid}
const SUNNonlinSolLSetupFn = Ptr{Cvoid}
const SUNNonlinSolLSolveFn = Ptr{Cvoid}
const SUNNonlinSolConvTestFn = Ptr{Cvoid}

CEnum.@cenum SUNNonlinearSolver_Type::UInt32 begin
    SUNNONLINEARSOLVER_ROOTFIND = 0
    SUNNONLINEARSOLVER_FIXEDPOINT = 1
end

CEnum.@cenum N_Vector_ID::UInt32 begin
    SUNDIALS_NVEC_SERIAL = 0
    SUNDIALS_NVEC_PARALLEL = 1
    SUNDIALS_NVEC_OPENMP = 2
    SUNDIALS_NVEC_PTHREADS = 3
    SUNDIALS_NVEC_PARHYP = 4
    SUNDIALS_NVEC_PETSC = 5
    SUNDIALS_NVEC_CUDA = 6
    SUNDIALS_NVEC_RAJA = 7
    SUNDIALS_NVEC_OPENMPDEV = 8
    SUNDIALS_NVEC_TRILINOS = 9
    SUNDIALS_NVEC_MANYVECTOR = 10
    SUNDIALS_NVEC_MPIMANYVECTOR = 11
    SUNDIALS_NVEC_MPIPLUSX = 12
    SUNDIALS_NVEC_CUSTOM = 13
end

const N_Vector_S = Ptr{N_Vector}

# Skipping MacroDefinition: RCONST ( x ) x

const BIG_REAL = DBL_MAX
const SMALL_REAL = DBL_MIN
const UNIT_ROUNDOFF = DBL_EPSILON
const SUNFALSE = Cint(0)
const SUNTRUE = Cint(1)

struct _SUNLinearSolverContent_Band
    N::sunindextype
    pivots::Ptr{sunindextype}
    last_flag::sunindextype
end

const SUNLinearSolverContent_Band = Ptr{_SUNLinearSolverContent_Band}

struct _SUNLinearSolverContent_Dense
    N::sunindextype
    pivots::Ptr{sunindextype}
    last_flag::sunindextype
end

const SUNLinearSolverContent_Dense = Ptr{_SUNLinearSolverContent_Dense}
const SUNKLU_ORDERING_DEFAULT = Cint(1)
const SUNKLU_REINIT_FULL = Cint(1)
const SUNKLU_REINIT_PARTIAL = Cint(2)

struct klu_l_symbolic
    symmetry::Cdouble
    est_flops::Cdouble
    lnz::Cdouble
    unz::Cdouble
    Lnz::Ptr{Cdouble}
    n::Clong
    nz::Clong
    P::Ptr{Clong}
    Q::Ptr{Clong}
    R::Ptr{Clong}
    nzoff::Clong
    nblocks::Clong
    maxblock::Clong
    ordering::Clong
    do_btf::Clong
    structural_rank::Clong
end

const sun_klu_symbolic = klu_l_symbolic

struct klu_l_numeric
    n::Clong
    nblocks::Clong
    lnz::Clong
    unz::Clong
    max_lnz_block::Clong
    max_unz_block::Clong
    Pnum::Ptr{Clong}
    Pinv::Ptr{Clong}
    Lip::Ptr{Clong}
    Uip::Ptr{Clong}
    Llen::Ptr{Clong}
    Ulen::Ptr{Clong}
    LUbx::Ptr{Ptr{Cvoid}}
    LUsize::Ptr{Csize_t}
    Udiag::Ptr{Cvoid}
    Rs::Ptr{Cdouble}
    worksize::Csize_t
    Work::Ptr{Cvoid}
    Xwork::Ptr{Cvoid}
    Iwork::Ptr{Clong}
    Offp::Ptr{Clong}
    Offi::Ptr{Clong}
    Offx::Ptr{Cvoid}
    nzoff::Clong
end

const sun_klu_numeric = klu_l_numeric

struct klu_l_common
    tol::Cdouble
    memgrow::Cdouble
    initmem_amd::Cdouble
    initmem::Cdouble
    maxwork::Cdouble
    btf::Clong
    ordering::Clong
    scale::Clong
    user_order::Ptr{Cvoid}
    user_data::Ptr{Cvoid}
    halt_if_singular::Clong
    status::Clong
    nrealloc::Clong
    structural_rank::Clong
    numerical_rank::Clong
    singular_col::Clong
    noffdiag::Clong
    flops::Cdouble
    rcond::Cdouble
    condest::Cdouble
    rgrowth::Cdouble
    work::Cdouble
    memusage::Csize_t
    mempeak::Csize_t
end
const sun_klu_common = klu_l_common

# These are function names in klu.h

#const sun_klu_analyze = klu_l_analyze
#const sun_klu_factor = klu_l_factor
#const sun_klu_refactor = klu_l_refactor
#const sun_klu_rcond = klu_l_rcond
#const sun_klu_condest = klu_l_condest
#const sun_klu_defaults = klu_l_defaults
#const sun_klu_free_symbolic = klu_l_free_symbolic
#const sun_klu_free_numeric = klu_l_free_numeric

const KLUSolveFn = Ptr{Cvoid}

struct _SUNLinearSolverContent_KLU
    last_flag::Cint
    first_factorize::Cint
    symbolic::Ptr{klu_l_symbolic}
    numeric::Ptr{klu_l_numeric}
    common::klu_l_common
    klu_solver::KLUSolveFn
end

const SUNLinearSolverContent_KLU = Ptr{_SUNLinearSolverContent_KLU}

#const xgbtrf_f77 = dgbtrf_f77
#const xgbtrs_f77 = dgbtrs_f77

struct _SUNLinearSolverContent_LapackBand
    N::sunindextype
    pivots::Ptr{sunindextype}
    last_flag::sunindextype
end

const SUNLinearSolverContent_LapackBand = Ptr{_SUNLinearSolverContent_LapackBand}
#const xgetrf_f77 = dgetrf_f77
#const xgetrs_f77 = dgetrs_f77

struct _SUNLinearSolverContent_LapackDense
    N::sunindextype
    pivots::Ptr{sunindextype}
    last_flag::sunindextype
end

const SUNLinearSolverContent_LapackDense = Ptr{_SUNLinearSolverContent_LapackDense}
const SUNPCG_MAXL_DEFAULT = Cint(5)

struct _SUNLinearSolverContent_PCG
    maxl::Cint
    pretype::Cint
    numiters::Cint
    resnorm::realtype
    last_flag::Cint
    ATimes::ATimesFn
    ATData::Ptr{Cvoid}
    Psetup::PSetupFn
    Psolve::PSolveFn
    PData::Ptr{Cvoid}
    s::N_Vector
    r::N_Vector
    p::N_Vector
    z::N_Vector
    Ap::N_Vector
end

const SUNLinearSolverContent_PCG = Ptr{_SUNLinearSolverContent_PCG}
const SUNSPBCGS_MAXL_DEFAULT = Cint(5)

struct _SUNLinearSolverContent_SPBCGS
    maxl::Cint
    pretype::Cint
    numiters::Cint
    resnorm::realtype
    last_flag::Cint
    ATimes::ATimesFn
    ATData::Ptr{Cvoid}
    Psetup::PSetupFn
    Psolve::PSolveFn
    PData::Ptr{Cvoid}
    s1::N_Vector
    s2::N_Vector
    r::N_Vector
    r_star::N_Vector
    p::N_Vector
    q::N_Vector
    u::N_Vector
    Ap::N_Vector
    vtemp::N_Vector
end

const SUNLinearSolverContent_SPBCGS = Ptr{_SUNLinearSolverContent_SPBCGS}
const SUNSPFGMR_MAXL_DEFAULT = Cint(5)
const SUNSPFGMR_MAXRS_DEFAULT = Cint(0)
const SUNSPFGMR_GSTYPE_DEFAULT = MODIFIED_GS

struct _SUNLinearSolverContent_SPFGMR
    maxl::Cint
    pretype::Cint
    gstype::Cint
    max_restarts::Cint
    numiters::Cint
    resnorm::realtype
    last_flag::Cint
    ATimes::ATimesFn
    ATData::Ptr{Cvoid}
    Psetup::PSetupFn
    Psolve::PSolveFn
    PData::Ptr{Cvoid}
    s1::N_Vector
    s2::N_Vector
    V::Ptr{N_Vector}
    Z::Ptr{N_Vector}
    Hes::Ptr{Ptr{realtype}}
    givens::Ptr{realtype}
    xcor::N_Vector
    yg::Ptr{realtype}
    vtemp::N_Vector
    cv::Ptr{realtype}
    Xv::Ptr{N_Vector}
end

const SUNLinearSolverContent_SPFGMR = Ptr{_SUNLinearSolverContent_SPFGMR}
const SUNSPGMR_MAXL_DEFAULT = Cint(5)
const SUNSPGMR_MAXRS_DEFAULT = Cint(0)
const SUNSPGMR_GSTYPE_DEFAULT = MODIFIED_GS

struct _SUNLinearSolverContent_SPGMR
    maxl::Cint
    pretype::Cint
    gstype::Cint
    max_restarts::Cint
    numiters::Cint
    resnorm::realtype
    last_flag::Cint
    ATimes::ATimesFn
    ATData::Ptr{Cvoid}
    Psetup::PSetupFn
    Psolve::PSolveFn
    PData::Ptr{Cvoid}
    s1::N_Vector
    s2::N_Vector
    V::Ptr{N_Vector}
    Hes::Ptr{Ptr{realtype}}
    givens::Ptr{realtype}
    xcor::N_Vector
    yg::Ptr{realtype}
    vtemp::N_Vector
    cv::Ptr{realtype}
    Xv::Ptr{N_Vector}
end

const SUNLinearSolverContent_SPGMR = Ptr{_SUNLinearSolverContent_SPGMR}
const SUNSPTFQMR_MAXL_DEFAULT = Cint(5)

struct _SUNLinearSolverContent_SPTFQMR
    maxl::Cint
    pretype::Cint
    numiters::Cint
    resnorm::realtype
    last_flag::Cint
    ATimes::ATimesFn
    ATData::Ptr{Cvoid}
    Psetup::PSetupFn
    Psolve::PSolveFn
    PData::Ptr{Cvoid}
    s1::N_Vector
    s2::N_Vector
    r_star::N_Vector
    q::N_Vector
    d::N_Vector
    v::N_Vector
    p::N_Vector
    r::Ptr{N_Vector}
    u::N_Vector
    vtemp1::N_Vector
    vtemp2::N_Vector
    vtemp3::N_Vector
end

const SUNLinearSolverContent_SPTFQMR = Ptr{_SUNLinearSolverContent_SPTFQMR}

# Skipping MacroDefinition: SM_CONTENT_B ( A ) ( ( SUNMatrixContent_Band ) ( A -> content ) )
# Skipping MacroDefinition: SM_ROWS_B ( A ) ( SM_CONTENT_B ( A ) -> M )
# Skipping MacroDefinition: SM_COLUMNS_B ( A ) ( SM_CONTENT_B ( A ) -> N )
# Skipping MacroDefinition: SM_LDATA_B ( A ) ( SM_CONTENT_B ( A ) -> ldata )
# Skipping MacroDefinition: SM_UBAND_B ( A ) ( SM_CONTENT_B ( A ) -> mu )
# Skipping MacroDefinition: SM_LBAND_B ( A ) ( SM_CONTENT_B ( A ) -> ml )
# Skipping MacroDefinition: SM_SUBAND_B ( A ) ( SM_CONTENT_B ( A ) -> s_mu )
# Skipping MacroDefinition: SM_LDIM_B ( A ) ( SM_CONTENT_B ( A ) -> ldim )
# Skipping MacroDefinition: SM_DATA_B ( A ) ( SM_CONTENT_B ( A ) -> data )
# Skipping MacroDefinition: SM_COLS_B ( A ) ( SM_CONTENT_B ( A ) -> cols )
# Skipping MacroDefinition: SM_COLUMN_B ( A , j ) ( ( ( SM_CONTENT_B ( A ) -> cols ) [ j ] ) + SM_SUBAND_B ( A ) )
# Skipping MacroDefinition: SM_COLUMN_ELEMENT_B ( col_j , i , j ) ( col_j [ ( i ) - ( j ) ] )
# Skipping MacroDefinition: SM_ELEMENT_B ( A , i , j ) ( ( SM_CONTENT_B ( A ) -> cols ) [ j ] [ ( i ) - ( j ) + SM_SUBAND_B ( A ) ] )

struct _SUNMatrixContent_Band
    M::sunindextype
    N::sunindextype
    ldim::sunindextype
    mu::sunindextype
    ml::sunindextype
    s_mu::sunindextype
    data::Ptr{realtype}
    ldata::sunindextype
    cols::Ptr{Ptr{realtype}}
end

const SUNMatrixContent_Band = Ptr{_SUNMatrixContent_Band}

# Skipping MacroDefinition: SM_CONTENT_D ( A ) ( ( SUNMatrixContent_Dense ) ( A -> content ) )
# Skipping MacroDefinition: SM_ROWS_D ( A ) ( SM_CONTENT_D ( A ) -> M )
# Skipping MacroDefinition: SM_COLUMNS_D ( A ) ( SM_CONTENT_D ( A ) -> N )
# Skipping MacroDefinition: SM_LDATA_D ( A ) ( SM_CONTENT_D ( A ) -> ldata )
# Skipping MacroDefinition: SM_DATA_D ( A ) ( SM_CONTENT_D ( A ) -> data )
# Skipping MacroDefinition: SM_COLS_D ( A ) ( SM_CONTENT_D ( A ) -> cols )
# Skipping MacroDefinition: SM_COLUMN_D ( A , j ) ( ( SM_CONTENT_D ( A ) -> cols ) [ j ] )
# Skipping MacroDefinition: SM_ELEMENT_D ( A , i , j ) ( ( SM_CONTENT_D ( A ) -> cols ) [ j ] [ i ] )

struct _SUNMatrixContent_Dense
    M::sunindextype
    N::sunindextype
    data::Ptr{realtype}
    ldata::sunindextype
    cols::Ptr{Ptr{realtype}}
end

const SUNMatrixContent_Dense = Ptr{_SUNMatrixContent_Dense}
const CSC_MAT = Cint(0)
const CSR_MAT = Cint(1)

# Skipping MacroDefinition: SM_CONTENT_S ( A ) ( ( SUNMatrixContent_Sparse ) ( A -> content ) )
# Skipping MacroDefinition: SM_ROWS_S ( A ) ( SM_CONTENT_S ( A ) -> M )
# Skipping MacroDefinition: SM_COLUMNS_S ( A ) ( SM_CONTENT_S ( A ) -> N )
# Skipping MacroDefinition: SM_NNZ_S ( A ) ( SM_CONTENT_S ( A ) -> NNZ )
# Skipping MacroDefinition: SM_NP_S ( A ) ( SM_CONTENT_S ( A ) -> NP )
# Skipping MacroDefinition: SM_SPARSETYPE_S ( A ) ( SM_CONTENT_S ( A ) -> sparsetype )
# Skipping MacroDefinition: SM_DATA_S ( A ) ( SM_CONTENT_S ( A ) -> data )
# Skipping MacroDefinition: SM_INDEXVALS_S ( A ) ( SM_CONTENT_S ( A ) -> indexvals )
# Skipping MacroDefinition: SM_INDEXPTRS_S ( A ) ( SM_CONTENT_S ( A ) -> indexptrs )

struct _SUNMatrixContent_Sparse
    M::sunindextype
    N::sunindextype
    NNZ::sunindextype
    NP::sunindextype
    data::Ptr{realtype}
    sparsetype::Cint
    indexvals::Ptr{sunindextype}
    indexptrs::Ptr{sunindextype}
    rowvals::Ptr{Ptr{sunindextype}}
    colptrs::Ptr{Ptr{sunindextype}}
    colvals::Ptr{Ptr{sunindextype}}
    rowptrs::Ptr{Ptr{sunindextype}}
end

const SUNMatrixContent_Sparse = Ptr{_SUNMatrixContent_Sparse}

struct _SUNNonlinearSolverContent_FixedPoint
    Sys::SUNNonlinSolSysFn
    CTest::SUNNonlinSolConvTestFn
    m::Cint
    imap::Ptr{Cint}
    damping::Cint
    beta::realtype
    R::Ptr{realtype}
    gamma::Ptr{realtype}
    cvals::Ptr{realtype}
    df::Ptr{N_Vector}
    dg::Ptr{N_Vector}
    q::Ptr{N_Vector}
    Xvecs::Ptr{N_Vector}
    yprev::N_Vector
    gy::N_Vector
    fold::N_Vector
    gold::N_Vector
    delta::N_Vector
    curiter::Cint
    maxiters::Cint
    niters::Clong
    nconvfails::Clong
    ctest_data::Ptr{Cvoid}
end

const SUNNonlinearSolverContent_FixedPoint = Ptr{_SUNNonlinearSolverContent_FixedPoint}

struct _SUNNonlinearSolverContent_Newton
    Sys::SUNNonlinSolSysFn
    LSetup::SUNNonlinSolLSetupFn
    LSolve::SUNNonlinSolLSolveFn
    CTest::SUNNonlinSolConvTestFn
    delta::N_Vector
    jcur::Cint
    curiter::Cint
    maxiters::Cint
    niters::Clong
    nconvfails::Clong
    ctest_data::Ptr{Cvoid}
end

const SUNNonlinearSolverContent_Newton = Ptr{_SUNNonlinearSolverContent_Newton}


text:
# This file was generated, do not modify it. # hide
X = select(data, Not(:State))
X = coerce(X, :UrbanPop=>Continuous, :Assault=>Continuous);

ext: jl


text:
file = joinpath(Pkg.dir("Gtk"), "src", "selectors.jl")
open(file, "r") do o
    map(_ -> readline(o), 1:81)
    l = readline(o)
    r"yield"(l) || run(`sed -i '82i yield()' $file`)
end


text:
nums = (x -> parse(Int, x)).(readlines())
solve(dist) = sum(a < b for (a, b) in zip(nums, nums[dist:end]))
println(solve(2))
println(solve(4))

max_stars_repo_name: LiquidFun/adventofcode

max_issues_repo_name: LiquidFun/adventofcode

max_forks_repo_name: LiquidFun/adventofcode


text:
using FastTransforms, Compat
using Compat.Test

import FastTransforms: normalizecolumns!, maxcolnorm

@testset "Slow plan" begin
    N = round.([Int],10 .^ range(1,stop=2.5,length=10))

    t = zeros(length(N))
    err = zeros(length(N))

    Nr = 2

    j = 1
    for n in N
        nrms = zeros(Nr)
        for kk = 1:Nr
            A = sphrandn(Float64, n+1, n+1)
            normalizecolumns!(A)
            Ac = copy(A)
            B = zero(A)
            SP = SlowSphericalHarmonicPlan(A)
            mul!(B, SP, A)
            fill!(A, 0.0)
            t[j] += @elapsed At_mul_B!(A, SP, B)
            nrms[kk] = maxcolnorm(A - Ac)
        end
        t[j] /= Nr
        err[j] = Statistics.mean(nrms)
        println("At a bandlimit of ",n,", the maximum 2-norm in the columns over ",Nr," trials is: ",err[j])
        @test err[j] < 10eps()*sqrt(n)
        j+=1
    end
end


text:
using WordCloud
#md# Sometimes you want a high-density output, and you may do it like this:
#md# ```julia
#md# wc = wordcloud(
#md#     processtext(open(pkgdir(WordCloud)*"/res/alice.txt"), stopwords=WordCloud.stopwords_en ∪ ["said"]),
#md#     mask = shape(box, 400, 300, cornerradius=10),
#md#     colors = :Dark2_3,
#md#     angles = (0, 90),
#md#     density = 0.7) |> generate!
#md# paint(wc, "highdensity.png")
#md# ```
#md# But you may find that doesn't work. That is because there should be at least 1 pixel gap between two words, which is controlled by the `spacing` parameter (default 1) in `wordcloud`. While, when the picture is small, 1 pixel is expensive. So, that can be done as follows:
wc = wordcloud(
    processtext(open(pkgdir(WordCloud) * "/res/alice.txt"), stopwords=WordCloud.stopwords_en ∪ ["said"]),
    mask=shape(box, 400 * 2, 300 * 2, cornerradius=10 * 2),
    colors=:Dark2_3,
    angles=(0, 90),
    density=0.7) |> generate!
paint(wc, "highdensity.png", ratio=0.5)
#md#
println("results are saved to highdensity.png")
wc
#eval# runexample(:highdensity)
#md# ![highdensity](highdensity.png)


text:
export @synchronize

"""
    @synchronize ex

Run expression `ex` and synchronize the VE afterwards.

See also: [`synchronize`](@ref).
"""
macro synchronize(ex)
    quote
        local ret = $(esc(ex))
        VectorEngine.synchronize()
        ret
    end
end


text:
###############
# Downloaders
#

export get_file, get_stream, get_jld

"""Download from swift, writing the result to the file given by `fname`.
	`container` is just the container object_name, pseudofolder should be part of object object_name
"""
function get_file(serv::PyObject, container::AbstractString, object_name::String, fname::String; verbose::Bool=false)
	if '/' in container || '\\' in container
		error("No slashes allowed in container object_name (got $container). Pseudodir should be part of the object object_name.")
	end

    async_get = serv[:download](container, [object_name], Dict("out_file" => fname))
    responses=collect(async_get)
    if verbose
        show_responses(responses)
    end
    ret = responses[end]
    ret["success"] || error(ret["error"])
    ret
end

"""Download a file from Swift, apply `func` to it, returning the result.
`func` should be a function that takes a filename as an input.
"""
function get_file(func::Function, serv::PyObject, container::AbstractString, object_name::String; verbose::Bool=false)
	fname = splitdir(object_name)[end]
	mktempdir() do tdir
	    fpathname = joinpath(tdir, fname)
        get_file(serv::PyObject, container, object_name, fpathname; verbose=verbose)
        func(fpathname)
    end
end

"""Read IO stream, from Swift, and call func, on it, returning the result """
function get_stream(func::Function, serv::PyObject, container::AbstractString, object_name::String; verbose::Bool=false)
    get_file(serv::PyObject, container, object_name; verbose=verbose) do fname
		open(func, fname, "r")
    end
end

"""Download a JLD file from Swift. `dataname` is a list of fieldnames to read."""
function get_jld(serv::PyObject, container::AbstractString, object_name::String, datanames...; verbose::Bool=false)
    get_file(serv::PyObject, container, object_name; verbose=verbose) do fname
		JLD.load(File(format"JLD", fname), datanames...)
    end
end


text:
using Rubin
using Tests
using Elliptic
using HypergeometricFunctions
using Polylogarithms
using SpecialFunctions

@test integrate(x^5*(a+b*csc(c+d*x^2)), x) == :(1//6*a*x^6+b*d^-3*Polylogarithms.polylog(3,exp(im*(c+d*x^2)))+-1*b*d^-3*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^2)))+-1*b*d^-1*x^4*arctanh(exp(im*(c+d*x^2)))+im*b*d^-2*x^2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^2)))+-1*im*b*d^-2*x^2*Polylogarithms.polylog(2,exp(im*(c+d*x^2))))
@test integrate(x^3*(a+b*csc(c+d*x^2)), x) == :(1//4*a*x^4+(1/2)*im*b*d^-2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^2)))+-1*b*d^-1*x^2*arctanh(exp(im*(c+d*x^2)))+-1//2*im*b*d^-2*Polylogarithms.polylog(2,exp(im*(c+d*x^2))))
@test integrate(x*(a+b*csc(c+d*x^2)), x) == :((1/2)*a*x^2+-1//2*b*d^-1*arctanh(cos(c+d*x^2)))
@test integrate(x^5*(a+b*csc(c+d*x^2))^2, x) == :(1//6*a^2*x^6+b^2*d^-2*x^2*log(1+-1*exp(2*im*(c+d*x^2)))+-2*a*b*d^-3*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^2)))+2*a*b*d^-3*Polylogarithms.polylog(3,exp(im*(c+d*x^2)))+-1//2*im*b^2*d^-1*x^4+-1//2*im*b^2*d^-3*Polylogarithms.polylog(2,exp(2*im*(c+d*x^2)))+-1//2*b^2*d^-1*x^4*cot(c+d*x^2)+-2*a*b*d^-1*x^4*arctanh(exp(im*(c+d*x^2)))+-2*im*a*b*d^-2*x^2*Polylogarithms.polylog(2,exp(im*(c+d*x^2)))+2*im*a*b*d^-2*x^2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^2))))
@test integrate(x^3*(a+b*csc(c+d*x^2))^2, x) == :(1//4*a^2*x^4+(1/2)*b^2*d^-2*log(sin(c+d*x^2))+-1//2*b^2*d^-1*x^2*cot(c+d*x^2)+im*a*b*d^-2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^2)))+-1*im*a*b*d^-2*Polylogarithms.polylog(2,exp(im*(c+d*x^2)))+-2*a*b*d^-1*x^2*arctanh(exp(im*(c+d*x^2))))
@test integrate(x*(a+b*csc(c+d*x^2))^2, x) == :((1/2)*a^2*x^2+-1//2*b^2*d^-1*cot(c+d*x^2)+-1*a*b*d^-1*arctanh(cos(c+d*x^2)))
@test integrate(x*csc(a+b*x^2)^7, x) == :(-5//32*b^-1*arctanh(cos(a+b*x^2))+-5//32*b^-1*cot(a+b*x^2)*csc(a+b*x^2)+-5//48*b^-1*csc(a+b*x^2)^3*cot(a+b*x^2)+-1//12*b^-1*csc(a+b*x^2)^5*cot(a+b*x^2))
@test integrate(x^5*(a+b*csc(c+d*x^2))^-1, x) == :(1//6*a^-1*x^6+im*b*a^-1*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+b*a^-1*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1*im*b*a^-1*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1*b*a^-1*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+(1/2)*im*b*a^-1*d^-1*x^4*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*im*b*a^-1*d^-1*x^4*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2))))
@test integrate(x^3*(a+b*csc(c+d*x^2))^-1, x) == :(1//4*a^-1*x^4+(1/2)*b*a^-1*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*b*a^-1*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+(1/2)*im*b*a^-1*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*im*b*a^-1*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2))))
@test integrate(x*(a+b*csc(c+d*x^2))^-1, x) == :((1/2)*a^-1*x^2+b*a^-1*d^-1*(a^2+-1*b^2)^-1//2*arctanh((a^2+-1*b^2)^-1//2*(a+b*tan((1/2)*c+(1/2)*d*x^2))))
@test integrate(x^5*(a+b*csc(c+d*x^2))^-2, x) == :(1//6*a^-2*x^6+im*a^-2*b^3*d^-3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+a^-2*b^2*d^-2*x^2*(a^2+-1*b^2)^-1*log(1+a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^2)))+a^-2*b^2*d^-2*x^2*(a^2+-1*b^2)^-1*log(1+a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^2)))+a^-2*b^3*d^-2*x^2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1*im*a^-2*b^2*d^-3*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^2)))+-1*im*a^-2*b^2*d^-3*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^2)))+-1*im*a^-2*b^3*d^-3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1*a^-2*b^3*d^-2*x^2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-2*im*b*a^-2*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-2*b*a^-2*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+2*im*b*a^-2*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+2*b*a^-2*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*im*a^-2*b^2*d^-1*x^4*(a^2+-1*b^2)^-1+im*b*a^-2*d^-1*x^4*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+(1/2)*im*a^-2*b^3*d^-1*x^4*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1*im*b*a^-2*d^-1*x^4*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*im*a^-2*b^3*d^-1*x^4*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*a^-1*b^2*d^-1*x^4*(b+a*sin(c+d*x^2))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^2))
@test integrate(x^3*(a+b*csc(c+d*x^2))^-2, x) == :(1//4*a^-2*x^4+b*a^-2*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+(1/2)*a^-2*b^2*d^-2*(a^2+-1*b^2)^-1*log(b+a*sin(c+d*x^2))+(1/2)*a^-2*b^3*d^-2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1*b*a^-2*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*a^-2*b^3*d^-2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+im*b*a^-2*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+(1/2)*im*a^-2*b^3*d^-1*x^2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1*im*b*a^-2*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*im*a^-2*b^3*d^-1*x^2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^2)))+-1//2*a^-1*b^2*d^-1*x^2*(b+a*sin(c+d*x^2))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^2))
@test integrate(x*(a+b*csc(c+d*x^2))^-2, x) == :((1/2)*a^-2*x^2+b*a^-2*d^-1*(a^2+-1*b^2)^-3//2*(-1*b^2+2*a^2)*arctanh((a^2+-1*b^2)^-1//2*(a+b*tan((1/2)*c+(1/2)*d*x^2)))+-1//2*a^-1*b^2*d^-1*(a+b*csc(c+d*x^2))^-1*(a^2+-1*b^2)^-1*cot(c+d*x^2))
@test integrate(x^3*(a+b*csc(c+d*x^(1/2))), x) == :(1//4*a*x^4+-10080*im*b*d^-8*Polylogarithms.polylog(8,-1*exp(im*(c+d*x^(1/2))))+-10080*b*d^-7*x^(1/2)*Polylogarithms.polylog(7,-1*exp(im*(c+d*x^(1/2))))+-1680*b*d^-5*x^3//2*Polylogarithms.polylog(5,exp(im*(c+d*x^(1/2))))+-84*b*d^-3*x^5//2*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-4*b*d^-1*x^7//2*arctanh(exp(im*(c+d*x^(1/2))))+84*b*d^-3*x^5//2*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+1680*b*d^-5*x^3//2*Polylogarithms.polylog(5,-1*exp(im*(c+d*x^(1/2))))+10080*im*b*d^-8*Polylogarithms.polylog(8,exp(im*(c+d*x^(1/2))))+10080*b*d^-7*x^(1/2)*Polylogarithms.polylog(7,exp(im*(c+d*x^(1/2))))+-5040*im*b*x*d^-6*Polylogarithms.polylog(6,exp(im*(c+d*x^(1/2))))+-420*im*b*d^-4*x^2*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-14*im*b*d^-2*x^3*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+14*im*b*d^-2*x^3*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2))))+420*im*b*d^-4*x^2*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2))))+5040*im*b*x*d^-6*Polylogarithms.polylog(6,-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^2*(a+b*csc(c+d*x^(1/2))), x) == :(1//3*a*x^3+-240*im*b*d^-6*Polylogarithms.polylog(6,exp(im*(c+d*x^(1/2))))+-240*b*d^-5*x^(1/2)*Polylogarithms.polylog(5,exp(im*(c+d*x^(1/2))))+-40*b*d^-3*x^3//2*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-4*b*d^-1*x^5//2*arctanh(exp(im*(c+d*x^(1/2))))+40*b*d^-3*x^3//2*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+240*im*b*d^-6*Polylogarithms.polylog(6,-1*exp(im*(c+d*x^(1/2))))+240*b*d^-5*x^(1/2)*Polylogarithms.polylog(5,-1*exp(im*(c+d*x^(1/2))))+-120*im*b*x*d^-4*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-10*im*b*d^-2*x^2*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+10*im*b*d^-2*x^2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2))))+120*im*b*x*d^-4*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2)))))
@test integrate(x*(a+b*csc(c+d*x^(1/2))), x) == :((1/2)*a*x^2+-12*im*b*d^-4*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-12*b*d^-3*x^(1/2)*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-4*b*d^-1*x^3//2*arctanh(exp(im*(c+d*x^(1/2))))+12*im*b*d^-4*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2))))+12*b*d^-3*x^(1/2)*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+-6*im*b*x*d^-2*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+6*im*b*x*d^-2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^3*(a+b*csc(c+d*x^(1/2)))^2, x) == :(1//4*a^2*x^4+315//2*b^2*d^-8*Polylogarithms.polylog(7,exp(2*im*(c+d*x^(1/2))))+-315*x*b^2*d^-6*Polylogarithms.polylog(5,exp(2*im*(c+d*x^(1/2))))+-2*im*b^2*d^-1*x^7//2+-2*b^2*d^-1*x^7//2*cot(c+d*x^(1/2))+14*b^2*d^-2*x^3*log(1+-1*exp(2*im*(c+d*x^(1/2))))+105*b^2*d^-4*x^2*Polylogarithms.polylog(3,exp(2*im*(c+d*x^(1/2))))+-20160*im*a*b*d^-8*Polylogarithms.polylog(8,-1*exp(im*(c+d*x^(1/2))))+-20160*a*b*d^-7*x^(1/2)*Polylogarithms.polylog(7,-1*exp(im*(c+d*x^(1/2))))+-3360*a*b*d^-5*x^3//2*Polylogarithms.polylog(5,exp(im*(c+d*x^(1/2))))+-315*im*b^2*d^-7*x^(1/2)*Polylogarithms.polylog(6,exp(2*im*(c+d*x^(1/2))))+-168*a*b*d^-3*x^5//2*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-42*im*b^2*d^-3*x^5//2*Polylogarithms.polylog(2,exp(2*im*(c+d*x^(1/2))))+-8*a*b*d^-1*x^7//2*arctanh(exp(im*(c+d*x^(1/2))))+168*a*b*d^-3*x^5//2*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+210*im*b^2*d^-5*x^3//2*Polylogarithms.polylog(4,exp(2*im*(c+d*x^(1/2))))+3360*a*b*d^-5*x^3//2*Polylogarithms.polylog(5,-1*exp(im*(c+d*x^(1/2))))+20160*im*a*b*d^-8*Polylogarithms.polylog(8,exp(im*(c+d*x^(1/2))))+20160*a*b*d^-7*x^(1/2)*Polylogarithms.polylog(7,exp(im*(c+d*x^(1/2))))+-10080*im*a*b*x*d^-6*Polylogarithms.polylog(6,exp(im*(c+d*x^(1/2))))+-840*im*a*b*d^-4*x^2*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-28*im*a*b*d^-2*x^3*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+28*im*a*b*d^-2*x^3*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2))))+840*im*a*b*d^-4*x^2*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2))))+10080*im*a*b*x*d^-6*Polylogarithms.polylog(6,-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^2*(a+b*csc(c+d*x^(1/2)))^2, x) == :(1//3*a^2*x^3+-15*b^2*d^-6*Polylogarithms.polylog(5,exp(2*im*(c+d*x^(1/2))))+-2*im*b^2*d^-1*x^5//2+-2*b^2*d^-1*x^5//2*cot(c+d*x^(1/2))+10*b^2*d^-2*x^2*log(1+-1*exp(2*im*(c+d*x^(1/2))))+30*x*b^2*d^-4*Polylogarithms.polylog(3,exp(2*im*(c+d*x^(1/2))))+-480*im*a*b*d^-6*Polylogarithms.polylog(6,exp(im*(c+d*x^(1/2))))+-480*a*b*d^-5*x^(1/2)*Polylogarithms.polylog(5,exp(im*(c+d*x^(1/2))))+-80*a*b*d^-3*x^3//2*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-20*im*b^2*d^-3*x^3//2*Polylogarithms.polylog(2,exp(2*im*(c+d*x^(1/2))))+-8*a*b*d^-1*x^5//2*arctanh(exp(im*(c+d*x^(1/2))))+30*im*b^2*d^-5*x^(1/2)*Polylogarithms.polylog(4,exp(2*im*(c+d*x^(1/2))))+80*a*b*d^-3*x^3//2*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+480*im*a*b*d^-6*Polylogarithms.polylog(6,-1*exp(im*(c+d*x^(1/2))))+480*a*b*d^-5*x^(1/2)*Polylogarithms.polylog(5,-1*exp(im*(c+d*x^(1/2))))+-240*im*a*b*x*d^-4*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-20*im*a*b*d^-2*x^2*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+20*im*a*b*d^-2*x^2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2))))+240*im*a*b*x*d^-4*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2)))))
@test integrate(x*(a+b*csc(c+d*x^(1/2)))^2, x) == :((1/2)*a^2*x^2+3*b^2*d^-4*Polylogarithms.polylog(3,exp(2*im*(c+d*x^(1/2))))+-2*im*b^2*d^-1*x^3//2+-2*b^2*d^-1*x^3//2*cot(c+d*x^(1/2))+6*x*b^2*d^-2*log(1+-1*exp(2*im*(c+d*x^(1/2))))+-24*im*a*b*d^-4*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-24*a*b*d^-3*x^(1/2)*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-8*a*b*d^-1*x^3//2*arctanh(exp(im*(c+d*x^(1/2))))+-6*im*b^2*d^-3*x^(1/2)*Polylogarithms.polylog(2,exp(2*im*(c+d*x^(1/2))))+24*im*a*b*d^-4*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2))))+24*a*b*d^-3*x^(1/2)*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+-12*im*a*b*x*d^-2*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+12*im*a*b*x*d^-2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^3*(a+b*csc(c+d*x^(1/2)))^-1, x) == :(1//4*a^-1*x^4+-10080*b*a^-1*d^-8*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(8,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+10080*b*a^-1*d^-8*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(8,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-5040*b*x*a^-1*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-420*b*a^-1*d^-4*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-14*b*a^-1*d^-2*x^3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+14*b*a^-1*d^-2*x^3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+420*b*a^-1*d^-4*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+5040*b*x*a^-1*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-10080*im*b*a^-1*d^-7*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(7,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-1680*im*b*a^-1*d^-5*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-84*im*b*a^-1*d^-3*x^5//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*b*a^-1*d^-1*x^7//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+2*im*b*a^-1*d^-1*x^7//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+84*im*b*a^-1*d^-3*x^5//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+1680*im*b*a^-1*d^-5*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+10080*im*b*a^-1*d^-7*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(7,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^2*(a+b*csc(c+d*x^(1/2)))^-1, x) == :(1//3*a^-1*x^3+-240*b*a^-1*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+240*b*a^-1*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-120*b*x*a^-1*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-10*b*a^-1*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+10*b*a^-1*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+120*b*x*a^-1*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-240*im*b*a^-1*d^-5*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-40*im*b*a^-1*d^-3*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*b*a^-1*d^-1*x^5//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+2*im*b*a^-1*d^-1*x^5//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+40*im*b*a^-1*d^-3*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+240*im*b*a^-1*d^-5*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x*(a+b*csc(c+d*x^(1/2)))^-1, x) == :((1/2)*a^-1*x^2+-12*b*a^-1*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+12*b*a^-1*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-6*b*x*a^-1*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+6*b*x*a^-1*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-12*im*b*a^-1*d^-3*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*b*a^-1*d^-1*x^3//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+2*im*b*a^-1*d^-1*x^3//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+12*im*b*a^-1*d^-3*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^3*(a+b*csc(c+d*x^(1/2)))^-2, x) == :(1//4*a^-2*x^4+-20160*b*a^-2*d^-8*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(8,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-10080*a^-2*b^3*d^-8*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(8,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+10080*a^-2*b^2*d^-8*(a^2+-1*b^2)^-1*Polylogarithms.polylog(7,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+10080*a^-2*b^2*d^-8*(a^2+-1*b^2)^-1*Polylogarithms.polylog(7,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+10080*a^-2*b^3*d^-8*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(8,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+20160*b*a^-2*d^-8*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(8,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-10080*b*x*a^-2*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-5040*x*a^-2*b^2*d^-6*(a^2+-1*b^2)^-1*Polylogarithms.polylog(5,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-5040*x*a^-2*b^2*d^-6*(a^2+-1*b^2)^-1*Polylogarithms.polylog(5,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-5040*x*a^-2*b^3*d^-6*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(6,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-840*b*a^-2*d^-4*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-420*a^-2*b^3*d^-4*x^2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-28*b*a^-2*d^-2*x^3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-14*a^-2*b^3*d^-2*x^3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^2*d^-1*x^7//2*(a^2+-1*b^2)^-1+14*a^-2*b^2*d^-2*x^3*(a^2+-1*b^2)^-1*log(1+a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+14*a^-2*b^2*d^-2*x^3*(a^2+-1*b^2)^-1*log(1+a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+14*a^-2*b^3*d^-2*x^3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+28*b*a^-2*d^-2*x^3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+420*a^-2*b^2*d^-4*x^2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+420*a^-2*b^2*d^-4*x^2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+420*a^-2*b^3*d^-4*x^2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+840*b*a^-2*d^-4*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+5040*x*a^-2*b^3*d^-6*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(6,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+10080*b*x*a^-2*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-20160*im*b*a^-2*d^-7*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(7,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-10080*im*a^-2*b^2*d^-7*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(6,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-10080*im*a^-2*b^2*d^-7*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(6,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-10080*im*a^-2*b^3*d^-7*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(7,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-3360*im*b*a^-2*d^-5*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-1680*im*a^-2*b^3*d^-5*x^3//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-168*im*b*a^-2*d^-3*x^5//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-84*im*a^-2*b^2*d^-3*x^5//2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-84*im*a^-2*b^2*d^-3*x^5//2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-84*im*a^-2*b^3*d^-3*x^5//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*im*b*a^-2*d^-1*x^7//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^3*d^-1*x^7//2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*a^-1*b^2*d^-1*x^7//2*(b+a*sin(c+d*x^(1/2)))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^(1/2))+2*im*a^-2*b^3*d^-1*x^7//2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*im*b*a^-2*d^-1*x^7//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+84*im*a^-2*b^3*d^-3*x^5//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+168*im*b*a^-2*d^-3*x^5//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+1680*im*a^-2*b^2*d^-5*x^3//2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(4,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+1680*im*a^-2*b^2*d^-5*x^3//2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(4,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+1680*im*a^-2*b^3*d^-5*x^3//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+3360*im*b*a^-2*d^-5*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+10080*im*a^-2*b^3*d^-7*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(7,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+20160*im*b*a^-2*d^-7*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(7,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^2*(a+b*csc(c+d*x^(1/2)))^-2, x) == :(1//3*a^-2*x^3+-480*b*a^-2*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-240*a^-2*b^2*d^-6*(a^2+-1*b^2)^-1*Polylogarithms.polylog(5,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-240*a^-2*b^2*d^-6*(a^2+-1*b^2)^-1*Polylogarithms.polylog(5,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-240*a^-2*b^3*d^-6*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(6,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+240*a^-2*b^3*d^-6*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(6,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+480*b*a^-2*d^-6*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(6,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-240*b*x*a^-2*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-120*x*a^-2*b^3*d^-4*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-20*b*a^-2*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-10*a^-2*b^3*d^-2*x^2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^2*d^-1*x^5//2*(a^2+-1*b^2)^-1+10*a^-2*b^2*d^-2*x^2*(a^2+-1*b^2)^-1*log(1+a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+10*a^-2*b^2*d^-2*x^2*(a^2+-1*b^2)^-1*log(1+a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+10*a^-2*b^3*d^-2*x^2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+20*b*a^-2*d^-2*x^2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+120*x*a^-2*b^2*d^-4*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+120*x*a^-2*b^2*d^-4*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+120*x*a^-2*b^3*d^-4*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+240*b*x*a^-2*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-480*im*b*a^-2*d^-5*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-240*im*a^-2*b^3*d^-5*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-80*im*b*a^-2*d^-3*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-40*im*a^-2*b^2*d^-3*x^3//2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-40*im*a^-2*b^2*d^-3*x^3//2*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-40*im*a^-2*b^3*d^-3*x^3//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*im*b*a^-2*d^-1*x^5//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^3*d^-1*x^5//2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*a^-1*b^2*d^-1*x^5//2*(b+a*sin(c+d*x^(1/2)))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^(1/2))+2*im*a^-2*b^3*d^-1*x^5//2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*im*b*a^-2*d^-1*x^5//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+40*im*a^-2*b^3*d^-3*x^3//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+80*im*b*a^-2*d^-3*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+240*im*a^-2*b^2*d^-5*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(4,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+240*im*a^-2*b^2*d^-5*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(4,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+240*im*a^-2*b^3*d^-5*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+480*im*b*a^-2*d^-5*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x*(a+b*csc(c+d*x^(1/2)))^-2, x) == :((1/2)*a^-2*x^2+-24*b*a^-2*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-12*a^-2*b^3*d^-4*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+12*a^-2*b^2*d^-4*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+12*a^-2*b^2*d^-4*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+12*a^-2*b^3*d^-4*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+24*b*a^-2*d^-4*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-12*b*x*a^-2*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-6*x*a^-2*b^3*d^-2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^2*d^-1*x^3//2*(a^2+-1*b^2)^-1+6*x*a^-2*b^2*d^-2*(a^2+-1*b^2)^-1*log(1+a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+6*x*a^-2*b^2*d^-2*(a^2+-1*b^2)^-1*log(1+a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+6*x*a^-2*b^3*d^-2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+12*b*x*a^-2*d^-2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-24*im*b*a^-2*d^-3*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-12*im*a^-2*b^2*d^-3*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-12*im*a^-2*b^2*d^-3*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-12*im*a^-2*b^3*d^-3*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*im*b*a^-2*d^-1*x^3//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^3*d^-1*x^3//2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*a^-1*b^2*d^-1*x^3//2*(b+a*sin(c+d*x^(1/2)))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^(1/2))+2*im*a^-2*b^3*d^-1*x^3//2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*im*b*a^-2*d^-1*x^3//2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+12*im*a^-2*b^3*d^-3*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+24*im*b*a^-2*d^-3*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^3//2*(a+b*csc(c+d*x^(1/2))), x) == :(2//5*a*x^5//2+-48*b*d^-5*Polylogarithms.polylog(5,exp(im*(c+d*x^(1/2))))+48*b*d^-5*Polylogarithms.polylog(5,-1*exp(im*(c+d*x^(1/2))))+-24*b*x*d^-3*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-4*b*d^-1*x^2*arctanh(exp(im*(c+d*x^(1/2))))+24*b*x*d^-3*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+-48*im*b*d^-4*x^(1/2)*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-8*im*b*d^-2*x^3//2*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+8*im*b*d^-2*x^3//2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2))))+48*im*b*d^-4*x^(1/2)*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2)))))
@test integrate(x^(1/2)*(a+b*csc(c+d*x^(1/2))), x) == :(2//3*a*x^3//2+-4*b*d^-3*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+4*b*d^-3*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+-4*b*x*d^-1*arctanh(exp(im*(c+d*x^(1/2))))+-4*im*b*d^-2*x^(1/2)*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+4*im*b*d^-2*x^(1/2)*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^-1//2*(a+b*csc(c+d*x^(1/2))), x) == :(2*a*x^(1/2)+-2*b*d^-1*arctanh(cos(c+d*x^(1/2))))
@test integrate(x^3//2*(a+b*csc(c+d*x^(1/2)))^2, x) == :(2//5*a^2*x^5//2+-96*a*b*d^-5*Polylogarithms.polylog(5,exp(im*(c+d*x^(1/2))))+-2*im*b^2*d^-1*x^2+-2*b^2*d^-1*x^2*cot(c+d*x^(1/2))+6*im*b^2*d^-5*Polylogarithms.polylog(4,exp(2*im*(c+d*x^(1/2))))+8*b^2*d^-2*x^3//2*log(1+-1*exp(2*im*(c+d*x^(1/2))))+12*b^2*d^-4*x^(1/2)*Polylogarithms.polylog(3,exp(2*im*(c+d*x^(1/2))))+96*a*b*d^-5*Polylogarithms.polylog(5,-1*exp(im*(c+d*x^(1/2))))+-48*a*b*x*d^-3*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-12*im*x*b^2*d^-3*Polylogarithms.polylog(2,exp(2*im*(c+d*x^(1/2))))+-8*a*b*d^-1*x^2*arctanh(exp(im*(c+d*x^(1/2))))+48*a*b*x*d^-3*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+-96*im*a*b*d^-4*x^(1/2)*Polylogarithms.polylog(4,-1*exp(im*(c+d*x^(1/2))))+-16*im*a*b*d^-2*x^3//2*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+16*im*a*b*d^-2*x^3//2*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2))))+96*im*a*b*d^-4*x^(1/2)*Polylogarithms.polylog(4,exp(im*(c+d*x^(1/2)))))
@test integrate(x^(1/2)*(a+b*csc(c+d*x^(1/2)))^2, x) == :(2//3*a^2*x^3//2+-8*a*b*d^-3*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^(1/2))))+-2*im*x*b^2*d^-1+-2*im*b^2*d^-3*Polylogarithms.polylog(2,exp(2*im*(c+d*x^(1/2))))+-2*x*b^2*d^-1*cot(c+d*x^(1/2))+4*b^2*d^-2*x^(1/2)*log(1+-1*exp(2*im*(c+d*x^(1/2))))+8*a*b*d^-3*Polylogarithms.polylog(3,exp(im*(c+d*x^(1/2))))+-8*a*b*x*d^-1*arctanh(exp(im*(c+d*x^(1/2))))+-8*im*a*b*d^-2*x^(1/2)*Polylogarithms.polylog(2,exp(im*(c+d*x^(1/2))))+8*im*a*b*d^-2*x^(1/2)*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^-1//2*(a+b*csc(c+d*x^(1/2)))^2, x) == :(2*a^2*x^(1/2)+-2*b^2*d^-1*cot(c+d*x^(1/2))+-4*a*b*d^-1*arctanh(cos(c+d*x^(1/2))))
@test integrate(x^-1//2*csc(x^(1/2))^3, x) == :(-1*arctanh(cos(x^(1/2)))+-1*cot(x^(1/2))*csc(x^(1/2)))
@test integrate(x^3//2*(a+b*csc(c+d*x^(1/2)))^-1, x) == :(2//5*a^-1*x^5//2+-48*im*b*a^-1*d^-5*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-48*b*a^-1*d^-4*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-8*b*a^-1*d^-2*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+8*b*a^-1*d^-2*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+48*im*b*a^-1*d^-5*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+48*b*a^-1*d^-4*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-24*im*b*x*a^-1*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*b*a^-1*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+2*im*b*a^-1*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+24*im*b*x*a^-1*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^(1/2)*(a+b*csc(c+d*x^(1/2)))^-1, x) == :(2//3*a^-1*x^3//2+-4*im*b*a^-1*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*b*a^-1*d^-2*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*im*b*a^-1*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*b*a^-1*d^-2*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*b*x*a^-1*d^-1*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+2*im*b*x*a^-1*d^-1*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^-1//2*(a+b*csc(c+d*x^(1/2)))^-1, x) == :(2*a^-1*x^(1/2)+4*b*a^-1*d^-1*(a^2+-1*b^2)^-1//2*arctanh((a^2+-1*b^2)^-1//2*(a+b*tan((1/2)*c+(1/2)*d*x^(1/2)))))
@test integrate(x^3//2*(a+b*csc(c+d*x^(1/2)))^-2, x) == :(2//5*a^-2*x^5//2+-96*im*b*a^-2*d^-5*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-96*b*a^-2*d^-4*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-48*im*a^-2*b^3*d^-5*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-48*a^-2*b^3*d^-4*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-16*b*a^-2*d^-2*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-8*a^-2*b^3*d^-2*x^3//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^2*d^-1*x^2*(a^2+-1*b^2)^-1+8*a^-2*b^2*d^-2*x^3//2*(a^2+-1*b^2)^-1*log(1+a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+8*a^-2*b^2*d^-2*x^3//2*(a^2+-1*b^2)^-1*log(1+a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+8*a^-2*b^3*d^-2*x^3//2*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+16*b*a^-2*d^-2*x^3//2*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+48*im*a^-2*b^2*d^-5*(a^2+-1*b^2)^-1*Polylogarithms.polylog(4,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+48*im*a^-2*b^2*d^-5*(a^2+-1*b^2)^-1*Polylogarithms.polylog(4,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+48*im*a^-2*b^3*d^-5*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(5,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+48*a^-2*b^2*d^-4*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+48*a^-2*b^2*d^-4*x^(1/2)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(3,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+48*a^-2*b^3*d^-4*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(4,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+96*im*b*a^-2*d^-5*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(5,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+96*b*a^-2*d^-4*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(4,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-48*im*b*x*a^-2*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-24*im*x*a^-2*b^2*d^-3*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-24*im*x*a^-2*b^2*d^-3*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-24*im*x*a^-2*b^3*d^-3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*im*b*a^-2*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*a^-2*b^3*d^-1*x^2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*a^-1*b^2*d^-1*x^2*(b+a*sin(c+d*x^(1/2)))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^(1/2))+2*im*a^-2*b^3*d^-1*x^2*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*im*b*a^-2*d^-1*x^2*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+24*im*x*a^-2*b^3*d^-3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+48*im*b*x*a^-2*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^(1/2)*(a+b*csc(c+d*x^(1/2)))^-2, x) == :(2//3*a^-2*x^3//2+-8*im*b*a^-2*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-8*b*a^-2*d^-2*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*im*a^-2*b^2*d^-3*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-4*im*a^-2*b^2*d^-3*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+-4*im*a^-2*b^3*d^-3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*a^-2*b^3*d^-2*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*x*a^-2*b^2*d^-1*(a^2+-1*b^2)^-1+4*im*a^-2*b^3*d^-3*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*a^-2*b^2*d^-2*x^(1/2)*(a^2+-1*b^2)^-1*log(1+a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+4*a^-2*b^2*d^-2*x^(1/2)*(a^2+-1*b^2)^-1*log(1+a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^(1/2))))+4*a^-2*b^3*d^-2*x^(1/2)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+8*im*b*a^-2*d^-3*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+8*b*a^-2*d^-2*x^(1/2)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-4*im*b*x*a^-2*d^-1*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*im*x*a^-2*b^3*d^-1*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+-2*x*a^-1*b^2*d^-1*(b+a*sin(c+d*x^(1/2)))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^(1/2))+2*im*x*a^-2*b^3*d^-1*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2))))+4*im*b*x*a^-2*d^-1*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^(1/2)))))
@test integrate(x^-1//2*(a+b*csc(c+d*x^(1/2)))^-2, x) == :(2*a^-2*x^(1/2)+-2*a^-1*b^2*d^-1*(a+b*csc(c+d*x^(1/2)))^-1*(a^2+-1*b^2)^-1*cot(c+d*x^(1/2))+4*b*a^-2*d^-1*(a^2+-1*b^2)^-3//2*(-1*b^2+2*a^2)*arctanh((a^2+-1*b^2)^-1//2*(a+b*tan((1/2)*c+(1/2)*d*x^(1/2)))))
@test integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n)), x) == :(a*e^-1*n^-1*(e*x)^n+-1*b*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^n*arctanh(cos(c+d*x^n)))
@test integrate((e*x)^(-1+2n)*(a+b*csc(c+d*x^n)), x) == :((1/2)*a*e^-1*n^-1*(e*x)^(2n)+-2*b*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*arctanh(exp(im*(c+d*x^n)))+im*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^n)))+-1*im*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*Polylogarithms.polylog(2,exp(im*(c+d*x^n))))
@test integrate((e*x)^(-1+3n)*(a+b*csc(c+d*x^n)), x) == :(1//3*a*e^-1*n^-1*(e*x)^(3n)+-2*b*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*arctanh(exp(im*(c+d*x^n)))+-2*b*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^n)))+2*b*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*Polylogarithms.polylog(3,exp(im*(c+d*x^n)))+-2*im*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*Polylogarithms.polylog(2,exp(im*(c+d*x^n)))+2*im*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^n))))
@test integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n))^2, x) == :(a^2*e^-1*n^-1*(e*x)^n+-1*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^n*cot(c+d*x^n)+-2*a*b*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^n*arctanh(cos(c+d*x^n)))
@test integrate((e*x)^(-1+2n)*(a+b*csc(c+d*x^n))^2, x) == :((1/2)*a^2*e^-1*n^-1*(e*x)^(2n)+b^2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*log(sin(c+d*x^n))+-1*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*cot(c+d*x^n)+-4*a*b*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*arctanh(exp(im*(c+d*x^n)))+-2*im*a*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*Polylogarithms.polylog(2,exp(im*(c+d*x^n)))+2*im*a*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^n))))
@test integrate((e*x)^(-1+3n)*(a+b*csc(c+d*x^n))^2, x) == :(1//3*a^2*e^-1*n^-1*(e*x)^(3n)+-1*im*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)+-1*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*cot(c+d*x^n)+2*b^2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*log(1+-1*exp(2*im*(c+d*x^n)))+-1*im*b^2*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*Polylogarithms.polylog(2,exp(2*im*(c+d*x^n)))+-4*a*b*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*arctanh(exp(im*(c+d*x^n)))+-4*a*b*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*Polylogarithms.polylog(3,-1*exp(im*(c+d*x^n)))+4*a*b*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*Polylogarithms.polylog(3,exp(im*(c+d*x^n)))+-4*im*a*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*Polylogarithms.polylog(2,exp(im*(c+d*x^n)))+4*im*a*b*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*Polylogarithms.polylog(2,-1*exp(im*(c+d*x^n))))
@test integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n))^-1, x) == :(a^-1*e^-1*n^-1*(e*x)^n+2*b*a^-1*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^n*(a^2+-1*b^2)^-1//2*arctanh((a^2+-1*b^2)^-1//2*(a+b*tan((1/2)*c+(1/2)*d*x^n))))
@test integrate((e*x)^(-1+2n)*(a+b*csc(c+d*x^n))^-1, x) == :((1/2)*a^-1*e^-1*n^-1*(e*x)^(2n)+b*a^-1*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*b*a^-1*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+im*b*a^-1*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*im*b*a^-1*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n))))
@test integrate((e*x)^(-1+3n)*(a+b*csc(c+d*x^n))^-1, x) == :(1//3*a^-1*e^-1*n^-1*(e*x)^(3n)+-2*b*a^-1*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+2*b*a^-1*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+im*b*a^-1*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*im*b*a^-1*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-2*im*b*a^-1*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+2*im*b*a^-1*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n))))
@test integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n))^-2, x) == :(a^-2*e^-1*n^-1*(e*x)^n+-1*a^-1*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^n*(a+b*csc(c+d*x^n))^-1*(a^2+-1*b^2)^-1*cot(c+d*x^n)+2*b*a^-2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^n*(a^2+-1*b^2)^-3//2*(-1*b^2+2*a^2)*arctanh((a^2+-1*b^2)^-1//2*(a+b*tan((1/2)*c+(1/2)*d*x^n))))
@test integrate((e*x)^(-1+2n)*(a+b*csc(c+d*x^n))^-2, x) == :((1/2)*a^-2*e^-1*n^-1*(e*x)^(2n)+a^-2*b^2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*(a^2+-1*b^2)^-1*log(b+a*sin(c+d*x^n))+a^-2*b^3*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*a^-2*b^3*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-2*b*a^-2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+2*b*a^-2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+im*a^-2*b^3*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*im*a^-2*b^3*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*a^-1*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*(b+a*sin(c+d*x^n))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^n)+-2*im*b*a^-2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+2*im*b*a^-2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(2n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n))))
@test integrate((e*x)^(-1+3n)*(a+b*csc(c+d*x^n))^-2, x) == :(1//3*a^-2*e^-1*n^-1*(e*x)^(3n)+-1*im*a^-2*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(a^2+-1*b^2)^-1+-4*b*a^-2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-2*a^-2*b^3*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+2*a^-2*b^2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(a^2+-1*b^2)^-1*log(1+a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^n)))+2*a^-2*b^2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(a^2+-1*b^2)^-1*log(1+a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^n)))+2*a^-2*b^3*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(2,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+4*b*a^-2*d^-2*e^-1*n^-1*x^(-2n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(2,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+im*a^-2*b^3*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*im*a^-2*b^3*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(b^2+-1*a^2)^-3//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-1*a^-1*b^2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(b+a*sin(c+d*x^n))^-1*(a^2+-1*b^2)^-1*cos(c+d*x^n)+-4*im*b*a^-2*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-2*im*b*a^-2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+-2*im*a^-2*b^2*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*((a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^n)))+-2*im*a^-2*b^2*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(a^2+-1*b^2)^-1*Polylogarithms.polylog(2,-1*a*(-1*(a^2+-1*b^2)^(1/2)+im*b)^-1*exp(im*(c+d*x^n)))+-2*im*a^-2*b^3*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+2*im*b*a^-2*d^-1*e^-1*n^-1*x^(-1n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*log(1+-1*im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+2*im*a^-2*b^3*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(b^2+-1*a^2)^-3//2*Polylogarithms.polylog(3,im*a*(b+(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n)))+4*im*b*a^-2*d^-3*e^-1*n^-1*x^(-3n)*(e*x)^(3n)*(b^2+-1*a^2)^-1//2*Polylogarithms.polylog(3,im*a*(b+-1*(b^2+-1*a^2)^(1/2))^-1*exp(im*(c+d*x^n))))

max_stars_repo_path: test/4 Trig functions/4.6 Cosecant/4.6.11 (e x)^m (a+b csc(c+d x^n))^p.jl


text:
# Benchmark tests comparing the semiinf solution on 1 and four threads.
# DA_semiinf has almost no time dependence on the # of threads used
# DA_semiinf1 has been edited for custom loops that can utilize multi-threading
# This results in DA_semiinf1 being 1.6x faster
function DA_semiinf(t, β::Array{Float64,1}, ρ::Float64, ndet::Float64, nmed::Float64)

    n::Float64 = nmed/ndet
    μa::Float64 = β[1]
    μsp::Float64 = β[2]
    D::Float64 = 1/3μsp
	ν::Float64 = 29.9792345/nmed

    Rt1 = Array{Float64}(undef, length(t))
    Rt2 = Array{Float64}(undef, length(t))

	if n > 1.0
		A = 504.332889 - 2641.00214n + 5923.699064n^2 - 7376.355814n^3 +
		 5507.53041n^4 - 2463.357945n^5 + 610.956547n^6 - 64.8047n^7
	elseif n < 1.0
		A = 3.084635 - 6.531194n + 8.357854n^2 - 5.082751n^3
	else
		A = 1.0
	end

	zs::Float64 = 1/μsp
	ze::Float64 = 2A*D

	z3m::Float64 = - zs
    z4m::Float64 = 2ze +zs

   	Rt1 = @. -exp(-(ρ^2/(4D*ν*t)) - μa*ν*t)
   	Rt1 = @. Rt1/(2*(4π*D*ν)^(3/2)*t^(5/2))

   	Rt2 = @. z3m*exp(-(z3m^2/(4D*ν*t))) - z4m*exp(-(z4m^2/(4D*ν*t)))

   	Rt = @. Rt1*Rt2

   	replace!(Rt, NaN => 0)
    return Rt

end
#=
1 THREAD
BenchmarkTools.Trial:
  memory estimate:  48.16 KiB
  allocs estimate:  9
  --------------
  minimum time:     78.548 μs (0.00% GC)
  median time:      81.226 μs (0.00% GC)
  mean time:        89.842 μs (5.96% GC)
  maximum time:     6.547 ms (98.55% GC)
  --------------
  samples:          10000
  evals/sample:     1

4 THREADS
BenchmarkTools.Trial:
  memory estimate:  48.16 KiB
  allocs estimate:  9
  --------------
  minimum time:     78.612 μs (0.00% GC)
  median time:      81.431 μs (0.00% GC)
  mean time:        87.015 μs (5.90% GC)
  maximum time:     6.618 ms (98.17% GC)
  --------------
  samples:          10000
  evals/sample:     1

12 THREADS (Michaels Desktop CPU: Intel 8700k)
BenchmarkTools.Trial:
  memory estimate:  48.16 KiB
  allocs estimate:  9
  --------------
  minimum time:     46.689 μs (0.00% GC)
  median time:      48.945 μs (0.00% GC)
  mean time:        50.164 μs (0.79% GC)
  maximum time:     613.391 μs (84.43% GC)
  --------------
  samples:          10000
  evals/sample:     1

=#

function DA_semiinf1(t, β::Array{Float64,1}, ρ::Float64, ndet::Float64, nmed::Float64)

    n::Float64 = nmed/ndet
    μa::Float64 = β[1]
    μsp::Float64 = β[2]
    D::Float64 = 1/3μsp
	ν::Float64 = 29.9792345/nmed

    Rt1 = Array{Float64}(undef, length(t))
    Rt2 = Array{Float64}(undef, length(t))

	if n > 1.0
		A = 504.332889 - 2641.00214n + 5923.699064n^2 - 7376.355814n^3 +
		 5507.53041n^4 - 2463.357945n^5 + 610.956547n^6 - 64.8047n^7
	elseif n < 1.0
		A = 3.084635 - 6.531194n + 8.357854n^2 - 5.082751n^3
	else
		A = 1.0
	end

	zs::Float64 = 1/μsp
	ze::Float64 = 2A*D

	z3m::Float64 = - zs
    z4m::Float64 = 2ze +zs

	Threads.@threads for n in eachindex(t)

   		Rt1[n] = -exp(-(ρ^2/(4D*ν*t[n])) - μa*ν*t[n])
   		Rt1[n] = Rt1[n]/(2*(4π*D*ν)^(3/2)*t[n]^(5/2))

   		Rt2[n] = z3m*exp(-(z3m^2/(4D*ν*t[n]))) - z4m*exp(-(z4m^2/(4D*ν*t[n])))

	end

    replace!(Rt1.*Rt2, NaN => 0)

end

#=

1 THREAD
BenchmarkTools.Trial:
  memory estimate:  24.16 KiB
  allocs estimate:  6
  --------------
  minimum time:     62.370 μs (0.00% GC)
  median time:      64.190 μs (0.00% GC)
  mean time:        68.621 μs (4.76% GC)
  maximum time:     6.965 ms (98.77% GC)
  --------------
  samples:          10000
  evals/sample:     1

4 THREADS
BenchmarkTools.Trial:
  memory estimate:  27.05 KiB
  allocs estimate:  27
  --------------
  minimum time:     43.496 μs (0.00% GC)
  median time:      51.549 μs (0.00% GC)
  mean time:        98.719 μs (2.47% GC)
  maximum time:     8.069 ms (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1

  12 THREADS : (Michael's Desktop)

=#

function DT_model3(t, β::Array{Float64,1}, ρ::Float64, ndet::Float64, nmed::Float64)

    n::Float64 = nmed/ndet
    μa::Float64 = β[1]
    μsp::Float64 = β[2]
    D::Float64 = 1/3μsp
  	ν::Float64 = 29.9792345/nmed

    Rt = Array{Float64}(undef, length(t))

	  if n > 1.0
		  A = 504.332889 - 2641.00214n + 5923.699064n^2 - 7376.355814n^3 +
		  5507.53041n^4 - 2463.357945n^5 + 610.956547n^6 - 64.8047n^7
	  elseif n < 1.0
		  A = 3.084635 - 6.531194n + 8.357854n^2 - 5.082751n^3
	  else
		  A = 1.0
	  end

	  zs::Float64 = 1/μsp
	  ze::Float64 = 2A*D

	  z3m::Float64 = - zs
    z4m::Float64 = 2ze +zs

    Threads.@threads for n in eachindex(t)

        Rt[n] = -exp(-(ρ^2/(4D*ν*t[n])) - μa*ν*t[n])
        Rt[n] = Rt[n]/(2*(4π*D*ν)^(3/2)*t[n]^(5/2))

        Rt[n] = Rt[n]*(z3m*exp(-(z3m^2/(4D*ν*t[n]))) - z4m*exp(-(z4m^2/(4D*ν*t[n]))))

        if isnan(Rt[n])
            Rt[n] = 0
        end

    end

     return Rt

end

#= 12 threads
julia> @benchmark DT_model3(0:0.01:10, [0.1,10.], 1.0, 1.0, 1.0)
BenchmarkTools.Trial:
  memory estimate:  16.95 KiB
  allocs estimate:  62
  --------------
  minimum time:     9.657 μs (0.00% GC)
  median time:      11.596 μs (0.00% GC)
  mean time:        13.072 μs (3.51% GC)
  maximum time:     1.661 ms (96.79% GC)
  --------------
  samples:          10000
  evals/sample:     1

max_stars_repo_name: sammzer/LightPropagation

max_issues_repo_name: sammzer/LightPropagation

max_forks_repo_name: sammzer/LightPropagation