To reduce code duplication I added a NewtonCotes class.
After the changes it is possible to compile only the first two steps, which could be helpful in situations where the integrand cannot be compiled.
Here are plots when benchmarking with CPU:
Everything uncompiled:
Tensorflow and JAX first step, third step and integrand separately compiled:
Tensorflow and JAX full integrate method compiled:
Torch and Numpy are uncompiled in all plots. I have not yet tested how much the times would change if only the first and third step and not the integrand are compiled with JAX and Tensorflow.
To reduce code duplication I added a NewtonCotes class. After the changes it is possible to compile only the first two steps, which could be helpful in situations where the integrand cannot be compiled.
Here are plots when benchmarking with CPU:
Everything uncompiled:
Tensorflow and JAX first step, third step and integrand separately compiled:
Tensorflow and JAX full integrate method compiled:
Torch and Numpy are uncompiled in all plots. I have not yet tested how much the times would change if only the first and third step and not the integrand are compiled with JAX and Tensorflow.