Skip to content

Conversation

praneethratna
Copy link
Contributor

References to other Issues or PRs

Brief description of what is fixed or changed

Fixes #21355 and now radsimp(1/(x + sqrt(x**2))) returns 1/(x + sqrt(x**2)) instead of zoo*(x + sqrt(x**2)) and also added regression test in test_radsimp.py

Other comments

Release Notes

  • simplify
    • fixed bug in radsimp.

@sympy-bot
Copy link

sympy-bot commented Aug 17, 2021

Hi, I am the SymPy bot (v161). 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.9.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->


#### Brief description of what is fixed or changed
Fixes #21355 and now `radsimp(1/(x + sqrt(x**2)))` returns `1/(x + sqrt(x**2))` instead of `zoo*(x + sqrt(x**2))` and also added regression test in test_radsimp.py

#### Other comments


#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* simplify
   * fixed bug in radsimp.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@praneethratna
Copy link
Contributor Author

@sylee957 please review

@github-actions
Copy link

github-actions bot commented Aug 17, 2021

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [ed9a550f]       [c681a15b]
     <sympy-1.8^0>                 
-      1.36±0.01s          187±5ms     0.14  dsolve.TimeDsolve01.time_dsolve
-      11.7±0.02s       5.64±0.02s     0.48  integrate.TimeIntegrationRisch02.time_doit_risch(100)
-         103±4μs         41.9±1μs     0.41  matrices.TimeDiagonalEigenvals.time_eigenvals
-         120±2μs         78.5±1μs     0.66  matrices.TimeMatrixGetItem.time_ImmutableDenseMatrix_getitem
-         135±4μs         75.8±3μs     0.56  matrices.TimeMatrixGetItem.time_ImmutableSparseMatrix_getitem
-         116±3μs       75.3±0.7μs     0.65  matrices.TimeMatrixGetItem.time_MutableDenseMatrix_getitem
+      15.5±0.4μs       23.4±0.4μs     1.51  solve.TimeMatrixArithmetic.time_dense_add(3, 0)
+      18.6±0.4μs       38.4±0.4μs     2.07  solve.TimeMatrixArithmetic.time_dense_add(3, 5)
+      27.8±0.9μs         50.5±1μs     1.82  solve.TimeMatrixArithmetic.time_dense_add(4, 5)
+      49.3±0.7μs         84.3±2μs     1.71  solve.TimeMatrixArithmetic.time_dense_add(6, 5)
-     1.63±0.03ms         288±10μs     0.18  solve.TimeMatrixArithmetic.time_dense_multiply(10, 0)
-        64.1±1μs       31.3±0.3μs     0.49  solve.TimeMatrixArithmetic.time_dense_multiply(3, 0)
+      99.1±0.4μs          172±3μs     1.74  solve.TimeMatrixArithmetic.time_dense_multiply(3, 5)
-         134±2μs       40.0±0.3μs     0.30  solve.TimeMatrixArithmetic.time_dense_multiply(4, 0)
-        410±20μs         80.5±1μs     0.20  solve.TimeMatrixArithmetic.time_dense_multiply(6, 0)
-         122±2μs       55.7±0.9μs     0.46  solve.TimeMatrixOperations.time_det(3, 0)
-         236±7μs         136±10μs     0.57  solve.TimeMatrixOperations.time_det(3, 2)
-        230±10μs          127±7μs     0.55  solve.TimeMatrixOperations.time_det(3, 5)
-         134±8μs       54.9±0.5μs     0.41  solve.TimeMatrixOperations.time_det_bareiss(3, 0)
-         241±9μs          133±2μs     0.55  solve.TimeMatrixOperations.time_det_bareiss(3, 2)
-         121±2μs       55.6±0.8μs     0.46  solve.TimeMatrixOperations.time_det_berkowitz(3, 0)
-         236±9μs          139±8μs     0.59  solve.TimeMatrixOperations.time_det_berkowitz(3, 2)
-         222±5μs          126±5μs     0.57  solve.TimeMatrixOperations.time_det_berkowitz(3, 5)
+     1.14±0.02ms      2.22±0.05ms     1.95  solve.TimeMatrixOperations.time_det_berkowitz(4, 2)
+     1.20±0.05ms       2.47±0.1ms     2.05  solve.TimeMatrixOperations.time_det_berkowitz(4, 5)
+         368±6μs         630±30μs     1.71  solve.TimeMatrixOperations.time_rank(3, 0)
+        587±10μs         921±70μs     1.57  solve.TimeMatrixOperations.time_rank(4, 0)
+         169±3μs         263±20μs     1.56  solve.TimeMatrixOperations.time_rref(3, 0)
-      6.88±0.2ms      3.61±0.05ms     0.52  solve.TimeRationalSystem.time_linsolve(10)
-     1.73±0.09ms      1.05±0.01ms     0.61  solve.TimeSparseSystem.time_linsolve_eqs(10)
-     2.95±0.06ms      1.93±0.09ms     0.66  solve.TimeSparseSystem.time_linsolve_eqs(20)
-      4.55±0.2ms       2.80±0.2ms     0.62  solve.TimeSparseSystem.time_linsolve_eqs(30)

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@praneethratna praneethratna requested a review from sylee957 August 19, 2021 06:38
@sylee957 sylee957 merged commit c880b2c into sympy:master Aug 20, 2021
@praneethratna praneethratna deleted the 21355_simplify branch August 21, 2021 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

radsimp gives wrong result for 1 / (x + sqrt(x**2))
5 participants