Question: Why is this worksheet not performing as well in Maple 2022 as it did in Maple 2020?

Here is a Maple 2020 worksheet that ran fine on Maple 2020, but runs slower on Maple 2022, especially when plots[display] is used it seems to take much longer?

with(NumberTheory);
with(plots);
NULL;
NULL;
theta := [14.134725, 21.022039, 25.010858, 30.424876, 32.935062, 37.586178, 40.918719, 43.327073, 48.00515, 49.773832, 52.970321, 56.446248, 59.347044, 60.831779, 65.112544, 67.079811, 69.546402, 72.067158, 75.704691, 77.144840, 79.337375, 82.91038, 84.735493, 87.425273, 88.809111, 92.491899, 94.651344, 95.870634, 98.831194];
theta := [14.134725, 21.022039, 25.010858, 30.424876, 32.935062, 

  37.586178, 40.918719, 43.327073, 48.00515, 49.773832, 

  52.970321, 56.446248, 59.347044, 60.831779, 65.112544, 

  67.079811, 69.546402, 72.067158, 75.704691, 77.144840, 

  79.337375, 82.91038, 84.735493, 87.425273, 88.809111, 

  92.491899, 94.651344, 95.870634, 98.831194]

y[1] := x -> -2*sqrt(x)*cos(theta[1]*ln(x) - argument(0.5 + theta[1]*I))/(abs(0.5 + theta[1]*I)*ln(x));
y[1] := proc (x) options operator, arrow; -2*sqrt(x)*cos(theta[1\

  ]*ln(x)-argument(.5+I*theta[1]))/(abs(.5+I*theta[1])*ln(x)) 

   end proc

plot(y[1](x), x = 20 .. 100, title = 'Fig1*(S &G theta) = 1/2 + 14.134725*i');

y[2] := x -> -2*sqrt(x)*cos(theta[2]*ln(x) - argument(0.5 + theta[2]*I))/(abs(0.5 + theta[2]*I)*ln(x));
y[2] := proc (x) options operator, arrow; -2*sqrt(x)*cos(theta[2\

  ]*ln(x)-argument(.5+I*theta[2]))/(abs(.5+I*theta[2])*ln(x)) 

   end proc

plot(y[2](x), x = 20 .. 100, title = 'Fig1*(S &G theta) = 1/2 + 21.022040*i');

y[3] := x -> -2*sqrt(x)*cos(theta[3]*ln(x) - argument(0.5 + theta[3]*I))/(abs(0.5 + theta[3]*I)*ln(x));
y[3] := proc (x) options operator, arrow; -2*sqrt(x)*cos(theta[3\

  ]*ln(x)-argument(.5+I*theta[3]))/(abs(.5+I*theta[3])*ln(x)) 

   end proc

plot(y[3](x), x = 20 .. 100, title = 'Fig1*(S &G theta) = 1/2 + 25.00858*i');

y[4] := x -> -2*sqrt(x)*cos(theta[4]*ln(x) - argument(0.5 + theta[4]*I))/(abs(0.5 + theta[4]*I)*ln(x));
y[4] := proc (x) options operator, arrow; -2*sqrt(x)*cos(theta[4\

  ]*ln(x)-argument(.5+I*theta[4]))/(abs(.5+I*theta[4])*ln(x)) 

   end proc

plot(y[4](x), x = 20 .. 100, title = 'Fig1*(S &G theta) = 1/2 + 30.424876*i');

y[5] := x -> -2*sqrt(x)*cos(theta[5]*ln(x) - argument(0.5 + theta[5]*I))/(abs(0.5 + theta[5]*I)*ln(x));
y[5] := proc (x) options operator, arrow; -2*sqrt(x)*cos(theta[5\

  ]*ln(x)-argument(.5+I*theta[5]))/(abs(.5+I*theta[5])*ln(x)) 

   end proc

plot(y[5](x), x = 20 .. 100, title = 'Fig1*(S &G theta) = 1/2 + 32.93502*i');

T[1] := x -> -2*sum(Moebius(n)*Re(Ei((0.5 + theta[1]*I)*ln(x)))/n, n = 1 .. trunc(ln(100)/ln(2)) + 1);
T[1] := proc (x) options operator, arrow; -2*(sum(NumberTheory:-\

  Moebius(n)*Re(Ei((.5+I*theta[1])*ln(x)))/n, n = 1 .. 

   trunc(ln(100)/ln(2))+1)) end proc

plot(T[1](x), x = 20 .. 100, title = 'T[1]');

T[2] := x -> -2*sum(Moebius(n)*Re(Ei((0.5 + theta[2]*I)*ln(x)))/n, n = 1 .. trunc(ln(100)/ln(2)) + 1);
T[2] := proc (x) options operator, arrow; -2*(sum(NumberTheory:-\

  Moebius(n)*Re(Ei((.5+I*theta[2])*ln(x)))/n, n = 1 .. 

   trunc(ln(100)/ln(2))+1)) end proc

plot(T[2](x), x = 20 .. 100, title = 'T[2]');

T[3] := x -> -2*sum(Moebius(n)*Re(Ei((0.5 + theta[3]*I)*ln(x)))/n, n = 1 .. trunc(ln(100)/ln(2)) + 1);
T[3] := proc (x) options operator, arrow; -2*(sum(NumberTheory:-\

  Moebius(n)*Re(Ei((.5+I*theta[3])*ln(x)))/n, n = 1 .. 

   trunc(ln(100)/ln(2))+1)) end proc

plot(T[3](x), x = 20 .. 100, title = 'T[3]');

