Skip to content

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

Description

@Rafael-SOWNet

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.

Activity

  1. Happypig375 commented on Sep 27, 2026

    @Happypig375
    Member

    Each issue opened by you needs an issue type and milestone (have we defined how milestones interact with Goal type though? It might be latest completion release and subissues get their own milestone). Update agentic instructions if they don't say so already

  2. added this to the 3.0 milestone on Sep 27, 2026
  3. Rafael-SOWNet commented on Sep 27, 2026

    @Rafael-SOWNet
    MemberAuthor

    Typed as a Bug and put on 3.0: the fix is removing the settings it depends on, and the integrator no longer relies on them since #1497. My other open issues now all have a type and a milestone.

    On Goals: AGENTS.md says a Goal used as a parent carries no milestone and its sub-issues carry theirs (from #1384). Yours is better. A Goal is on the release its last planned piece is aimed at, and each sub-issue or PR is on its own. I'll write that into AGENTS.md, and also that an issue I open gets its type and milestone when it is filed. It only said so for the milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions