Ciao Rametto,
incuriosito dalla tua domanda ho indagato grazie al suggerimento del Prof. Sterbini.
Giocando con il codice ho ottenuto questi dati che in teoria confermano l'ottimizzazione della funzione "sqrt".
Per 10M di iterazioni abbiamo:
"""
Time for [**0.5]: 5.879590799999278
Time for [**1/2]: 4.535426599999482
Time for [sqrt]: 2.3892071999998734
Time for [pow(A,0.5)]: 3.03922010000133
"""
Posto il codice di esempio, se può incuriosire, non avendo collegamento alcuno con HWs. (Spero si possa fare :) )
import math
import timeit
mysetup = ""
mycode='''\nA=500\nA ** 1/2\n'''
print("Time for [**0.5]: " + str(timeit.timeit(setup = mysetup,stmt = mycode,number = 10000000)))
mysetup = ""
mycode='''\nA=500\nA ** 0.5\n'''
print("Time for [**1/2]: " + str(timeit.timeit(setup = mysetup,stmt = mycode,number = 10000000)))
mysetup = "import math"
mycode='''\nA=500\npow(A,0.5)\n'''
print("Time for [pow(A,0.5)]: " + str(timeit.timeit(setup = mysetup,stmt = mycode,number = 10000000)))
mysetup = "import math"
mycode='''\nA=500\nmath.sqrt(A)\n'''
print("Time for [sqrt]: " + str(timeit.timeit(setup = mysetup,stmt = mycode,number = 10000000)))