R/galambosExpr.R

## This file is not to be edited. It is generated by ../inst/docs/mathnb/exprPrep.R
`galambosCopula.cdf.expr` <-
expression(0, exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))))
`galambosCopula.cdf.algr` <-
expression({
    .value <- 0
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
}, {
    .expr2 <- log(u1 * u2)
    .expr4 <- log(u2)/.expr2
    .expr5 <- -alpha
    .value <- exp(.expr2 * (1 - (.expr4^.expr5 + (1 - .expr4)^.expr5)^(-1/alpha)))
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
})
`galambosCopula.cdfDerWrtArg.expr` <-
expression(0, exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * (u2/(u1 * 
    u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha)) - log(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
    (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2)))))))
`galambosCopula.cdfDerWrtArg.algr` <-
expression({
    .value <- 0
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
}, {
    .expr1 <- u1 * u2
    .expr2 <- log(.expr1)
    .expr3 <- log(u2)
    .expr4 <- .expr3/.expr2
    .expr5 <- -alpha
    .expr7 <- 1 - .expr4
    .expr9 <- .expr4^.expr5 + .expr7^.expr5
    .expr11 <- -1/alpha
    .expr13 <- 1 - .expr9^.expr11
    .expr16 <- u2/.expr1
    .expr20 <- .expr5 - 1
    .expr25 <- .expr5 * (.expr3 * .expr16/.expr2^2)
    .value <- exp(.expr2 * .expr13) * (.expr16 * .expr13 - .expr2 * 
        (.expr9^(.expr11 - 1) * (.expr11 * (.expr7^.expr20 * 
            .expr25 - .expr4^.expr20 * .expr25))))
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
})
`galambosCopula.cdfDerWrtPar.expr` <-
expression(0, -(exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * (log(u1 * 
    u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha) * (log(((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * (1/alpha^2)) - 
    ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * ((1 - 
        (log(u2)/log(u1 * u2)))^(-alpha) * log((1 - (log(u2)/log(u1 * 
        u2)))) + (log(u2)/log(u1 * u2))^(-alpha) * log((log(u2)/log(u1 * 
        u2)))))))))
`galambosCopula.cdfDerWrtPar.algr` <-
expression({
    .value <- 0
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
}, {
    .expr2 <- log(u1 * u2)
    .expr4 <- log(u2)/.expr2
    .expr5 <- -alpha
    .expr6 <- .expr4^.expr5
    .expr7 <- 1 - .expr4
    .expr8 <- .expr7^.expr5
    .expr9 <- .expr6 + .expr8
    .expr11 <- -1/alpha
    .expr12 <- .expr9^.expr11
    .value <- -(exp(.expr2 * (1 - .expr12)) * (.expr2 * (.expr12 * 
        (log(.expr9) * (1/alpha^2)) - .expr9^(.expr11 - 1) * 
        (.expr11 * (.expr8 * log(.expr7) + .expr6 * log(.expr4))))))
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
})
`galambosCopula.pdf.expr` <-
expression(0, exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * (u1/(u1 * 
    u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha)) - log(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2)))))) * (u2/(u1 * u2) * (1 - ((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
    log(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * ((1 - 
        (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
        (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * 
        u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * 
        u2))/log(u1 * u2)^2)))))) + exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * 
    ((1/(u1 * u2) - u2 * u1/(u1 * u2)^2) * (1 - ((log(u2)/log(u1 * 
        u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
        u2/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - 
            (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 1) * 
            ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2))))) - 
        (u1/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - 
            (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 1) * 
            ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2))))) + log(u1 * u2) * (((log(u2)/log(u1 * 
            u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 
            1) - 1) * (((-1/alpha) - 1) * ((log(u2)/log(u1 * 
            u2))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
            u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) - 
            (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
                (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
                  u2)^2)))) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * 
            u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * 
            u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
            1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
            u2)^2)))) + ((log(u2)/log(u1 * u2))^(-alpha) + (1 - 
            (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 1) * 
            ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * ((-alpha) * ((1/u2 * (u2/(u1 * u2)) + log(u2) * 
                (1/(u1 * u2) - u2 * u1/(u1 * u2)^2))/log(u1 * 
                u2)^2 - log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)) - (1 - 
                (log(u2)/log(u1 * u2)))^(((-alpha) - 1) - 1) * 
                (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                  (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                ((log(u2)/log(u1 * u2))^(((-alpha) - 1) - 1) * 
                  (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                    (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                  (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) + 
                  (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                    ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                      u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                      log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                        u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)))))))))
`galambosCopula.pdf.algr` <-
expression({
    .value <- 0
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
}, {
    .expr1 <- u1 * u2
    .expr2 <- log(.expr1)
    .expr3 <- log(u2)
    .expr4 <- .expr3/.expr2
    .expr5 <- -alpha
    .expr7 <- 1 - .expr4
    .expr9 <- .expr4^.expr5 + .expr7^.expr5
    .expr11 <- -1/alpha
    .expr13 <- 1 - .expr9^.expr11
    .expr15 <- exp(.expr2 * .expr13)
    .expr16 <- u1/.expr1
    .expr18 <- .expr11 - 1
    .expr19 <- .expr9^.expr18
    .expr20 <- .expr5 - 1
    .expr21 <- .expr4^.expr20
    .expr22 <- 1/u2
    .expr25 <- .expr2^2
    .expr27 <- .expr22/.expr2 - .expr3 * .expr16/.expr25
    .expr28 <- .expr5 * .expr27
    .expr30 <- .expr7^.expr20
    .expr32 <- .expr21 * .expr28 - .expr30 * .expr28
    .expr34 <- .expr19 * (.expr11 * .expr32)
    .expr38 <- u2/.expr1
    .expr40 <- .expr3 * .expr38
    .expr42 <- .expr5 * (.expr40/.expr25)
    .expr46 <- .expr11 * (.expr30 * .expr42 - .expr21 * .expr42)
    .expr47 <- .expr19 * .expr46
    .expr55 <- 1/.expr1 - u2 * u1/.expr1^2
    .expr75 <- .expr5 * ((.expr22 * .expr38 + .expr3 * .expr55)/.expr25 - 
        .expr40 * (2 * (.expr16 * .expr2))/.expr25^2)
    .expr77 <- .expr20 - 1
    .expr79 <- .expr20 * .expr27
    .value <- .expr15 * (.expr16 * .expr13 - .expr2 * .expr34) * 
        (.expr38 * .expr13 - .expr2 * .expr47) + .expr15 * (.expr55 * 
        .expr13 - .expr38 * .expr34 - (.expr16 * .expr47 + .expr2 * 
        (.expr9^(.expr18 - 1) * (.expr18 * .expr32) * .expr46 + 
            .expr19 * (.expr11 * (.expr30 * .expr75 - .expr7^.expr77 * 
                .expr79 * .expr42 - (.expr4^.expr77 * .expr79 * 
                .expr42 + .expr21 * .expr75))))))
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
})
`galambosCopula.pdfDerWrtArg.expr` <-
expression(0, (exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * (u2/(u1 * 
    u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha)) - log(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
    (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2)))))) * (u1/(u1 * u2) * 
    (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^(-1/alpha)) - log(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2)))))) + exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * 
    ((1/(u1 * u2) - u1 * u2/(u1 * u2)^2) * (1 - ((log(u2)/log(u1 * 
        u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
        u1/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - 
            (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 1) * 
            ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2))))) - (u2/(u1 * u2) * (((log(u2)/log(u1 * 
        u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
        1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
        1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
        u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
        1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
        u2))/log(u1 * u2)^2))))) + log(u1 * u2) * (((log(u2)/log(u1 * 
        u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 
        1) - 1) * (((-1/alpha) - 1) * ((1 - (log(u2)/log(u1 * 
        u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * 
        u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
        1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))) * 
        ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * 
            ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
                u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
            u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
            u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)))) - 
        ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
            u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * 
            ((log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                (1/u2 * (u2/(u1 * u2))/log(u1 * u2)^2 + (log(u2) * 
                  (1/(u1 * u2) - u1 * u2/(u1 * u2)^2)/log(u1 * 
                  u2)^2 - log(u2) * (u1/(u1 * u2)) * (2 * (u2/(u1 * 
                  u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2))) + 
                (log(u2)/log(u1 * u2))^(((-alpha) - 1) - 1) * 
                  (((-alpha) - 1) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                    u2)^2)) * ((-alpha) * (1/u2/log(u1 * u2) - 
                  log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) + 
                ((1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 1) - 
                  1) * (((-alpha) - 1) * (log(u2) * (u2/(u1 * 
                  u2))/log(u1 * u2)^2)) * ((-alpha) * (1/u2/log(u1 * 
                  u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) - 
                  (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
                    ((-alpha) * (1/u2 * (u2/(u1 * u2))/log(u1 * 
                      u2)^2 + (log(u2) * (1/(u1 * u2) - u1 * 
                      u2/(u1 * u2)^2)/log(u1 * u2)^2 - log(u2) * 
                      (u1/(u1 * u2)) * (2 * (u2/(u1 * u2) * log(u1 * 
                      u2)))/(log(u1 * u2)^2)^2)))))))))) * (u2/(u1 * 
    u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha)) - log(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
    (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2)))))) - exp(log(u1 * u2) * 
    (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^(-1/alpha))) * (u1/(u1 * u2) * (1 - ((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
    log(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * ((log(u2)/log(u1 * 
        u2))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * u2) - 
        log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
        u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * u2) - 
        log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)))))) * (u2/(u1 * 
    u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * 
    u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
    u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
    (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2))))) + u2 * u2/(u1 * 
    u2)^2 * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha)) + (u2/(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
    (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2))))) + log(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 
    1) - 1) * (((-1/alpha) - 1) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
    (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2)))) * ((-1/alpha) * ((1 - 
    (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
    (u2/(u1 * u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
    1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))) + 
    ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * ((1 - 
        (log(u2)/log(u1 * u2)))^(((-alpha) - 1) - 1) * (((-alpha) - 
        1) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
        (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
        u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2 * u2/(u1 * 
        u2)^2)/log(u1 * u2)^2 + log(u2) * (u2/(u1 * u2)) * (2 * 
        (u2/(u1 * u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)) + 
        ((log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
            (log(u2) * (u2 * u2/(u1 * u2)^2)/log(u1 * u2)^2 + 
                log(u2) * (u2/(u1 * u2)) * (2 * (u2/(u1 * u2) * 
                  log(u1 * u2)))/(log(u1 * u2)^2)^2)) + (log(u2)/log(u1 * 
            u2))^(((-alpha) - 1) - 1) * (((-alpha) - 1) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2)))))))) + (exp(log(u1 * 
    u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha))) * (u2/(u1 * u2) * (1 - ((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
    log(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * ((1 - 
        (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
        (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * 
        u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * 
        u2))/log(u1 * u2)^2)))))) * ((1/(u1 * u2) - u2 * u1/(u1 * 
    u2)^2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha)) - u2/(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2))))) - (u1/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 1) * 
    ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
        ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
        (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2))))) + log(u1 * u2) * 
    (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * (((-1/alpha) - 
        1) * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
        (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
            u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
        1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
        u2))/log(u1 * u2)^2)))) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * 
        u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * 
        u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
        1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))) + 
        ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
            u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * 
            ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
                ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                  u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                  log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * u2) * 
                    log(u1 * u2)))/(log(u1 * u2)^2)^2)) - (1 - 
                (log(u2)/log(u1 * u2)))^(((-alpha) - 1) - 1) * 
                (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                  (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                ((log(u2)/log(u1 * u2))^(((-alpha) - 1) - 1) * 
                  (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                    (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                  (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) + 
                  (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                    ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                      u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                      log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                        u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)))))))) - 
    exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
        (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * 
        ((1/(u1 * u2) - u2 * u1/(u1 * u2)^2) * (((log(u2)/log(u1 * 
            u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
            1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
            1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
            u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 1) * 
            ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2))))) + 
            (u2/(u1 * u2)^2 + (u2/(u1 * u2)^2 - u2 * u1 * (2 * 
                (u2 * (u1 * u2)))/((u1 * u2)^2)^2)) * (1 - ((log(u2)/log(u1 * 
                u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) + 
            (u2/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 
                1) - 1) * (((-1/alpha) - 1) * ((1 - (log(u2)/log(u1 * 
                u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                (u2/(u1 * u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * 
                u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                (u2/(u1 * u2))/log(u1 * u2)^2)))) * ((-1/alpha) * 
                ((log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                  (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
                    u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                  1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                  (u1/(u1 * u2))/log(u1 * u2)^2)))) - ((log(u2)/log(u1 * 
                u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (1/u2 * (u2/(u1 * u2))/log(u1 * 
                u2)^2 + (log(u2) * (1/(u1 * u2) - u1 * u2/(u1 * 
                u2)^2)/log(u1 * u2)^2 - log(u2) * (u1/(u1 * u2)) * 
                (2 * (u2/(u1 * u2) * log(u1 * u2)))/(log(u1 * 
                u2)^2)^2))) + (log(u2)/log(u1 * u2))^(((-alpha) - 
                1) - 1) * (((-alpha) - 1) * (log(u2) * (u2/(u1 * 
                u2))/log(u1 * u2)^2)) * ((-alpha) * (1/u2/log(u1 * 
                u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) + 
                ((1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 1) - 
                  1) * (((-alpha) - 1) * (log(u2) * (u2/(u1 * 
                  u2))/log(u1 * u2)^2)) * ((-alpha) * (1/u2/log(u1 * 
                  u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) - 
                  (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
                    ((-alpha) * (1/u2 * (u2/(u1 * u2))/log(u1 * 
                      u2)^2 + (log(u2) * (1/(u1 * u2) - u1 * 
                      u2/(u1 * u2)^2)/log(u1 * u2)^2 - log(u2) * 
                      (u1/(u1 * u2)) * (2 * (u2/(u1 * u2) * log(u1 * 
                      u2)))/(log(u1 * u2)^2)^2))))))) - u2 * 
                u2/(u1 * u2)^2 * (((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)))))) + 
            ((1/(u1 * u2) - u1 * u2/(u1 * u2)^2) * (((log(u2)/log(u1 * 
                u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2))))) + u1/(u1 * u2) * (((log(u2)/log(u1 * 
                u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 
                1) - 1) * (((-1/alpha) - 1) * ((1 - (log(u2)/log(u1 * 
                u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                (u2/(u1 * u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * 
                u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                (u2/(u1 * u2))/log(u1 * u2)^2)))) * ((-1/alpha) * 
                ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
                  ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                    u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                  1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                  u2)^2)))) + ((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
                1) - 1) * (((-alpha) - 1) * (log(u2) * (u2/(u1 * 
                u2))/log(u1 * u2)^2)) * ((-alpha) * (log(u2) * 
                (u2/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                (u2 * u2/(u1 * u2)^2)/log(u1 * u2)^2 + log(u2) * 
                (u2/(u1 * u2)) * (2 * (u2/(u1 * u2) * log(u1 * 
                u2)))/(log(u1 * u2)^2)^2)) + ((log(u2)/log(u1 * 
                u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                (u2 * u2/(u1 * u2)^2)/log(u1 * u2)^2 + log(u2) * 
                (u2/(u1 * u2)) * (2 * (u2/(u1 * u2) * log(u1 * 
                u2)))/(log(u1 * u2)^2)^2)) + (log(u2)/log(u1 * 
                u2))^(((-alpha) - 1) - 1) * (((-alpha) - 1) * 
                (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) * 
                ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                  u2)^2)))))) + (u2/(u1 * u2) * (((log(u2)/log(u1 * 
                u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 
                1) - 1) * (((-1/alpha) - 1) * ((log(u2)/log(u1 * 
                u2))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) - 
                (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
                  ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                    (u1/(u1 * u2))/log(u1 * u2)^2)))) * ((-1/alpha) * 
                ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
                  ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                    u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                  1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                  u2)^2)))) + ((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * ((-alpha) * ((1/u2 * (u2/(u1 * u2)) + log(u2) * 
                (1/(u1 * u2) - u2 * u1/(u1 * u2)^2))/log(u1 * 
                u2)^2 - log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)) - (1 - 
                (log(u2)/log(u1 * u2)))^(((-alpha) - 1) - 1) * 
                (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                  (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                ((log(u2)/log(u1 * u2))^(((-alpha) - 1) - 1) * 
                  (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                    (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                  (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) + 
                  (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                    ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                      u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                      log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                        u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)))))) + 
                log(u1 * u2) * ((((log(u2)/log(u1 * u2))^(-alpha) + 
                  (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((((-1/alpha) - 
                  1) - 1) - 1) * ((((-1/alpha) - 1) - 1) * ((1 - 
                  (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
                  (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                  (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                    (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))) * 
                  (((-1/alpha) - 1) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                    1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                    (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                    u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                    u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)))) - 
                  ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                    u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * 
                    (((-1/alpha) - 1) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                      1) * ((-alpha) * (1/u2 * (u2/(u1 * u2))/log(u1 * 
                      u2)^2 + (log(u2) * (1/(u1 * u2) - u1 * 
                      u2/(u1 * u2)^2)/log(u1 * u2)^2 - log(u2) * 
                      (u1/(u1 * u2)) * (2 * (u2/(u1 * u2) * log(u1 * 
                      u2)))/(log(u1 * u2)^2)^2))) + (log(u2)/log(u1 * 
                      u2))^(((-alpha) - 1) - 1) * (((-alpha) - 
                      1) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                      u2)^2)) * ((-alpha) * (1/u2/log(u1 * u2) - 
                      log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) + 
                      ((1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
                        1) - 1) * (((-alpha) - 1) * (log(u2) * 
                        (u2/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                        (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
                          u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                        u2)))^((-alpha) - 1) * ((-alpha) * (1/u2 * 
                        (u2/(u1 * u2))/log(u1 * u2)^2 + (log(u2) * 
                        (1/(u1 * u2) - u1 * u2/(u1 * u2)^2)/log(u1 * 
                        u2)^2 - log(u2) * (u1/(u1 * u2)) * (2 * 
                        (u2/(u1 * u2) * log(u1 * u2)))/(log(u1 * 
                        u2)^2)^2))))))) * ((-1/alpha) * ((1 - 
                  (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
                  (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                  (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                    (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))) + 
                  ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                    u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * 
                    (((-1/alpha) - 1) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                      1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                      (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - 
                      (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
                      ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                        (u1/(u1 * u2))/log(u1 * u2)^2)))) * ((-1/alpha) * 
                    ((1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
                      1) - 1) * (((-alpha) - 1) * (log(u2) * 
                      (u2/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                      (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                      (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                        1) * ((-alpha) * (log(u2) * (u2 * u2/(u1 * 
                        u2)^2)/log(u1 * u2)^2 + log(u2) * (u2/(u1 * 
                        u2)) * (2 * (u2/(u1 * u2) * log(u1 * 
                        u2)))/(log(u1 * u2)^2)^2)) + ((log(u2)/log(u1 * 
                      u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                      (u2 * u2/(u1 * u2)^2)/log(u1 * u2)^2 + 
                      log(u2) * (u2/(u1 * u2)) * (2 * (u2/(u1 * 
                        u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)) + 
                      (log(u2)/log(u1 * u2))^(((-alpha) - 1) - 
                        1) * (((-alpha) - 1) * (log(u2) * (u2/(u1 * 
                        u2))/log(u1 * u2)^2)) * ((-alpha) * (log(u2) * 
                        (u2/(u1 * u2))/log(u1 * u2)^2))))) + 
                  (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                    u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * 
                    (((-1/alpha) - 1) * ((1 - (log(u2)/log(u1 * 
                      u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                      (u2/(u1 * u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * 
                      u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
                      (u2/(u1 * u2))/log(u1 * u2)^2)))) * ((-1/alpha) * 
                    ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                      1) * ((-alpha) * ((1/u2 * (u2/(u1 * u2)) + 
                      log(u2) * (1/(u1 * u2) - u2 * u1/(u1 * 
                        u2)^2))/log(u1 * u2)^2 - log(u2) * (u2/(u1 * 
                      u2)) * (2 * (u1/(u1 * u2) * log(u1 * u2)))/(log(u1 * 
                      u2)^2)^2)) - (1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
                      1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * 
                      u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
                      u2)^2)) * ((-alpha) * (log(u2) * (u2/(u1 * 
                      u2))/log(u1 * u2)^2)) - ((log(u2)/log(u1 * 
                      u2))^(((-alpha) - 1) - 1) * (((-alpha) - 
                      1) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
                      u2))/log(u1 * u2)^2)) * ((-alpha) * (log(u2) * 
                      (u2/(u1 * u2))/log(u1 * u2)^2)) + (log(u2)/log(u1 * 
                      u2))^((-alpha) - 1) * ((-alpha) * ((1/u2 * 
                      (u2/(u1 * u2)) + log(u2) * (1/(u1 * u2) - 
                      u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                      log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                        u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2))))) + 
                    ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                      u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * 
                      ((1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
                        1) - 1) * (((-alpha) - 1) * (log(u2) * 
                        (u2/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                        ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                          u2) - u2 * u1/(u1 * u2)^2))/log(u1 * 
                          u2)^2 - log(u2) * (u2/(u1 * u2)) * 
                          (2 * (u1/(u1 * u2) * log(u1 * u2)))/(log(u1 * 
                          u2)^2)^2)) - (1 - (log(u2)/log(u1 * 
                        u2)))^((-alpha) - 1) * ((-alpha) * ((log(u2) * 
                        (u2/(u1 * u2)^2 + (u2/(u1 * u2)^2 - u2 * 
                          u1 * (2 * (u2 * (u1 * u2)))/((u1 * 
                          u2)^2)^2)) + 1/u2 * (u2 * u2/(u1 * 
                        u2)^2))/log(u1 * u2)^2 + (1/u2 * (u2/(u1 * 
                        u2)) + log(u2) * (1/(u1 * u2) - u2 * 
                        u1/(u1 * u2)^2)) * (2 * (u2/(u1 * u2) * 
                        log(u1 * u2)))/(log(u1 * u2)^2)^2 + ((log(u2) * 
                        (u2/(u1 * u2)) * (2 * ((1/(u1 * u2) - 
                        u1 * u2/(u1 * u2)^2) * log(u1 * u2) + 
                        u1/(u1 * u2) * (u2/(u1 * u2)))) - log(u2) * 
                        (u2 * u2/(u1 * u2)^2) * (2 * (u1/(u1 * 
                        u2) * log(u1 * u2))))/(log(u1 * u2)^2)^2 - 
                        log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                          u2) * log(u1 * u2))) * (2 * (2 * (u2/(u1 * 
                          u2) * log(u1 * u2)) * (log(u1 * u2)^2)))/((log(u1 * 
                          u2)^2)^2)^2))) - (((1 - (log(u2)/log(u1 * 
                        u2)))^((((-alpha) - 1) - 1) - 1) * ((((-alpha) - 
                        1) - 1) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                        u2)^2)) * (((-alpha) - 1) * (1/u2/log(u1 * 
                        u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
                        u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
                        1) - 1) * (((-alpha) - 1) * (1/u2 * (u2/(u1 * 
                        u2))/log(u1 * u2)^2 + (log(u2) * (1/(u1 * 
                        u2) - u1 * u2/(u1 * u2)^2)/log(u1 * u2)^2 - 
                        log(u2) * (u1/(u1 * u2)) * (2 * (u2/(u1 * 
                          u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)))) * 
                        ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                          u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
                        1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * 
                        u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
                        u2)^2)) * ((-alpha) * (log(u2) * (u2 * 
                        u2/(u1 * u2)^2)/log(u1 * u2)^2 + log(u2) * 
                        (u2/(u1 * u2)) * (2 * (u2/(u1 * u2) * 
                        log(u1 * u2)))/(log(u1 * u2)^2)^2))) + 
                        ((log(u2)/log(u1 * u2))^((-alpha) - 1) * 
                          ((-alpha) * ((log(u2) * (u2/(u1 * u2)^2 + 
                            (u2/(u1 * u2)^2 - u2 * u1 * (2 * 
                              (u2 * (u1 * u2)))/((u1 * u2)^2)^2)) + 
                            1/u2 * (u2 * u2/(u1 * u2)^2))/log(u1 * 
                            u2)^2 + (1/u2 * (u2/(u1 * u2)) + 
                            log(u2) * (1/(u1 * u2) - u2 * u1/(u1 * 
                              u2)^2)) * (2 * (u2/(u1 * u2) * 
                            log(u1 * u2)))/(log(u1 * u2)^2)^2 + 
                            ((log(u2) * (u2/(u1 * u2)) * (2 * 
                              ((1/(u1 * u2) - u1 * u2/(u1 * u2)^2) * 
                                log(u1 * u2) + u1/(u1 * u2) * 
                                (u2/(u1 * u2)))) - log(u2) * 
                              (u2 * u2/(u1 * u2)^2) * (2 * (u1/(u1 * 
                              u2) * log(u1 * u2))))/(log(u1 * 
                              u2)^2)^2 - log(u2) * (u2/(u1 * 
                              u2)) * (2 * (u1/(u1 * u2) * log(u1 * 
                              u2))) * (2 * (2 * (u2/(u1 * u2) * 
                              log(u1 * u2)) * (log(u1 * u2)^2)))/((log(u1 * 
                              u2)^2)^2)^2))) + (log(u2)/log(u1 * 
                          u2))^(((-alpha) - 1) - 1) * (((-alpha) - 
                          1) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                          u2)^2)) * ((-alpha) * ((1/u2 * (u2/(u1 * 
                          u2)) + log(u2) * (1/(u1 * u2) - u2 * 
                          u1/(u1 * u2)^2))/log(u1 * u2)^2 - log(u2) * 
                          (u2/(u1 * u2)) * (2 * (u1/(u1 * u2) * 
                          log(u1 * u2)))/(log(u1 * u2)^2)^2)) + 
                          ((log(u2)/log(u1 * u2))^(((-alpha) - 
                            1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * 
                            u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
                            u2)^2)) * ((-alpha) * (log(u2) * 
                            (u2 * u2/(u1 * u2)^2)/log(u1 * u2)^2 + 
                            log(u2) * (u2/(u1 * u2)) * (2 * (u2/(u1 * 
                              u2) * log(u1 * u2)))/(log(u1 * 
                              u2)^2)^2)) + ((log(u2)/log(u1 * 
                            u2))^(((-alpha) - 1) - 1) * (((-alpha) - 
                            1) * (1/u2 * (u2/(u1 * u2))/log(u1 * 
                            u2)^2 + (log(u2) * (1/(u1 * u2) - 
                            u1 * u2/(u1 * u2)^2)/log(u1 * u2)^2 - 
                            log(u2) * (u1/(u1 * u2)) * (2 * (u2/(u1 * 
                              u2) * log(u1 * u2)))/(log(u1 * 
                              u2)^2)^2))) + (log(u2)/log(u1 * 
                            u2))^((((-alpha) - 1) - 1) - 1) * 
                            ((((-alpha) - 1) - 1) * (log(u2) * 
                              (u2/(u1 * u2))/log(u1 * u2)^2)) * 
                            (((-alpha) - 1) * (1/u2/log(u1 * 
                              u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
                              u2)^2))) * ((-alpha) * (log(u2) * 
                            (u2/(u1 * u2))/log(u1 * u2)^2)))))))))))))
