Sturla Molden skrev:
> Chris Colbert skrev:
>   
>> and within that loop it is these statements that take the bulk of the time:
>>
>> F = ((f1**2)**(1/e2) + (f2**2)**(1/e2))**(e2/e1) + (f3**2)**(1/e1)
>>
>> temperr = (C4 * (F**(e1) - 1))**2
>>
>> and replacing the powers with serial multiplications don't really help any...
>>   
>>     
>
> Does this help?
>
> cdef extern from "math.h":
>      double pow(double, double)
>
> F = pow(pow((f1*f1),(1/e2)) + pow((f2*f2),(1/e2)),(e2/e1)) \
>      + pow((f3*f3),(1/e1))
>
>   
cdef double tmp

tmp =  C4 * (pow(F,e1) - 1)

temperr = tmp*tmp




_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to