Skip to content

A radical times a power of its variable is solved as one fractional power - #2323

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-radical-times-a-power-is-solved-as-one-fractional-power
Nov 1, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-radical-times-a-power-is-solved-as-one-fractional-power

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

An equation in sqrt(x), or a cube root of x, beside powers of x is solved by raising the radical's side to a power, and FractionedPolynoms looks for each fractional power first. The power rules write x * sqrt(x) as x ^ (1/2 + 1). It matched only an exponent that was already a number, so a term whose exponent is a sum was no fractional power. Such equations, including every c/x cleared of its denominator, went to Newton's method.

sqrt(x) - 1/x - 1 - i = 0 is (s - i)(s^2 - s - i) = 0 in s = sqrt(x), so its roots are -1 and 1.3002 + 1.6248i. 2.6.0 and master answer only the decimal one.

Two changes in FractionedPolynoms:

  • The exponent is folded before it is read.
  • A power past one is read as a whole power times a proper fractional one, so x^(3/2) is x * sqrt(x) and shares the radical of sqrt(x). Without this, 3 sqrt(x) - x^(3/2) is two radicals that cannot be raised together.

Raising keeps every root whichever root is taken, since (x^(p/q))^q is x^p. The solution check removes what the raising adds.

Generated equations of this shape (a powers-of-x mode added to the radical cross-check, 200 equations at seed 31):

roots missed numbers answered that are not roots
2.6.0 45, in 22 equations 5
master 37, in 20 equations 4
this branch 2 0

The two still missing are roots of a degree-7 polynomial, near 23 and -26, which the polynomial solver misses. That is a separate defect, with its own PR to follow. The default mode, 400 equations in roots of polynomials at seed 21, is unchanged: the same 39 sums of two radicals left unsolved on both builds, and no root missed or wrong on either.

BREAKING-CHANGES.md has an entry. (3 - x)*sqrt(x) - x = 0 is now spelled { 0, (-7 + sqrt(13)) / (-2) }, where it was { 0, (7 - sqrt(13)) / 2 }. Test: ARadicalTimesAPowerTest; four of its six cases fail on master. The other two pin the regrouping, which master reached by another route.

🤖 Generated with Claude Code

…ower

An equation in sqrt(x), or a cube root of x, beside powers of x is solved by
raising the radical's side to a power, and FractionedPolynoms looks for each
fractional power first. The power rules write x * sqrt(x) as x ^ (1/2 + 1), and
it matched only an exponent that was already a number, so a term with an exponent
written as a sum was no fractional power. Such equations, including every c/x
cleared of its denominator, went to Newton's method, which answered in decimals,
missed roots, and kept numbers that are not roots: sqrt(x) - 1/x - 1 - i = 0 was
answered with one decimal root and without -1.

The exponent is now folded before it is read. A power past one is then read as a
whole power times a proper fractional one, x^(3/2) as x * sqrt(x), so it shares
the radical of sqrt(x): 3 sqrt(x) - x^(3/2) is the one term (3 - x) sqrt(x), where
read as sqrt(x) and sqrt(x^3) it would be two radicals that cannot be raised
together. Raising keeps every root whichever root is taken, since (x^(p/q))^q is
x^p, and the solution check removes what it adds.

Generated equations of this shape (e387 radcheck, powers-of-x mode, 200 at seed
31): 2.6.0 missed 45 roots in 22 equations and answered 5 numbers that are not
roots; master before this, 37 in 20 and 4; now 2 and 0. The default mode, 400
equations in roots of polynomials at seed 21, is unchanged: the same 39 sums of
two radicals left unsolved on both builds, and no root missed or wrong on either.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Nov 1, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Nov 1, 2026
@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.76%. Comparing base (43ed2f7) to head (caef7fb).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...nuous/Solvers/EquationSolver/FractionedPolynoms.cs 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2323      +/-   ##
==========================================
- Coverage   86.76%   86.76%   -0.01%     
==========================================
  Files         312      312              
  Lines       68354    68374      +20     
  Branches    19876    19885       +9     
==========================================
+ Hits        59306    59323      +17     
- Misses       4890     4892       +2     
- Partials     4158     4159       +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.30% <66.66%> (-0.01%) ⬇️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nuous/Solvers/EquationSolver/FractionedPolynoms.cs 90.90% <66.66%> (+7.57%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet
Rafael-SOWNet merged commit 09a132d into master Nov 1, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 1, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-radical-times-a-power-is-solved-as-one-fractional-power branch November 1, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant