Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

With downcasting off, EvalNumerical loses small divisors and both ends of the exponent range

Aperta
#1,498 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Start at EvalNumerical and inspect Number.IsZero, DecimalPrecisionContext, and LostToExponentRange, comparing their behavior with the interval evaluation mentioned in the issue. Use the three expressions and affected Rubi derivative-check cases as regression coverage; done means small divisors and extreme exponent products produce finite, correct results instead of NaN or zero.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

With downcasting off, EvalNumerical loses decimals at three limits:

using var _ = MathS.Settings.DowncastingEnabled.Set(false);
"1 / 1.37^(-200)".EvalNumerical()                    // NaN, not 2.21e27
"1.37^(-1500) * 1.37^1500".EvalNumerical()           // 0, not 1
"(1.37^8000 + 1) / (1.37^8000 + 2)".EvalNumerical()  // NaN, not 1.00...
  • A small divisor. A divisor below PrecisionErrorZeroRange (1e-16) counts as zero (Number.IsZero), so the quotient is NaN.
  • Both ends of the exponent range. DecimalPrecisionContext is new EContext(100, ERounding.HalfUp, -100, 1000, false), which bounds exponents to [-100, 1000]. At 100 digits, a decimal below about 1e-199 becomes zero and one above 1e1000 becomes infinite. LostToExponentRange works around this for an exact ratio, but a decimal has no exact value to fall back on.

The integrator's derivative check hit these and rejected correct antiderivatives in Rubi's suites (#1338). Five of those were large rational expressions: a factor near 1e-316 times one near 1e+316 came out 0, and a factor flushed to 0 times one saturated to infinity came out NaN. Another divided 2.40e-45 by 2.23e-91. The check now uses interval evaluation (#1497), which has none of these limits.

Lingua principale
C#
Stelle
831
Fork
79
Merge medio
2h 21m
PR unite (30g)
504

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ASC-Community/AngouriMath

Tutte le issue di ASC-Community/AngouriMath

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.