`galambosCopula.pdfDerWrtArg.algr` <-
expression({
    .value <- 0
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
}, {
    .expr1 <- u1 * u2
    .expr2 <- log(.expr1)
    .expr3 <- log(u2)
    .expr4 <- .expr3/.expr2
    .expr5 <- -alpha
    .expr7 <- 1 - .expr4
    .expr9 <- .expr4^.expr5 + .expr7^.expr5
    .expr11 <- -1/alpha
    .expr13 <- 1 - .expr9^.expr11
    .expr15 <- exp(.expr2 * .expr13)
    .expr16 <- u2/.expr1
    .expr18 <- .expr11 - 1
    .expr19 <- .expr9^.expr18
    .expr20 <- .expr5 - 1
    .expr21 <- .expr7^.expr20
    .expr22 <- .expr3 * .expr16
    .expr23 <- .expr2^2
    .expr24 <- .expr22/.expr23
    .expr25 <- .expr5 * .expr24
    .expr27 <- .expr4^.expr20
    .expr29 <- .expr21 * .expr25 - .expr27 * .expr25
    .expr30 <- .expr11 * .expr29
    .expr31 <- .expr19 * .expr30
    .expr33 <- .expr16 * .expr13 - .expr2 * .expr31
    .expr34 <- .expr15 * .expr33
    .expr35 <- u1/.expr1
    .expr37 <- 1/u2
    .expr39 <- .expr3 * .expr35
    .expr41 <- .expr37/.expr2 - .expr39/.expr23
    .expr42 <- .expr5 * .expr41
    .expr45 <- .expr27 * .expr42 - .expr21 * .expr42
    .expr46 <- .expr11 * .expr45
    .expr47 <- .expr19 * .expr46
    .expr49 <- .expr35 * .expr13 - .expr2 * .expr47
    .expr51 <- 1/.expr1
    .expr52 <- .expr1^2
    .expr54 <- .expr51 - .expr1/.expr52
    .expr56 <- .expr35 * .expr31
    .expr58 <- .expr16 * .expr47
    .expr59 <- .expr18 - 1
    .expr60 <- .expr9^.expr59
    .expr62 <- .expr60 * (.expr18 * .expr29)
    .expr64 <- .expr37 * .expr16
    .expr69 <- 2 * (.expr16 * .expr2)
    .expr71 <- .expr23^2
    .expr74 <- .expr64/.expr23 + (.expr3 * .expr54/.expr23 - 
        .expr39 * .expr69/.expr71)
    .expr75 <- .expr5 * .expr74
    .expr77 <- .expr20 - 1
    .expr78 <- .expr4^.expr77
    .expr79 <- .expr20 * .expr24
    .expr80 <- .expr78 * .expr79
    .expr83 <- .expr7^.expr77
    .expr84 <- .expr83 * .expr79
    .expr88 <- .expr27 * .expr75 + .expr80 * .expr42 + (.expr84 * 
        .expr42 - .expr21 * .expr75)
    .expr91 <- .expr62 * .expr46 - .expr19 * (.expr11 * .expr88)
    .expr99 <- .expr16 * .expr31
    .expr101 <- u2 * u2/.expr52
    .expr106 <- .expr3 * .expr101
    .expr111 <- .expr5 * (.expr106/.expr23 + .expr22 * .expr69/.expr71)
    .expr118 <- .expr11 * (.expr84 * .expr25 - .expr21 * .expr111 + 
        (.expr27 * .expr111 + .expr80 * .expr25))
    .expr120 <- .expr62 * .expr30 + .expr19 * .expr118
    .expr126 <- u2 * u1
    .expr128 <- .expr51 - .expr126/.expr52
    .expr131 <- .expr18 * .expr45
    .expr132 <- .expr60 * .expr131
    .expr135 <- .expr64 + .expr3 * .expr128
    .expr138 <- 2 * (.expr35 * .expr2)
    .expr139 <- .expr22 * .expr138
    .expr142 <- .expr5 * (.expr135/.expr23 - .expr139/.expr71)
    .expr144 <- .expr20 * .expr41
    .expr145 <- .expr83 * .expr144
    .expr148 <- .expr78 * .expr144
    .expr153 <- .expr11 * (.expr21 * .expr142 - .expr145 * .expr25 - 
        (.expr148 * .expr25 + .expr27 * .expr142))
    .expr155 <- .expr132 * .expr30 + .expr19 * .expr153
    .expr161 <- u2/.expr52
    .expr168 <- .expr161 + (.expr161 - .expr126 * (2 * (u2 * 
        .expr1))/.expr52^2)
    .expr214 <- .expr5 * ((.expr3 * .expr168 + .expr37 * .expr101)/.expr23 + 
        .expr135 * .expr69/.expr71 + ((.expr22 * (2 * (.expr54 * 
        .expr2 + .expr35 * .expr16)) - .expr106 * .expr138)/.expr71 - 
        .expr139 * (2 * (.expr69 * .expr23))/.expr71^2))
    .expr217 <- .expr77 - 1
    .expr219 <- .expr77 * .expr24
    .expr222 <- .expr20 * .expr74
    .value <- (.expr34 * .expr49 + .expr15 * (.expr54 * .expr13 - 
        .expr56 - (.expr58 + .expr2 * .expr91))) * .expr33 - 
        .expr15 * .expr49 * (.expr99 + .expr101 * .expr13 + (.expr99 + 
            .expr2 * .expr120)) + (.expr34 * (.expr128 * .expr13 - 
        .expr58 - (.expr56 + .expr2 * .expr155)) - .expr15 * 
        (.expr128 * .expr31 + .expr168 * .expr13 + (.expr16 * 
            .expr91 - .expr101 * .expr47) + (.expr54 * .expr31 + 
            .expr35 * .expr120 + (.expr16 * .expr155 + .expr2 * 
            ((.expr9^(.expr59 - 1) * (.expr59 * .expr29) * .expr131 - 
                .expr60 * (.expr18 * .expr88)) * .expr30 + .expr132 * 
                .expr118 + (.expr62 * .expr153 + .expr19 * (.expr11 * 
                (.expr84 * .expr142 - .expr21 * .expr214 - ((.expr7^.expr217 * 
                  .expr219 * .expr144 - .expr83 * .expr222) * 
                  .expr25 - .expr145 * .expr111) + (.expr27 * 
                  .expr214 + .expr80 * .expr142 + (.expr148 * 
                  .expr111 + (.expr78 * .expr222 + .expr4^.expr217 * 
                  .expr219 * .expr144) * .expr25))))))))))
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
})
`galambosCopula.pdfDerWrtPar.expr` <-
expression(0, -(exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * ((1/(u1 * 
    u2) - u2 * u1/(u1 * u2)^2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha) * (log(((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * 
    (1/alpha^2)) - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * 
    u2)))^(-alpha) * log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * 
    u2))^(-alpha) * log((log(u2)/log(u1 * u2)))))) + u2/(u1 * 
    u2) * ((((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^((-1/alpha) - 1) * (log(((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * 
    (1/alpha^2)) - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * (((-1/alpha) - 1) * 
    ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * log((1 - (log(u2)/log(u1 * 
        u2)))) + (log(u2)/log(u1 * u2))^(-alpha) * log((log(u2)/log(u1 * 
        u2)))))) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
    1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
    u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
    u2))/log(u1 * u2)^2)))) + ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 1) * 
    (1/alpha^2 * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
        (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
            u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
        1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
        u2))/log(u1 * u2)^2))) - (-1/alpha) * ((log(u2)/log(u1 * 
        u2))^((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
        (u1/(u1 * u2))/log(u1 * u2)^2) + (log(u2)/log(u1 * u2))^((-alpha) - 
        1) * log((log(u2)/log(u1 * u2))) * ((-alpha) * (1/u2/log(u1 * 
        u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) - ((1 - 
        (log(u2)/log(u1 * u2)))^((-alpha) - 1) * (1/u2/log(u1 * 
        u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2) + (1 - 
        (log(u2)/log(u1 * u2)))^((-alpha) - 1) * log((1 - (log(u2)/log(u1 * 
        u2)))) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
        u2))/log(u1 * u2)^2)))))) + (u1/(u1 * u2) * ((((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * (log(((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))) * (1/alpha^2)) - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 1) - 
    1) * (((-1/alpha) - 1) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * 
    log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * u2))^(-alpha) * 
    log((log(u2)/log(u1 * u2)))))) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * 
    u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
    u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
    (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))) + ((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * (1/alpha^2 * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
    (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2))) - (-1/alpha) * ((1 - 
    (log(u2)/log(u1 * u2)))^((-alpha) - 1) * (log(u2) * (u2/(u1 * 
    u2))/log(u1 * u2)^2) + (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * log((1 - (log(u2)/log(u1 * u2)))) * ((-alpha) * (log(u2) * 
    (u2/(u1 * u2))/log(u1 * u2)^2)) - ((log(u2)/log(u1 * u2))^((-alpha) - 
    1) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2) + (log(u2)/log(u1 * 
    u2))^((-alpha) - 1) * log((log(u2)/log(u1 * u2))) * ((-alpha) * 
    (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))))) + log(u1 * 
    u2) * (((((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * (log(((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * 
    (1/alpha^2)) - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^((((-1/alpha) - 1) - 1) - 1) * ((((-1/alpha) - 
    1) - 1) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * log((1 - 
    (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * u2))^(-alpha) * 
    log((log(u2)/log(u1 * u2)))))) * (((-1/alpha) - 1) * ((log(u2)/log(u1 * 
    u2))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
    (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
    u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
    (u1/(u1 * u2))/log(u1 * u2)^2)))) + ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 1) - 
    1) * (1/alpha^2 * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2))) - ((-1/alpha) - 1) * ((log(u2)/log(u1 * u2))^((-alpha) - 
    1) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
    u2)^2) + (log(u2)/log(u1 * u2))^((-alpha) - 1) * log((log(u2)/log(u1 * 
    u2))) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
    u2))/log(u1 * u2)^2)) - ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
    u2)^2) + (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * log((1 - 
    (log(u2)/log(u1 * u2)))) * ((-alpha) * (1/u2/log(u1 * u2) - 
    log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)))))) * ((-1/alpha) * 
    ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
        (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * 
        u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * 
        u2))/log(u1 * u2)^2)))) + ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 1) - 
    1) * (((-1/alpha) - 1) * ((log(u2)/log(u1 * u2))^((-alpha) - 
    1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
    u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
    1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
    u2))/log(u1 * u2)^2)))) * (1/alpha^2 * ((1 - (log(u2)/log(u1 * 
    u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
    u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
    (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2))) - (-1/alpha) * 
    ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2) + (1 - (log(u2)/log(u1 * 
        u2)))^((-alpha) - 1) * log((1 - (log(u2)/log(u1 * u2)))) * 
        ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
        ((log(u2)/log(u1 * u2))^((-alpha) - 1) * (log(u2) * (u2/(u1 * 
            u2))/log(u1 * u2)^2) + (log(u2)/log(u1 * u2))^((-alpha) - 
            1) * log((log(u2)/log(u1 * u2))) * ((-alpha) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2))))) + ((((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * (log(((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))) * (1/alpha^2)) - ((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(((-1/alpha) - 1) - 
    1) * (((-1/alpha) - 1) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * 
    log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * u2))^(-alpha) * 
    log((log(u2)/log(u1 * u2)))))) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * 
    u2)))^((-alpha) - 1) * ((-alpha) * ((1/u2 * (u2/(u1 * u2)) + 
    log(u2) * (1/(u1 * u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
    log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * u2) * log(u1 * 
        u2)))/(log(u1 * u2)^2)^2)) - (1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
    1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
    (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * (log(u2) * 
    (u2/(u1 * u2))/log(u1 * u2)^2)) - ((log(u2)/log(u1 * u2))^(((-alpha) - 
    1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
    (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * (log(u2) * 
    (u2/(u1 * u2))/log(u1 * u2)^2)) + (log(u2)/log(u1 * u2))^((-alpha) - 
    1) * ((-alpha) * ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
    u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - log(u2) * (u2/(u1 * 
    u2)) * (2 * (u1/(u1 * u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2))))) + 
    ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^((-1/alpha) - 1) * (1/alpha^2 * ((1 - 
        (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
        ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * u2) - u2 * 
            u1/(u1 * u2)^2))/log(u1 * u2)^2 - log(u2) * (u2/(u1 * 
            u2)) * (2 * (u1/(u1 * u2) * log(u1 * u2)))/(log(u1 * 
            u2)^2)^2)) - (1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
        1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
        (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * (log(u2) * 
        (u2/(u1 * u2))/log(u1 * u2)^2)) - ((log(u2)/log(u1 * 
        u2))^(((-alpha) - 1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * 
        u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
        (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) + (log(u2)/log(u1 * 
        u2))^((-alpha) - 1) * ((-alpha) * ((1/u2 * (u2/(u1 * 
        u2)) + log(u2) * (1/(u1 * u2) - u2 * u1/(u1 * u2)^2))/log(u1 * 
        u2)^2 - log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * u2) * 
        log(u1 * u2)))/(log(u1 * u2)^2)^2)))) - (-1/alpha) * 
        ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((1/u2 * 
            (u2/(u1 * u2)) + log(u2) * (1/(u1 * u2) - u2 * u1/(u1 * 
            u2)^2))/log(u1 * u2)^2 - log(u2) * (u2/(u1 * u2)) * 
            (2 * (u1/(u1 * u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2) + 
            (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * log((1 - 
                (log(u2)/log(u1 * u2)))) * ((-alpha) * ((1/u2 * 
                (u2/(u1 * u2)) + log(u2) * (1/(u1 * u2) - u2 * 
                u1/(u1 * u2)^2))/log(u1 * u2)^2 - log(u2) * (u2/(u1 * 
                u2)) * (2 * (u1/(u1 * u2) * log(u1 * u2)))/(log(u1 * 
                u2)^2)^2)) - ((1 - (log(u2)/log(u1 * u2)))^(((-alpha) - 
            1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * u2) - 
            log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2) + ((1 - (log(u2)/log(u1 * 
            u2)))^(((-alpha) - 1) - 1) * (1/u2/log(u1 * u2) - 
            log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2) + (1 - (log(u2)/log(u1 * 
            u2)))^(((-alpha) - 1) - 1) * log((1 - (log(u2)/log(u1 * 
            u2)))) * (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
            (u1/(u1 * u2))/log(u1 * u2)^2))) * ((-alpha) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2))) - ((log(u2)/log(u1 * 
            u2))^((-alpha) - 1) * ((1/u2 * (u2/(u1 * u2)) + log(u2) * 
            (1/(u1 * u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
            log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * u2) * log(u1 * 
                u2)))/(log(u1 * u2)^2)^2) + (log(u2)/log(u1 * 
            u2))^((-alpha) - 1) * log((log(u2)/log(u1 * u2))) * 
            ((-alpha) * ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * u2) * 
                  log(u1 * u2)))/(log(u1 * u2)^2)^2)) + ((log(u2)/log(u1 * 
            u2))^(((-alpha) - 1) - 1) * (((-alpha) - 1) * (1/u2/log(u1 * 
            u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) * 
            (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2) + ((log(u2)/log(u1 * 
            u2))^(((-alpha) - 1) - 1) * (1/u2/log(u1 * u2) - 
            log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2) + (log(u2)/log(u1 * 
            u2))^(((-alpha) - 1) - 1) * log((log(u2)/log(u1 * 
            u2))) * (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
            (u1/(u1 * u2))/log(u1 * u2)^2))) * ((-alpha) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2)))))))))) + exp(log(u1 * 
    u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha))) * (log(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha) * 
    (log(((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))) * (1/alpha^2)) - ((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * 
    log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * u2))^(-alpha) * 
    log((log(u2)/log(u1 * u2))))))) * ((1/(u1 * u2) - u2 * u1/(u1 * 
    u2)^2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
    u2)))^(-alpha))^(-1/alpha)) - u2/(u1 * u2) * (((log(u2)/log(u1 * 
    u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
    1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
    ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
        u2)^2))))) - (u1/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
    (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 1) * 
    ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * 
        ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
        (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * (log(u2) * 
            (u2/(u1 * u2))/log(u1 * u2)^2))))) + log(u1 * u2) * 
    (((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
        u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * (((-1/alpha) - 
        1) * ((log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
        (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * u2))/log(u1 * 
            u2)^2)) - (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
        1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
        u2))/log(u1 * u2)^2)))) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * 
        u2)))^((-alpha) - 1) * ((-alpha) * (log(u2) * (u2/(u1 * 
        u2))/log(u1 * u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
        1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)))) + 
        ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
            u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * 
            ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 1) * ((-alpha) * 
                ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                  u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                  log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * u2) * 
                    log(u1 * u2)))/(log(u1 * u2)^2)^2)) - (1 - 
                (log(u2)/log(u1 * u2)))^(((-alpha) - 1) - 1) * 
                (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                  (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                ((log(u2)/log(u1 * u2))^(((-alpha) - 1) - 1) * 
                  (((-alpha) - 1) * (1/u2/log(u1 * u2) - log(u2) * 
                    (u1/(u1 * u2))/log(u1 * u2)^2)) * ((-alpha) * 
                  (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) + 
                  (log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                    ((1/u2 * (u2/(u1 * u2)) + log(u2) * (1/(u1 * 
                      u2) - u2 * u1/(u1 * u2)^2))/log(u1 * u2)^2 - 
                      log(u2) * (u2/(u1 * u2)) * (2 * (u1/(u1 * 
                        u2) * log(u1 * u2)))/(log(u1 * u2)^2)^2)))))))) + 
    (exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
        (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * 
        (u1/(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
            (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
            log(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)))))) * 
        (u2/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - 
            (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha) * (log(((log(u2)/log(u1 * 
            u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * 
            (1/alpha^2)) - ((log(u2)/log(u1 * u2))^(-alpha) + 
            (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
            1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * 
            log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * 
            u2))^(-alpha) * log((log(u2)/log(u1 * u2)))))) + 
            log(u1 * u2) * ((((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * (log(((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * (1/alpha^2)) - 
                ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                  u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * (((-1/alpha) - 
                  1) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * 
                  log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * 
                  u2))^(-alpha) * log((log(u2)/log(u1 * u2)))))) * 
                ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                  1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                  u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                  1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                  u2)^2)))) + ((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * (1/alpha^2 * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2))) - (-1/alpha) * ((1 - (log(u2)/log(u1 * 
                u2)))^((-alpha) - 1) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2) + (1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * log((1 - (log(u2)/log(u1 * u2)))) * ((-alpha) * 
                (log(u2) * (u2/(u1 * u2))/log(u1 * u2)^2)) - 
                ((log(u2)/log(u1 * u2))^((-alpha) - 1) * (log(u2) * 
                  (u2/(u1 * u2))/log(u1 * u2)^2) + (log(u2)/log(u1 * 
                  u2))^((-alpha) - 1) * log((log(u2)/log(u1 * 
                  u2))) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                  u2)^2))))))) + (exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * 
        u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * 
        (u1/(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + (1 - 
            (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha) * (log(((log(u2)/log(u1 * 
            u2))^(-alpha) + (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * 
            (1/alpha^2)) - ((log(u2)/log(u1 * u2))^(-alpha) + 
            (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
            1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * 
            log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * 
            u2))^(-alpha) * log((log(u2)/log(u1 * u2)))))) + 
            log(u1 * u2) * ((((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * (log(((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))) * (1/alpha^2)) - 
                ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                  u2)))^(-alpha))^(((-1/alpha) - 1) - 1) * (((-1/alpha) - 
                  1) * ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * 
                  log((1 - (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * 
                  u2))^(-alpha) * log((log(u2)/log(u1 * u2)))))) * 
                ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                  1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                  (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                  u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                  u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)))) + 
                ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                  u2)))^(-alpha))^((-1/alpha) - 1) * (1/alpha^2 * 
                  ((log(u2)/log(u1 * u2))^((-alpha) - 1) * ((-alpha) * 
                    (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
                      u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                    u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                    u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2))) - 
                  (-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                    1) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
                    u2))/log(u1 * u2)^2) + (log(u2)/log(u1 * 
                    u2))^((-alpha) - 1) * log((log(u2)/log(u1 * 
                    u2))) * ((-alpha) * (1/u2/log(u1 * u2) - 
                    log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2)) - 
                    ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                      1) * (1/u2/log(u1 * u2) - log(u2) * (u1/(u1 * 
                      u2))/log(u1 * u2)^2) + (1 - (log(u2)/log(u1 * 
                      u2)))^((-alpha) - 1) * log((1 - (log(u2)/log(u1 * 
                      u2)))) * ((-alpha) * (1/u2/log(u1 * u2) - 
                      log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2))))))) + 
        exp(log(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
            (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha))) * 
            (log(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha) * 
                (log(((log(u2)/log(u1 * u2))^(-alpha) + (1 - 
                  (log(u2)/log(u1 * u2)))^(-alpha))) * (1/alpha^2)) - 
                ((log(u2)/log(u1 * u2))^(-alpha) + (1 - (log(u2)/log(u1 * 
                  u2)))^(-alpha))^((-1/alpha) - 1) * ((-1/alpha) * 
                  ((1 - (log(u2)/log(u1 * u2)))^(-alpha) * log((1 - 
                    (log(u2)/log(u1 * u2)))) + (log(u2)/log(u1 * 
                    u2))^(-alpha) * log((log(u2)/log(u1 * u2))))))) * 
            (u1/(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
                log(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
                  (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                  1) * ((-1/alpha) * ((log(u2)/log(u1 * u2))^((-alpha) - 
                  1) * ((-alpha) * (1/u2/log(u1 * u2) - log(u2) * 
                  (u1/(u1 * u2))/log(u1 * u2)^2)) - (1 - (log(u2)/log(u1 * 
                  u2)))^((-alpha) - 1) * ((-alpha) * (1/u2/log(u1 * 
                  u2) - log(u2) * (u1/(u1 * u2))/log(u1 * u2)^2))))))) * 
        (u2/(u1 * u2) * (1 - ((log(u2)/log(u1 * u2))^(-alpha) + 
            (1 - (log(u2)/log(u1 * u2)))^(-alpha))^(-1/alpha)) - 
            log(u1 * u2) * (((log(u2)/log(u1 * u2))^(-alpha) + 
                (1 - (log(u2)/log(u1 * u2)))^(-alpha))^((-1/alpha) - 
                1) * ((-1/alpha) * ((1 - (log(u2)/log(u1 * u2)))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2)) - (log(u2)/log(u1 * u2))^((-alpha) - 
                1) * ((-alpha) * (log(u2) * (u2/(u1 * u2))/log(u1 * 
                u2)^2)))))))))
