Repository navigation
Commit 18d2715
The beta function and the p-norm of a vector
beta(a, b) and norm(v, p) were parse errors, and are now Entity.Betaf and Entity.Normf, built by
MathS.Beta and MathS.Norm. With one argument each is still what it was, beta(x) the product beta * x
and norm([3, 4]) the product norm * [3, 4]: the parser hands a call without a second argument back as
the name and a bracket, so it binds as before, norm(x)^2 being norm * x ^ 2. beta alone and beta (x)
with a space are as gamma's are.
The beta function is Gamma(a) Gamma(b)/Gamma(a + b), DLMF 5.12.1. It is exact at a whole argument,
(n - 1)!/(b (b + 1) ... (b + n - 1)), so beta(1, b) is 1/b, and at two half-whole ones, a rational times
pi. It has no value where a or b is 0, -1, -2, ..., unless a + b is one too: the other argument is then
whole and the value is the rational function's, beta(2, -3) = 1/6, the limit along a whole n, as
mpmath's beta takes it. Where only a + b is one it is 0. Elsewhere it is the ratio of the library's
gamma functions at the working precision, real or complex, taken with sixteen more digits and no
bound on the exponent, so B(100.5, 100.25) is 1.3e-61 where each gamma is past 1e156. It agrees with
mpmath to 1e-58 at ten points, negative, complex and large among them, and with the gamma ratio to
1e-195 at 200 digits. Its arguments are put in one order, beta(b, a) simplifying to the node beta(a, b),
and its derivative is B(a, b)(psi(a) - psi(a + b)) in a. It draws as \operatorname{B}, exports to
sympy.beta, and compiles in both compilers, through a double-precision ratio of gammas taken through
their logarithms past the doubles; MathS.Shaders declines it, as it does x!.
The norm is (|v_1|^p + ... + |v_n|^p)^(1/p) for a real p >= 1 and the largest modulus at p = +oo, taken
when simplified of a vector written out, a column or a row, real or complex; norm(v, 2) is computed as
abs(v), the same expression. A p that is a number below 1, where there is no norm, or off the real line,
and a matrix written out that is not a vector, are refused when parsed; a symbolic p stays as written
with the condition p >= 1, and is NaN below 1 once given. It draws as \left\| v \right\|_{p} and
exports to the SymPy matrix's norm. The node left where the vector is not written out has no compiled
form, and Binders.Refusal says to simplify first.
Part of #2182.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 413e8fc commit 18d2715
46 files changed
Lines changed: 2585 additions & 1359 deletions
File tree
- Sources
- AngouriMath
- Convenience
- Core
- Antlr
- Entity/Continuous
- Number
- Serialization
- Transformations/Matching
- Docs
- Contributing
- Usage
- Functions
- Compilation
- IntoFE
- IntoLinq
- Continuous
- Solvers/EquationSolver
- Evaluation/Evaluation.Continuous
- Output
- Latex
- ToString
- ToSympy
- TreeAnalyzer
- Numerics
- MCP/AngouriMath.Mcp
- Tests
- AotSmokeTest
- UnitTests
- Common
- Convenience
- Core/Transformations
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
465 | 506 | | |
466 | 507 | | |
467 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
271 | 277 | | |
272 | 278 | | |
273 | 279 | | |
| |||
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
330 | 339 | | |
331 | 340 | | |
332 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
1786 | 1807 | | |
1787 | 1808 | | |
1788 | 1809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
688 | 692 | | |
689 | 693 | | |
690 | 694 | | |
| |||
707 | 711 | | |
708 | 712 | | |
709 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
710 | 717 | | |
711 | 718 | | |
712 | 719 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
| |||
445 | 447 | | |
446 | 448 | | |
447 | 449 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
0 commit comments