solvelib::preImage -- preimage
of a set under a mapping
Introductionsolvelib::preImage(a, x, S) returns the
set of all numbers y such that substituting y
for x in a gives an element of
S.
Call(s)solvelib::preImage(a, x, S)
Parametersa |
- | arithmetic expression |
x |
- | identifier |
S |
- | set |
Returnsset
Related
Functions
DetailsS can be a set of any type (finite or infinite).
Example
1In case of a finite set S, the preimage of
S is just the union of all sets solve(a=s, x), where
s ranges over the elements of S.
>> solvelib::preImage(x^2+2, x, {11, 15});
1/2 1/2
{-3, 3, 13 , - 13 }
Example
2For intervals, the preimage is usually an interval or a union of intervals.
>> solvelib::preImage(x^2+2, x, Dom::Interval(3..7));
]1, 5^(1/2)[ union ]-5^(1/2), -1[