Problem

Consider the following Python function,

import numpy as np
def sincos(x):
    """
    Return `sin(x) * cos(x)`.
    """
    return np.sin(x) * np.cos(x)

What can you do to the above code to make it more performant?
Prove your suggestion by benchmarking your revised code against the original code above.
How much performance improvement do you observe?

Comments