I need to compare the outputs of some functions and to rate their "erratness".
Given a function, the less erratic function between a and b would be a straight line and the more erratic function would probably be a triangular or sine wave, the bigger its amplitude or its frequency the bigger their erratness. I'm not sure if it's clear what I mean.
I've thought that a way to calculate it could be to calculate the length of the line generated by the function between a and b. The smaller the length the less erratic will be the function.
The questions are:
- Do you think this is a good way to achieve what I need?
- How can the length of the output of a function be calculated?
Thanks in advance.