Skip to content

2.10.0

Latest

Choose a tag to compare

@Rafael-SOWNet Rafael-SOWNet released this 27 Nov 05:07
· 29 commits to master since this release
0481c71

This release is about matrices next to names, and answers that come back. Most of what it fixes was found by
writing the code a user writes: compiling dot(x * [1, 2], [3, 4]) for a plot, inverting [[a, b], [c, d]] and
putting numbers in, taking tanh of a large argument. A name beside a written matrix was read as a number where it
could be a matrix, and refused where it could not; a symbolic inverse had no value where an elimination pivot was 0,
though the inverse exists there; and tanh(10^7) did not return.

Factoring also reaches further in several variables:

  • a polynomial in three or more variables, by lifting it as one in two and then one variable at a time;
  • a repeated factor in more than one variable, through the square-free part;
  • the square-free part of a larger polynomial, by evaluation at a large integer.

No tier of the Math OS roadmap is completed by this
release (see the note on #746). Its work is on tier 1, a symbolic engine worth building on: the polynomial layer
factors more, and answers that were wrong or missing are right.

Every changed answer is in BREAKING-CHANGES.md
under 2.10.0 — since 2.9.0
, with the old value, the new one and why. Read it first if your code depends on an
answer. Read these first:

  • A type that can be null. Matrix.Trace is Entity?, null for a matrix that is not square, where it summed
    the diagonal of any matrix: [[1, 2, 3], [4, 5, 6]] had the trace 1 + 5
    (#2565).
  • Another exception. A singular matrix to a negative power throws InvalidMatrixOperationException, where it
    threw GenericTensor's InvalidDeterminantException
    (#2564).
  • Silent: [1, 0]T * transpose(A) * [0, 1] is left as written, where it was 0: a transpose is a matrix, not a
    number (#2557).
  • Silent: trace(A) * 0.5 compiled over a long[,] argument is 2.5 at [[2, 0], [0, 3]], where it was 0
    (#2556).
  • Silent, in the printed form only: p V = n R T solved for T is { p * V / (n * R) }, where it was
    { -p * V / (-n * R) }. The value is the same; a string comparison of roots sees another string
    (#2566).

Wrong answers fixed

  • A symbolic inverse at a zero pivot. [[a, b], [c, d]]^(-1) simplified with provided not a = 0, so at
    a = 0, b = 1, c = 1, d = 0 it was NaN, where the inverse is [[0, 1], [1, 0]]. The adjugate of a 3 by 3
    symbolic matrix had the same fault, and is a matrix of polynomials with a value everywhere
    (#2564).
  • A transpose read as a number. InnerSimplified and Evaled spread a transpose or a vector product over a
    written matrix's entries, so [1, 0]T * transpose(A) * [0, 1] was 0 where it is A[2, 1]
    (#2557).
  • A truncated constant. Over a long[,], int[,] or BigInteger[,] argument, every constant and quotient
    beside the matrix was taken as a whole number: trace(A) * 0.5 was 0
    (#2556).
  • The trace of a matrix that is not square was a number (#2565).

Answers that were missing

  • Compiling a matrix operation of a name. dot, cross, det, transpose, trace and an entry of an
    expression with a name beside a written matrix compile, by both compilers, where the name is compiled as a number:
    dot(x * [1, 2], [3, 4]) is 11 x. Shaders carry them out too, where they refused them
    (#2558,
    #2561).
  • sinh, tanh and coth of a large argument. tanh(10^7) took 18 s, tanh(10^8) did not return, and
    neither stopped when cancelled. Each returns in milliseconds now
    (#2563).
  • Factoring in several variables. MathS.Polynomials.Factor("x ^ 3 - (y + z) ^ 3", "x") was null and is
    (x - y - z) * (x ^ 2 + x * y + x * z + y ^ 2 + 2 * y * z + z ^ 2); (x^2 - y^2)^4 expanded factors back to
    (x + y) ^ 4 * (x - y) ^ 4.

Clearer answers

  • A solved root with one sign. A minus sign in front of a divisor is taken off it and off the dividend, so
    1/R = 1/a + 1/b solved for R is { 1 / (1 / a + 1 / b) }, where it was { (-1) / (-1 / a + -1 / b) }
    (#2566).
  • A string that is not a variable says what it parses to. Entity.Variable v = "v0" still throws, and the message
    now says that v0 parses as v ^ 0, a digit against a name being its power, and that the variable is v_0. The
    same holds for every conversion from a string to a kind of entity
    (#2567).

Measured

Every change was checked by the suite, the eleven harnesses in CI, the solver cross-checks against mpmath and the
scale check, which solves each equation again scaled by 10^±12 to 10^±30. All of them agree with 2.9.0 wherever
an answer did not change on purpose. Against 2.9.0 on one runner, the kernel benchmark allocates the same on every row
to 0.05%, except a compilation, which allocates about 300 bytes more for the check that #2558 added. The timings and
allocations are in
version_performance_control.md.