-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GSoC 1.1]Fixes for _eval_nseries of Abs class #26349
base: master
Are you sure you want to change the base?
Conversation
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.14. Click here to see the pull request description that was parsed.
|
ping @anutosh491 for reviews. |
Signed-off-by: arnabnandikgp <arnabnandi2002@gmail.com>
b1ce22c
to
5df394f
Compare
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) | Change | Before [a00718ba] | After [226096b8] | Ratio | Benchmark (Parameter) |
|----------|----------------------|---------------------|---------|----------------------------------------------------------------------|
| - | 67.4±0.6ms | 44.0±0.3ms | 0.65 | integrate.TimeIntegrationRisch02.time_doit(10) |
| - | 67.0±0.9ms | 42.9±0.1ms | 0.64 | integrate.TimeIntegrationRisch02.time_doit_risch(10) |
| + | 18.6±0.09μs | 29.6±0.3μs | 1.59 | integrate.TimeIntegrationRisch03.time_doit(1) |
| - | 5.35±0.06ms | 2.84±0.01ms | 0.53 | logic.LogicSuite.time_load_file |
| - | 73.1±0.4ms | 28.5±0.07ms | 0.39 | polys.TimeGCD_GaussInt.time_op(1, 'dense') |
| - | 25.4±0.07ms | 16.7±0.07ms | 0.66 | polys.TimeGCD_GaussInt.time_op(1, 'expr') |
| - | 72.7±0.6ms | 28.6±0.3ms | 0.39 | polys.TimeGCD_GaussInt.time_op(1, 'sparse') |
| - | 252±1ms | 124±0.8ms | 0.49 | polys.TimeGCD_GaussInt.time_op(2, 'dense') |
| - | 252±2ms | 125±0.9ms | 0.49 | polys.TimeGCD_GaussInt.time_op(2, 'sparse') |
| - | 649±3ms | 371±2ms | 0.57 | polys.TimeGCD_GaussInt.time_op(3, 'dense') |
| - | 655±3ms | 369±2ms | 0.56 | polys.TimeGCD_GaussInt.time_op(3, 'sparse') |
| - | 494±1μs | 284±2μs | 0.57 | polys.TimeGCD_LinearDenseQuadraticGCD.time_op(1, 'dense') |
| - | 1.81±0.01ms | 1.07±0ms | 0.59 | polys.TimeGCD_LinearDenseQuadraticGCD.time_op(2, 'dense') |
| - | 5.77±0.02ms | 3.06±0.02ms | 0.53 | polys.TimeGCD_LinearDenseQuadraticGCD.time_op(3, 'dense') |
| - | 446±1μs | 230±2μs | 0.52 | polys.TimeGCD_QuadraticNonMonicGCD.time_op(1, 'dense') |
| - | 1.45±0.01ms | 678±7μs | 0.47 | polys.TimeGCD_QuadraticNonMonicGCD.time_op(2, 'dense') |
| - | 4.80±0.04ms | 1.65±0.01ms | 0.34 | polys.TimeGCD_QuadraticNonMonicGCD.time_op(3, 'dense') |
| - | 372±2μs | 209±2μs | 0.56 | polys.TimeGCD_SparseGCDHighDegree.time_op(1, 'dense') |
| - | 2.41±0.02ms | 1.22±0.01ms | 0.5 | polys.TimeGCD_SparseGCDHighDegree.time_op(3, 'dense') |
| - | 10.1±0.07ms | 4.36±0.01ms | 0.43 | polys.TimeGCD_SparseGCDHighDegree.time_op(5, 'dense') |
| - | 357±2μs | 168±0.6μs | 0.47 | polys.TimeGCD_SparseNonMonicQuadratic.time_op(1, 'dense') |
| - | 2.46±0.02ms | 899±9μs | 0.37 | polys.TimeGCD_SparseNonMonicQuadratic.time_op(3, 'dense') |
| - | 9.63±0.08ms | 2.69±0.01ms | 0.28 | polys.TimeGCD_SparseNonMonicQuadratic.time_op(5, 'dense') |
| - | 1.03±0.01ms | 432±3μs | 0.42 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(3, 'dense') |
| - | 1.73±0.1ms | 502±0.8μs | 0.29 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(3, 'sparse') |
| - | 5.91±0.03ms | 1.79±0.02ms | 0.3 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(5, 'dense') |
| - | 8.47±0.1ms | 1.49±0.01ms | 0.18 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(5, 'sparse') |
| - | 285±0.5μs | 64.2±0.3μs | 0.23 | polys.TimePREM_QuadraticNonMonicGCD.time_op(1, 'sparse') |
| - | 3.39±0.04ms | 396±3μs | 0.12 | polys.TimePREM_QuadraticNonMonicGCD.time_op(3, 'dense') |
| - | 3.98±0.03ms | 280±1μs | 0.07 | polys.TimePREM_QuadraticNonMonicGCD.time_op(3, 'sparse') |
| - | 6.96±0.05ms | 1.28±0ms | 0.18 | polys.TimePREM_QuadraticNonMonicGCD.time_op(5, 'dense') |
| - | 8.70±0.06ms | 824±2μs | 0.09 | polys.TimePREM_QuadraticNonMonicGCD.time_op(5, 'sparse') |
| - | 5.06±0.02ms | 2.98±0.01ms | 0.59 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(2, 'sparse') |
| - | 12.2±0.06ms | 6.60±0.02ms | 0.54 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(3, 'dense') |
| - | 22.3±0.05ms | 8.98±0.03ms | 0.4 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(3, 'sparse') |
| - | 5.24±0.03ms | 864±3μs | 0.16 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(1, 'sparse') |
| - | 12.6±0.09ms | 7.05±0.02ms | 0.56 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(2, 'sparse') |
| - | 102±0.6ms | 25.9±0.1ms | 0.25 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(3, 'dense') |
| - | 166±0.8ms | 53.5±0.2ms | 0.32 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(3, 'sparse') |
| - | 173±2μs | 113±0.7μs | 0.65 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(1, 'dense') |
| - | 362±2μs | 216±0.8μs | 0.6 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(1, 'sparse') |
| - | 4.25±0.02ms | 842±4μs | 0.2 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(3, 'dense') |
| - | 5.30±0.04ms | 382±2μs | 0.07 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(3, 'sparse') |
| - | 20.2±0.2ms | 2.80±0.01ms | 0.14 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(5, 'dense') |
| - | 22.9±0.2ms | 625±2μs | 0.03 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(5, 'sparse') |
| - | 478±2μs | 138±1μs | 0.29 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(1, 'sparse') |
| - | 4.65±0.02ms | 625±4μs | 0.13 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(3, 'dense') |
| - | 5.23±0.03ms | 140±3μs | 0.03 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(3, 'sparse') |
| - | 13.1±0.07ms | 1.28±0.01ms | 0.1 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(5, 'dense') |
| - | 13.8±0.1ms | 142±0.5μs | 0.01 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(5, 'sparse') |
| - | 133±0.8μs | 74.3±1μs | 0.56 | solve.TimeMatrixOperations.time_rref(3, 0) |
| - | 251±0.8μs | 87.5±0.4μs | 0.35 | solve.TimeMatrixOperations.time_rref(4, 0) |
| - | 23.9±0.05ms | 10.2±0.05ms | 0.43 | solve.TimeSolveLinSys189x49.time_solve_lin_sys |
| - | 28.2±0.2ms | 15.5±0.1ms | 0.55 | solve.TimeSparseSystem.time_linsolve_Aaug(20) |
| - | 54.6±0.6ms | 24.9±0.09ms | 0.46 | solve.TimeSparseSystem.time_linsolve_Aaug(30) |
| - | 28.1±0.3ms | 15.2±0.05ms | 0.54 | solve.TimeSparseSystem.time_linsolve_Ab(20) |
| - | 53.9±0.2ms | 24.7±0.1ms | 0.46 | solve.TimeSparseSystem.time_linsolve_Ab(30) |
Full benchmark results can be found as artifacts in GitHub Actions |
Have you considered the comment here in your work? |
Thanks for looking into this, I was thinking about commenting my thoughts about the reference comment here for some time now, so basically the referenced comment states that for something like
the above is correct according to wolfram alpha, now digging into the working of sympy I saw that
so in the results above we can compare the first few terms of
(NOTE: the above expression is correct according to wolframbut is not currently given in master but in PR branch.) Similarly for the above if we look at the corresponding series expansion for the denominator of the expression then we get the following(NOTE : again the following is in the PR branch and not in the master)
now what I intend to say is that for out[10] to be what it is we need out[11] as shown(both 11 and 10 have been corrected results in the pr branch and not valid in master) but out[12] is given by both pr and master, and thus now if we again compare the out[11] and out[12] in the light of |
direction = self.args[0].leadterm(x)[0] | ||
if direction.has(log(x)): | ||
direction = direction.subs(log(x), logx) | ||
s = self.args[0]._eval_nseries(x, n=n, logx=logx) | ||
if direction.is_extended_real is False: | ||
return im(s.removeO()) + Order(x**n, x) | ||
return (sign(direction)*s).expand() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests look good though I'll have to think through this. I remember while I was appraoching this a couple of years back I ended up justifying this return (s/sign(direction)).expand()
to be the correct return statement finally.
Signed-off-by: arnabnandikgp <arnabnandi2002@gmail.com>
Is there a need to add my name again in the mailmap file? As running |
References to other Issues or PRs
Fixes #25682
Fixes #25681
Closes #25756
Brief description of what is fixed or changed
Other comments
comment#25682
Release Notes
_eval_nseries
method of Abs class