`galambosCopula.pdfDerWrtPar.algr` <-
expression({
    .value <- 0
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
}, {
    .expr1 <- u1 * u2
    .expr2 <- log(.expr1)
    .expr3 <- log(u2)
    .expr4 <- .expr3/.expr2
    .expr5 <- -alpha
    .expr6 <- .expr4^.expr5
    .expr7 <- 1 - .expr4
    .expr8 <- .expr7^.expr5
    .expr9 <- .expr6 + .expr8
    .expr11 <- -1/alpha
    .expr12 <- .expr9^.expr11
    .expr13 <- 1 - .expr12
    .expr15 <- exp(.expr2 * .expr13)
    .expr20 <- 1/.expr1 - u2 * u1/.expr1^2
    .expr23 <- 1/alpha^2
    .expr24 <- log(.expr9) * .expr23
    .expr26 <- .expr11 - 1
    .expr27 <- .expr9^.expr26
    .expr28 <- log(.expr7)
    .expr30 <- log(.expr4)
    .expr32 <- .expr8 * .expr28 + .expr6 * .expr30
    .expr35 <- .expr12 * .expr24 - .expr27 * (.expr11 * .expr32)
    .expr37 <- u2/.expr1
    .expr39 <- .expr26 - 1
    .expr40 <- .expr9^.expr39
    .expr43 <- .expr27 * .expr24 - .expr40 * (.expr26 * .expr32)
    .expr44 <- .expr5 - 1
    .expr45 <- .expr4^.expr44
    .expr46 <- 1/u2
    .expr48 <- u1/.expr1
    .expr50 <- .expr2^2
    .expr52 <- .expr46/.expr2 - .expr3 * .expr48/.expr50
    .expr53 <- .expr5 * .expr52
    .expr55 <- .expr7^.expr44
    .expr57 <- .expr45 * .expr53 - .expr55 * .expr53
    .expr58 <- .expr11 * .expr57
    .expr60 <- .expr23 * .expr57
    .expr62 <- .expr45 * .expr30
    .expr66 <- .expr55 * .expr28
    .expr69 <- .expr45 * .expr52 + .expr62 * .expr53 - (.expr55 * 
        .expr52 + .expr66 * .expr53)
    .expr73 <- .expr43 * .expr58 + .expr27 * (.expr60 - .expr11 * 
        .expr69)
    .expr76 <- .expr3 * .expr37
    .expr77 <- .expr76/.expr50
    .expr78 <- .expr5 * .expr77
    .expr81 <- .expr55 * .expr78 - .expr45 * .expr78
    .expr82 <- .expr11 * .expr81
    .expr93 <- .expr23 * .expr81 - .expr11 * (.expr55 * .expr77 + 
        .expr66 * .expr78 - (.expr45 * .expr77 + .expr62 * .expr78))
    .expr95 <- .expr43 * .expr82 + .expr27 * .expr93
    .expr103 <- .expr26 * .expr57
    .expr110 <- .expr40 * .expr103
    .expr122 <- (.expr46 * .expr37 + .expr3 * .expr20)/.expr50 - 
        .expr76 * (2 * (.expr48 * .expr2))/.expr50^2
    .expr123 <- .expr5 * .expr122
    .expr125 <- .expr44 - 1
    .expr126 <- .expr7^.expr125
    .expr127 <- .expr44 * .expr52
    .expr128 <- .expr126 * .expr127
    .expr131 <- .expr4^.expr125
    .expr132 <- .expr131 * .expr127
    .expr136 <- .expr55 * .expr123 - .expr128 * .expr78 - (.expr132 * 
        .expr78 + .expr45 * .expr123)
    .expr137 <- .expr11 * .expr136
    .expr173 <- .expr15 * (.expr2 * .expr35)
    .expr175 <- .expr27 * .expr58
    .expr178 <- .expr27 * .expr82
    .expr190 <- .expr48 * .expr13 - .expr2 * .expr175
    .value <- -(.expr15 * (.expr20 * .expr35 + .expr37 * .expr73 + 
        (.expr48 * .expr95 + .expr2 * (((.expr40 * .expr24 - 
            .expr9^(.expr39 - 1) * (.expr39 * .expr32)) * .expr103 + 
            .expr40 * (.expr60 - .expr26 * .expr69)) * .expr82 + 
            .expr110 * .expr93 + (.expr43 * .expr137 + .expr27 * 
            (.expr23 * .expr136 - .expr11 * (.expr55 * .expr122 + 
                .expr66 * .expr123 - (.expr128 * .expr77 + (.expr126 * 
                .expr52 + .expr126 * .expr28 * .expr127) * .expr78) - 
                (.expr45 * .expr122 + .expr62 * .expr123 + (.expr132 * 
                  .expr77 + (.expr131 * .expr52 + .expr131 * 
                  .expr30 * .expr127) * .expr78)))))))) + .expr173 * 
        (.expr20 * .expr13 - .expr37 * .expr175 - (.expr48 * 
            .expr178 + .expr2 * (.expr110 * .expr82 + .expr27 * 
            .expr137))) + (.expr15 * .expr190 * (.expr37 * .expr35 + 
        .expr2 * .expr95) + (.expr15 * (.expr48 * .expr35 + .expr2 * 
        .expr73) + .expr173 * .expr190) * (.expr37 * .expr13 - 
        .expr2 * .expr178)))
    .grad <- array(0, c(length(.value), 1L), list(NULL, c("s")))
    .grad[, "s"] <- 0
    attr(.value, "gradient") <- .grad
    .value
})

Try the copula package in your browser

Any scripts or data that you put into this service are public.

copula documentation built on Sept. 11, 2024, 7:48 p.m.