Assuming that your changed function belongs to the public API, it appears that your new API version no longer provides the same result for the same input. This is definitely not backward compatible and hence requires a major change (see point 8 of Semantic Versioning):
Major version (...) MUST be incremented if any backwards incompatible
changes are introduced to the public API
It is by the way clear that your change doesn't fit the requirements for the minor change:
Minor version (...) MUST be incremented if new, backwards compatible
functionality is introduced to the public API. It MUST be incremented
if any public API functionality is marked as deprecated. It MAY be
incremented if substantial new functionality or improvements are
introduced within the private code.
If you would provide the new behavior as an additional functionality (new function with a different name or new overload) and keep the existing one unchanged, you could go for a minor version. In this case you could even mark the previous one as deprecated, in order to allow for a soft transition to the new API, without breaking any code that uses (and works well) with the old version.