T[4] := x -> -2*sum(Moebius(n)*Re(Ei((0.5 + theta[3]*I)*ln(x)))/n, n = 1 .. trunc(ln(100)/ln(2)) + 1);
T[4] := proc (x) options operator, arrow; -2*(sum(NumberTheory:-\

  Moebius(n)*Re(Ei((.5+I*theta[3])*ln(x)))/n, n = 1 .. 

   trunc(ln(100)/ln(2))+1)) end proc

plot(T[4](x), x = 20 .. 100, title = 'T[4]');

T[5] := x -> -2*sum(Moebius(n)*Re(Ei((0.5 + theta[5]*I)*ln(x)))/n, n = 1 .. trunc(ln(100)/ln(2)) + 1);
T[5] := proc (x) options operator, arrow; -2*(sum(NumberTheory:-\

  Moebius(n)*Re(Ei((.5+I*theta[5])*ln(x)))/n, n = 1 .. 

   trunc(ln(100)/ln(2))+1)) end proc

plot(T[5](x), x = 20 .. 100, title = 'T[5]');

f10 := x -> Li(x) - 2*sum(Re(Ei((1/2 + theta[n]*I)*ln(x))), n = 1 .. 10) - ln(2) + int(1/(t*(t^2 - 1)*ln(t)), t = x .. infinity);
f10 := proc (x) options operator, arrow; Li(x)-2*(sum(Re(Ei((1/2\

  +I*theta[n])*ln(x))), n = 1 .. 10))-ln(2)+int(1/(t*(t^2-1)*ln(\

  t)), t = x .. infinity) end proc

R10 := x -> sum(Moebius(l)*f10(x^(1/l))/l, l = 1 .. 8);
R10 := proc (x) options operator, arrow; sum(NumberTheory:-Moebi\

  us(l)*f10(x^(1/l))/l, l = 1 .. 8) end proc

plot1 := plot(R10(x), x = 2 .. 100);

plot2 := plot(pi(x), x = 2 .. 100);

display([plot1, plot2]);

f29 := x -> Li(x) - 2*sum(Re(Ei((1/2 + theta[n]*I)*ln(x))), n = 1 .. 29) - ln(2) + int(1/(t*(t^2 - 1)*ln(t)), t = x .. infinity);
f29 := proc (x) options operator, arrow; Li(x)-2*(sum(Re(Ei((1/2\

  +I*theta[n])*ln(x))), n = 1 .. 29))-ln(2)+int(1/(t*(t^2-1)*ln(\

  t)), t = x .. infinity) end proc

R29 := x -> sum(Moebius(l)*f29(x^(1/l))/l, l = 1 .. 8);
R29 := proc (x) options operator, arrow; sum(NumberTheory:-Moebi\

  us(l)*f29(x^(1/l))/l, l = 1 .. 8) end proc

plot3 := plot(R29(x), x = 2 .. 100);

NULL;
display([plot1, plot2, plot3]);

R29(100);
R10(100);
pi(100);
                          25.25165721

                          25.28503922

                               25

RR10 := x -> sum(Moebius(l)*f10(x^(1/l))/l, l = 1 .. trunc(ln(1000)/ln(2)) + 1);
RR10 := proc (x) options operator, arrow; sum(NumberTheory:-Moeb\

  ius(l)*f10(x^(1/l))/l, l = 1 .. trunc(ln(1000)/ln(2))+1) end 

   proc

RR10(1000);
pi(1000);
                          168.1328341

                              168

RR29 := x -> sum(Moebius(l)*f29(x^(1/l))/l, l = 1 .. trunc(ln(1000)/ln(2)) + 1);
RR29 := proc (x) options operator, arrow; sum(NumberTheory:-Moeb\

  ius(l)*f29(x^(1/l))/l, l = 1 .. trunc(ln(1000)/ln(2))+1) end 

   proc

RR29(1000);
                          167.6113955

P1 := plot(RR29(x), x = 880 .. 930);

P2 := plot(pi(x), x = 880 .. 930);

display([P1, P2]);

f0 := x -> Li(x) - ln(2) + int(1/(t*(t^2 + 1)*ln(t)), t = x .. infinity);
f0 := proc (x) options operator, arrow; Li(x)-ln(2)+int(1/(t*(t^\

  2+1)*ln(t)), t = x .. infinity) end proc

RR0 := x -> sum(Moebius(l)*f0(x^(1/l))/l, l = 1 .. trunc(ln(1000)/ln(2)) + 1);
RR0 := proc (x) options operator, arrow; sum(NumberTheory:-Moebi\

  us(l)*f0(x^(1/l))/l, l = 1 .. trunc(ln(1000)/ln(2))+1) end proc

P3 := plot(RR0(x), x = 880 .. 930);

NULL;
display([P1, P2, P3]);

P4 := plot(RR10(x), x = 880 .. 930);

display([P1, P2, P3, P4], color = [green, blue, purple, yellow]);

evalf(Li(2)), evalf(ln(2));
                   1.045163780, 0.6931471806

evalf(li(2));
                             li(2)

evalf(Ei(2));
                          4.954234356

evalf(Int(1/ln(t), t = 0 .. 2));
                        Float(undefined)

evalf(Ei(ln(2)));
                          1.045163780

Li(1000.);
                          177.6096580

isprime, [$ (1 .. 100)];
isprime, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 

  17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 

  33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 

  49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 

  65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 

  81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 

  97, 98, 99, 100]

nops(select(isprime, [$ (1 .. 100)]));
                               25

theta[1];
                           14.134725

evalf(Ei((1/2 + theta[1]*I)*ln(x)));
             Ei((0.5000000000 + 14.134725 I) ln(x))

evalf(Ei(ln(1/2 + theta[1]*I)));
                  4.386989035 + 6.632175089 I

plot(Li(x), x = 0 .. 5);

Please Wait...