Suppose I have the following Association:
f=<|"vanilla:veal" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3771.09 x^4 + 5369.78 x^5 + 6302.43 x^6 + 6703.86 x^7 +
6518.57 x^8 + 5440.72 x^9 + 4612.02 x^10 + 3457.49 x^11 +
2654.9 x^12 + 2100.02 x^13 + 1521.13 x^14 + 1076.02 x^15 +
755.953 x^16 + 480.615 x^17 + 261.089 x^18 + 204.306 x^19 +
110.874 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"leek:white_wine" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3772.08 x^4 + 5369.78 x^5 + 6306.37 x^6 + 6699.93 x^7 +
6523.46 x^8 + 5443.65 x^9 + 4606.18 x^10 + 3463.31 x^11 +
2651.02 x^12 + 2101.95 x^13 + 1520.17 x^14 + 1073.14 x^15 +
755.953 x^16 + 476.793 x^17 + 264.901 x^18 + 202.406 x^19 +
111.822 x^20 + 53.8665 x^21 + 29.2147 x^22 + 27.2539 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"orange:shiitake" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3771.09 x^4 + 5369.78 x^5 + 6302.43 x^6 + 6703.86 x^7 +
6518.57 x^8 + 5440.72 x^9 + 4612.02 x^10 + 3457.49 x^11 +
2655.86 x^12 + 2099.05 x^13 + 1521.13 x^14 + 1076.02 x^15 +
755.953 x^16 + 479.66 x^17 + 262.995 x^18 + 203.356 x^19 +
110.874 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"pepper:smoked_sausage" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3773.07 x^4 + 5370.77 x^5 + 6303.41 x^6 + 6708.77 x^7 +
6522.48 x^8 + 5432.91 x^9 + 4612.02 x^10 + 3461.37 x^11 +
2650.05 x^12 + 2100.02 x^13 + 1520.17 x^14 + 1075.06 x^15 +
754.037 x^16 + 481.571 x^17 + 262.042 x^18 + 203.356 x^19 +
109.927 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"carrot:celery" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3787.92 x^4 + 5375.7 x^5 + 6322.12 x^6 + 6740.18 x^7 +
6545.98 x^8 + 5464.16 x^9 + 4600.34 x^10 + 3451.66 x^11 +
2659.74 x^12 + 2084.56 x^13 + 1512.46 x^14 + 1049.12 x^15 +
733.916 x^16 + 467.238 x^17 + 254.419 x^18 + 199.555 x^19 +
107.084 x^20 + 47.2513 x^21 + 31.0995 x^22 + 23.4948 x^23 +
18.7435 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
0.926702 x^28 + 2.77225 x^29 + 1.84293 x^30 +
0.918848 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"cane_molasses:cumin" -> (353.073 x + 1137.02 x^2 + 2303.76 x^3 +
3769.12 x^4 + 5371.76 x^5 + 6304.4 x^6 + 6706.81 x^7 +
6518.57 x^8 + 5447.56 x^9 + 4618.84 x^10 + 3458.46 x^11 +
2655.86 x^12 + 2105.81 x^13 + 1514.39 x^14 + 1076.98 x^15 +
749.246 x^16 + 479.66 x^17 + 255.372 x^18 + 208.107 x^19 +
108.031 x^20 + 51.9764 x^21 + 24.5026 x^22 + 28.1937 x^23 +
18.7435 x^24 + 5.60733 x^25 + 2.79581 x^26 + 0.929319 x^27 +
2.7801 x^28 + 2.77225 x^29 + 1.8377 x^31)/(354 x + 1143 x^2 +
2320 x^3 + 3811 x^4 + 5441 x^5 + 6403 x^6 + 6829 x^7 +
6658 x^8 + 5571 x^9 + 4737 x^10 + 3560 x^11 + 2741 x^12 +
2174 x^13 + 1579 x^14 + 1120 x^15 + 789 x^16 + 502 x^17 +
275 x^18 + 215 x^19 + 117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 +
21 x^24 + 6 x^25 + 4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 +
2 x^31),
"lettuce:turnip" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3771.09 x^4 + 5369.78 x^5 + 6302.43 x^6 + 6703.86 x^7 +
6519.54 x^8 + 5438.77 x^9 + 4612.99 x^10 + 3457.49 x^11 +
2654.9 x^12 + 2100.02 x^13 + 1521.13 x^14 + 1076.02 x^15 +
755.953 x^16 + 479.66 x^17 + 262.042 x^18 + 204.306 x^19 +
110.874 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"corn_grit:pork_sausage" -> (353.073 x + 1137.02 x^2 + 2302.77 x^3 +
3771.09 x^4 + 5371.76 x^5 + 6301.45 x^6 + 6701.9 x^7 +
6519.54 x^8 + 5439.75 x^9 + 4612.99 x^10 + 3457.49 x^11 +
2654.9 x^12 + 2100.98 x^13 + 1519.2 x^14 + 1076.02 x^15 +
755.953 x^16 + 479.66 x^17 + 262.042 x^18 + 204.306 x^19 +
110.874 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
2.7801 x^28 + 1.84817 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"avocado:pumpkin" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3771.09 x^4 + 5369.78 x^5 + 6303.41 x^6 + 6702.88 x^7 +
6518.57 x^8 + 5440.72 x^9 + 4612.02 x^10 + 3457.49 x^11 +
2654.9 x^12 + 2100.02 x^13 + 1521.13 x^14 + 1076.02 x^15 +
755.953 x^16 + 479.66 x^17 + 262.042 x^18 + 204.306 x^19 +
110.874 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"chive:mandarin_peel" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3771.09 x^4 + 5369.78 x^5 + 6302.43 x^6 + 6704.84 x^7 +
6517.59 x^8 + 5439.75 x^9 + 4612.99 x^10 + 3457.49 x^11 +
2654.9 x^12 + 2100.02 x^13 + 1521.13 x^14 + 1076.02 x^15 +
755.953 x^16 + 479.66 x^17 + 262.042 x^18 + 204.306 x^19 +
110.874 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31),
"anise_seed:coconut" -> (353.073 x + 1137.02 x^2 + 2301.78 x^3 +
3771.09 x^4 + 5369.78 x^5 + 6302.43 x^6 + 6703.86 x^7 +
6518.57 x^8 + 5439.75 x^9 + 4612.99 x^10 + 3457.49 x^11 +
2654.9 x^12 + 2100.98 x^13 + 1521.13 x^14 + 1075.06 x^15 +
755.953 x^16 + 479.66 x^17 + 262.042 x^18 + 204.306 x^19 +
110.874 x^20 + 55.7565 x^21 + 28.2723 x^22 + 28.1937 x^23 +
19.6806 x^24 + 5.60733 x^25 + 3.72775 x^26 + 0.929319 x^27 +
1.8534 x^28 + 2.77225 x^29 + 0.921466 x^30 +
1.8377 x^31)/(354 x + 1143 x^2 + 2320 x^3 + 3811 x^4 +
5441 x^5 + 6403 x^6 + 6829 x^7 + 6658 x^8 + 5571 x^9 +
4737 x^10 + 3560 x^11 + 2741 x^12 + 2174 x^13 + 1579 x^14 +
1120 x^15 + 789 x^16 + 502 x^17 + 275 x^18 + 215 x^19 +
117 x^20 + 59 x^21 + 30 x^22 + 30 x^23 + 21 x^24 + 6 x^25 +
4 x^26 + x^27 + 2 x^28 + 3 x^29 + x^30 + 2 x^31)|>
which contains rational functions. I want to select the ones that have y value above 1 for a specific range of x, so I do:
Select[f, MaxValue[{#, 2/382 <= x <= 1}, x] > 1 &] // AbsoluteTiming
in this case none of them are, so I get:
{1.80393, <||>}
The point is that my original list contains 30000 of these polynomials and the command I have for selection is taking a lot of time. For 10 of them as above it took 1.8 seconds. I wonder how can I break this time down without losing the dictionary, namely what key is related to what polynomial?
I know if I only look at values the time would be reduced, but then I will not know the output would belong to which key from the association.
ParallelTable
, that would take less than 12 minutes. Is that too long? $\endgroup$