How can one optimize PHP scripts that involve calculating roots of numbers for better performance?

One way to optimize PHP scripts that involve calculating roots of numbers for better performance is to use the built-in PHP function `sqrt()` instead of custom functions. The `sqrt()` function calculates the square root of a number efficiently and accurately, reducing the need for complex calculations in custom functions.

// Example of optimizing root calculation using built-in PHP function sqrt()

$number = 16;
$root = sqrt($number);

echo "Square root of $number is: $root";