Piecewise
A conditional value: List of {value, condition} pairs, tried in order, plus a (0 when omitted) for when none holds. Provided by @enumeratio/analytic.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Piecewise!Piecewise(pairs)pairs is a List of two-element Lists {value, condition}; the default is 0.Piecewise(pairs, default)same, with an explicit fallback value.Typed signatures
| Type | Package | Applies |
|---|---|---|
(list, expression?) -> expression | analytic | always |
Details
- Conditions are tried in list order via
ce.verify(a three-valued check against the current assumptions). The first one knownTruewins, PROVIDED every condition before it is knownFalse— aPiecewisewith an undecided earlier condition stays symbolic rather than guessing which branch is really first. - A condition known
Falseis dropped; if every condition is eliminated this way, the result is . - PiecewiseExpand produces this head from Abs, Sign, UnitStep, Clip, and 2-argument Max/Min.
Examples
1 more kept as data, checked against the oraclesBasic #
About
| Examples | 9 |
|---|---|
| Checked against | Wolfram Language 5 agree2 differ |
| Crosswalk | Wolfram Language |