# Question:How to accelerate a nested numeric procedure if it cannot be compiled?

## Question:How to accelerate a nested numeric procedure if it cannot be compiled?

Maple 2023

Wolfram's marketing literature states that a compiled function may generate the dates for the years 1 through 5.7 million in a couple of seconds rather than in minutes (comparing to the "uncompiled implementation").
The given function in this link can be translated into Maple language as follows:

```(*
Note that this is only a mathematical program that outputs some data,
hence 'Easter(-2, 1)' will never return real Gregorian Easter dates!
*)
Easter:=proc(BEGIN::integer[4],END::integer[4],\$)::Array(BEGIN..END,[integer[1..12],integer[1..31]]);# the parent function
description "https://www.wolfram.com/language/12/code-compilation/compute-the-date-of-easter.html";
local computus::procedure[[integer[1 .. 12], integer[1 .. 31]]](integer):=proc(Year::integer,` \$`)::[integer[1..12],integer[1..31]];# the child function
options threadsafe;
local a::nonnegint,b::integer,c::nonnegint,d::integer,e::nonnegint,f::integer,g::nonnegint,h::nonnegint,i::nonnegint,j::nonnegint,k::nonnegint,Month::integer[1..12],Day::integer[1..31];
(* For compatibility, when `Year` is nonpositive, the command `iquo` must be replaced with slower `floor`. *)
if Year<=0 then
a,b,c:=Year mod 19,floor(Year/100),Year mod 100;
d,e,f:=floor(b/4),b mod 4,floor((8*b+13)/25);
g,h,i:=19*a+b-d-f+15 mod 30,floor(c/4),c mod 4;
j:=floor((a+11*g)/319);k:=2*e+2*h-i-g+j+32 mod 7;
Month:=floor((g-j+k+90)/25);Day:=g-j+k+Month+19 mod 32
else
a,b,c:=irem(Year,19),iquo(Year,100),irem(Year,100):
d,e,f:=iquo(b,4),irem(b,4),iquo(8*b+13,25);
g,h,i:=irem(19*a+b-d-f+15,30),iquo(c,4),irem(c,4);
j:=iquo(a+11*g,319);k:=irem(2*e+2*h-i-g+j+32,7);
Month:=iquo(g-j+k+90,25);Day:=irem(g-j+k+Month+19,32)
fi;
[Month,Day]
end;
Array(BEGIN..END,computus)
end:```

However, as "no nested procedures can be translated" to optimized native machine code (cf. compile procedure), executing `Easter(1, 5700000)` has to take at least two minutes

Is there some workaround that can provide improved performance for such a numerical procedure that contains a nested procedure? In other words, is it possible to produce the `result` (without modifying the algorithm) in two seconds in modern Maple as that Wolfram marketing literature claims?

﻿