Exercise 2.12 (a) Construct a table of px for Makeham’s law with parametersA = 0.0001, B = 0.00035 and c = 1.075, for integer x from age 0 to age130, using Excel or other appropriate computer software. You should setthe parameters so that they can be easily changed, and you should keep thetable, as many exercises and examples in future chapters will use it.(b) Use the table to determine the age last birthday at which a life currentlyaged 70 is most likely to die.(c) Use the table to calculate e70.(d) Using a numerical approach, calculate◦e70.#consider that: A=0.0001, B=0.00035, C=1.075##aA <- 0.0001B <- 0.00035C <- 1.075#the equation of px for Makeham's law can be written aspx <- function (x) { exp(-(A +(B/log(C))*C^x*(C-1))) }x <- 0:130p <- px(x)output <- cbind(x, round(p, 5))colnames(output) <- c("x", "px")print(output)##b#we generate various probabilities for different t.tp70 <- function(t) { exp(-(A*t +(B/log(C))*C^70*(C^t-1)))}tbarq70 <- function(t) {tp70(t)-tp70(t+1)}tp70(t)y <- 70:130t <- rev(130-y)q <- tbarq70(t)outputb <- cbind(y, t, round(q, 5))colnames(outputb) <- c("y", "t", "t|q70")print(outputb)##c#now we get the table of k_p_70 for k = 1 to 70tp70 <- function(t) {exp(-(A*t +(B/log(C))*C^70*(C^t-1)))}y <- 70:130t <- rev(130-y)p70 <- tp70(t)[-1]e70 <- sum(p70)e70##d#now we calculate e^0_70 by using numerical approachexc <- function(to1) { a=0 h=0.25 k=0 v1 = (h/3)*(tp70(a)+4*tp70(a+h)+tp70(a+2*h)) v = v1while (v1 > to1) { k = k+2 lim1 = a+k*h mid = a+(k+1)*h lim2 = a+(k+2)*h v2 = (h/3)*(tp70(lim1)+4*tp70(mid)+tp70(lim2)) z = v +v2 } + z}to1 <- 10^(-50)ec70 <- exc(to1)ec70I'm trying to calculate e^0_70 using numerical approach with R, but somehow my code for part d is not working. Can anyone please tell what wrong with my code? the answer should be 9.8341