Skip to content

v2.0.0-preview.2

Pre-release
Pre-release

Choose a tag to compare

@Rafael-SOWNet Rafael-SOWNet released this 09 Aug 18:19
· 1008 commits to master since this release
50fc43f

The second preview of 2.0. Replaces 2.0.0-preview.1, which has a defect in Expand — see below. If you are testing against the preview, move to this one.

Please read BREAKING-CHANGES.md before upgrading. It lists every place the same input now gives a different result, with the value before and the value now, both measured on a build rather than taken from the diff.

What changed since preview.1

Expand no longer loses a term that takes no power

Expand turned RR + 1 into NaN, and with it ZZ + 1, CC + 1, QQ + 1, BB + 1 and true + 1. Simplify then returned NaN too, because it offers the expanded form as a candidate and NaN rates as the simplest thing on offer.

1.4.0 2.0.0-preview.1 2.0.0-preview.2
"RR + 1".Simplify() RR + 1 NaN RR + 1
"ZZ + 1".Simplify() ZZ + 1 NaN ZZ + 1

Collecting like terms reduces every factor to a base and an exponent and puts the term back together, and a factor that appeared once came back as base^1. Raising to the first power is an identity only where the power is defined at all — RR^1 and true^1 are NaN — so the reassembly turned an expression that had a value into one that did not. Sets that can be shifted were never affected and still are not: { 1, 2 } + 1 is { 2, 3 }.

Found by running CSharpMath's test suite against preview.1: 955 green on 1.4.0, two red on the preview. This closes one of the two; the other is the documented radical change.

#851, PR #852.

Documentation and measurement

  • integral takes bounds, not a repetition count: integral(f, x, from, to) is now written down in the syntax reference, along with why derivative takes an order and integral does not. The change itself was made in 1.4.0 and had never been recorded — BREAKING-CHANGES.md now has a section for it, since 1.4.0 is what dotnet add package still installs.
  • The samples are built and run in CI. Two of them had been broken against the current release since January, hidden by a pin to 1.3.0; a third was broken in plain sight because nothing ran it.
  • Trigonometry against precision is now benchmarked, and allocation is recorded alongside the timings.

The rest of 2.0 is unchanged from preview.1

Most of 2.0 is a wrong answer becoming a right one. That is still a breaking change if you built on the wrong one, and a large share of these changes are silent: the call still succeeds and quietly returns something else.

The loud breaks — the compiler finds these for you:

was is
target frameworks net7.0;netstandard2.0 netstandard2.0;net8.0;net10.0
28 members deprecated since 1.x obsolete but present removed
Latexise, ILatexiseable, entity_latexise the British spelling Latexize, ILatexizeable, entity_latexize
MathS.Quantum.Factorise one letter from the unrelated Entity.Factorize MathS.Quantum.TensorFactorize
MathS.Quantum.IsNormalised the British spelling IsNormalized
Minusf.Minuend / .Subtrahend named for the wrong operand named for the right one

The silent ones are what to test against — sqrt(x^2) left as written, -7 mod 3 now 2, sqrt(12) now 2*sqrt(3), numbers below 1e-16 kept, an identity equation solving to CC, many limits returning a value where they returned NaN, Stringize output parsing back. The full list with worked examples is in BREAKING-CHANGES.md.

Reporting

If something you relied on changed and it is not in BREAKING-CHANGES.md, that is a bug in the notes as much as in the code — please open an issue either way. The Expand defect above was found by running a downstream project's tests against preview.1, which is exactly what a preview is for.

Packages: AngouriMath, AngouriMath.FSharp, AngouriMath.Interactive, AngouriMath.Terminal.