Merge pull request #808 from lovell/prefer-sqrt-to-pow-0.5
Prefer ~10x faster sqrt instead of pow when y=0.5
This commit is contained in:
commit
cd898c52de
@ -139,7 +139,9 @@ vips_math2_build( VipsObject *object )
|
|||||||
\
|
\
|
||||||
/* Division by zero! Difficult to report tho' \
|
/* Division by zero! Difficult to report tho' \
|
||||||
*/ \
|
*/ \
|
||||||
(Y) = (left == 0.0 && right < 0.0) ? 0.0 : pow( left, right ); \
|
(Y) = (right == 0.5) \
|
||||||
|
? sqrt( left ) \
|
||||||
|
: (left == 0.0 && right < 0.0) ? 0.0 : pow( left, right ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WOP( Y, X, E ) POW( Y, E, X )
|
#define WOP( Y, X, E ) POW( Y, E, X )
|
||||||
|
Loading…
Reference in New Issue
Block a user