This report gives the result of running the computer algebra independent integration problems.
The listing of the problems used by this report are
The above zip files are maintained by and were downloaded from Albert Rich Rubi web site.
The current number of problems in this test suite is [28425].
The following systems were tested at this time.
Maxima, Fricas and Giac/Xcas were called from inside SageMath version 8.3. This was done using SageMath integrate command by changing the name of the algorithm to use the different CAS systems.
Sympy was called directly using Python. Rubi in Sympy was also called directly using sympy 1.3 in python.
The following diagram gives a high level view of the current test build system.
The command AboluteTiming[] was used in Mathematica to obtain the elapsed time for each integrate call. In Maple, the command Usage was used as in the following example
For all other CAS systems, the elapsed time to complete each integral was found by taking the difference between the time after the call has completed from the time before the call was made. This was done using Python’s time.time() call.
All elapsed times shown are in seconds. A time limit of 3 minutes was used for each integral. If the integrate command did not complete within this time limit, the integral was aborted and considered to have failed and assigned an F grade. The time used by failed integrals due to time out is not counted in the final statistics.
A verification phase was applied on the result of integration for Rubi and Mathematica. Future version of this report will implement verification for the other CAS systems. For the integrals whose result was not run through a verification phase, it is assumed that the antiderivative produced was correct.
Verification phase has 3 minutes time out. An integral whose result was not verified could still be correct. Further investigation is needed on those integrals which failed verifications. Such integrals are marked in the summary table below and also in each integral separate section so they are easy to identify and locate.
Important note about Maxima results Since these integrals are run in a batch mode, using an automated script, and by using sagemath (SageMath uses Maxima), then any integral where Maxima needs an interactive response from the user to answer a question during evaluation of the integral in order to complete the integration, will fail and is counted as failed.
The exception raised is ValueError. Therefore Maxima result below is lower than what could result if Maxima was run directly and each question Maxima asks was answered correctly.
The percentage of such failures were not counted for each test file, but for an example, for the Timofeev test file, there were about 30 such integrals out of total 705, or about 4 percent. This pecrentage can be higher or lower depending on the specific input test file.
Such integrals can be indentified by looking at the output of the integration in each section for Maxima. If the output was an exception ValueError then this is most likely due to this reason.
Maxima integrate was run using SageMath with the following settings set by default
SageMath loading of Maxima abs_integrate was found to cause some problem. So the following code was added to disable this effect.
See https://ask.sagemath.org/question/43088/integrate-results-that-are-different-from-using-maxima/ for reference.
Important note about FriCAS and Giac/XCAS results There are Few integrals which failed due to SageMath not able to translate the result back to SageMath syntax and not because these CAS system were not able to do the integrations.
These will fail With error Exception raised: NotImplementedError
The number of such cases seems to be very small. About 1 or 2 percent of all integrals.
Hopefully the next version of SageMath will have complete translation of FriCAS and XCAS syntax and I will re-run all the tests again when this happens.
Important note about finding leaf size of antiderivative For Mathematica, Rubi and Maple, the buildin system function LeafSize is used to find the leaf size of each antiderivative.
The other CAS systems (SageMath and Sympy) do not have special buildin function for this purpose at this time. Therefore the leaf size is determined as follows.
For Fricas, Giac and Maxima (all called via sagemath) the following code is used
For Sympy, called directly from Python, the following code is used
When these cas systems implement a buildin function to find the leaf size of expressions, it will be used instead, and these tests run again.
The table below summarizes the grading of each CAS system.
Important note: A number of problems in this test suite have no antiderivative in closed form. This means the antiderivative of these integrals can not be expressed in terms of elementary, special functions or Hypergeometric2F1 functions. RootSum and RootOf are not allowed.
If a CAS returns the above integral unevaluated within the time limit, then the result is counted as passed and assigned an A grade.
However, if CAS times out, then it is assigned an F grade even if the integral is not integrable, as this implies CAS could not determine that the integral is not integrable in the time limit.
If a CAS returns an antiderivative to such an integral, it is assigned an A grade automatically and this special result is listed in the introduction section of each individual test report to make it easy to identify as this can be important result to investigate.
The results given in in the table below reflects the above.
System | solved | Failed |
Rubi | % 99.87 ( 28387 ) | % 0.13 ( 38 ) |
Rubi in Sympy | % 81.49 ( 23163 ) | % 18.51 ( 5262 ) |
Mathematica | % 98.42 ( 27975 ) | % 1.58 ( 450 ) |
Maple | % 86.91 ( 24705 ) | % 13.09 ( 3720 ) |
Maxima | % 45.79 ( 13016 ) | % 54.21 ( 15409 ) |
Fricas | % 75.79 ( 21544 ) | % 24.21 ( 6881 ) |
Sympy | % 49.64 ( 14111 ) | % 50.36 ( 14314 ) |
Giac | % 64.62 ( 18368 ) | % 35.38 ( 10057 ) |
The table below gives additional break down of the grading of quality of the antiderivatives generated by each CAS. The grading is given using the letters A,B,C and F with A being the best quality. The grading is accomplished by comparing the antiderivative generated with the optimal antiderivatives included in the test suite. The following table describes the meaning of these grades.
grade |
description |
A |
Integral was solved and antiderivative is optimal in quality and leaf size. |
B |
Integral was solved and antiderivative is optimal in quality but leaf size is larger than twice the optimal antiderivatives leaf size. |
C |
Integral was solved and antiderivative is non-optimal in quality. This can be due to one or more of the following reasons
|
F |
Integral was not solved. Either the integral was returned unevaluated within the time limit, or it timed out, or CAS hanged or crashed or an exception was raised. |
Currently grading is implemented only for Mathematica, Rubi and Maple. For other CAS systems (Maxima, Fricas, Sympy, Giac), the grading function is not yet implemented. For these systems, a grade of A is assigned if the integrate command completes successfully and a grade of F otherwise.
Based on the above, the following table summarizes the grading for this test suite.
System | % A grade | % B grade | % C grade | % F grade |
Rubi | 99.65 | 0.14 | 0.08 | 0.13 |
Rubi in Sympy | 81.49 | 0. | 0. | 18.51 |
Mathematica | 79.28 | 4.9 | 15.8 | 1.58 |
Maple | 59.88 | 19.95 | 7.09 | 13.09 |
Maxima | 45.79 | 0. | 0. | 54.21 |
Fricas | 75.79 | 0. | 0. | 24.21 |
Sympy | 49.64 | 0. | 0. | 50.36 |
Giac | 64.62 | 0. | 0. | 35.38 |
The following is a Bar chart illustration of the data in the above table.
The Mathematica code used to generate the above figure is contained in this small notebook make_3d_barchart.nb
The figure below compares the CAS systems for each grade level.
The table below summarizes the performance of each CAS system in terms of time used and leaf size of results.
System | Mean time (sec) | Mean size | Normalized mean | Median size | Normalized median |
Rubi | 0.44 | 147.72 | 1. | 97. | 1. |
Rubi in Sympy | 31.17 | 116.78 | 0.9 | 82. | 0.9 |
Mathematica | 0.56 | 229.36 | 1.3 | 85. | 0.94 |
Maple | 0.03 | 958.29 | 4.7 | 94. | 1.05 |
Maxima | 1.19 | 147.14 | 1.83 | 72. | 1.23 |
Fricas | 0.89 | 278.54 | 1.86 | 58. | 1.21 |
Sympy | 12.07 | 244.15 | 2.65 | 70. | 1.07 |
Giac | 0.46 | 157.6 | 1.66 | 89. | 1.29 |
The following table gives the largest ratio found in each test file, between each CAS antiderivative and the optimal antiderivative.
For each test input file, the problem with the largest ratio \(\frac{\text{CAS leaf size}}{\text{Optimal leaf size}}\) is recorded with the corresponding problem number.
In each column in the table below, the first number is the maximum leaf size ratio, and the number that follows inside the parentheses is the problem number in that specific file where this maximum ratio was found. This ratio is determined only when CAS solved the the problem and also when an optimal antiderivative is known.
If it happens that a CAS was not able to solve all the integrals in the input test file, or if it was not possible to obtain leaf size for the CAS result for all the problems in the file, then a zero is used for the ratio and -1 is used for the problem number.
This makes it easy to locate the problem. In the future, a direct link will be added as well.