Create a FunctionApproximation.Problem
object, specifying a math function to approximate.
problem =
FunctionApproximation.Problem with properties
FunctionToApproximate: @(x)log(x)
NumberOfInputs: 1
InputTypes: "numerictype(1,16,10)"
InputLowerBounds: 0.6250
InputUpperBounds: 15.6250
OutputType: "numerictype(1,16,13)"
Options: [1×1 FunctionApproximation.Options]
Use default values for all other options.
Use the solve
method to generate an approximation of
the function.
| ID | Memory (bits) | ConstraintMet | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) |
| 0 | 64 | 0 | 2 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 1.178125e+00 |
| 1 | 1984 | 1 | 122 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 4.192649e-03 |
| 2 | 1024 | 0 | 62 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 1.416713e-02 |
| 3 | 1968 | 1 | 121 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 4.192649e-03 |
| 4 | 64 | 0 | 2 | 16 | 16 | EvenSpacing | 7.812500e-03, 1.138984e+00 |
| 5 | 416 | 1 | 13 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.310789e-03 |
Best Solution
| ID | Memory (bits) | ConstraintMet | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) |
| 5 | 416 | 1 | 13 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.310789e-03 |
solution =
FunctionApproximation.LUTSolution with properties
ID: 5
Feasible: "true"
You can then use the approximate
method to generate a subsystem containing the
lookup table approximation.