<?php
/**
* fibonacci_binet
*
* Simple example of Fibonacci series algorithm using Binet
*
* @version 0.3
* @author Contributors at eXorithm
* @link /algorithm/view/fibonacci_binet Listing at eXorithm
* @link /algorithm/history/fibonacci_binet History at eXorithm
* @license /home/show/license
*
* @param number $n
* @return mixed
*/
function fibonacci_binet($n=13)
{
$phi = (1 + sqrt(5)) / 2;
$u = (pow($phi, $n) - pow(1 - $phi, $n)) / sqrt(5);
return $u;
}
?>
