| 1 | <?php |
||
| 12 | class NewtonRaphson |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var int |
||
| 16 | */ |
||
| 17 | private $precision; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param int $precision |
||
| 21 | */ |
||
| 22 | public function __construct(int $precision = 7) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param callable $fx |
||
| 29 | * @param callable $fdx |
||
| 30 | * @param float $guess |
||
| 31 | * |
||
| 32 | * @return float |
||
| 33 | */ |
||
| 34 | public function run(callable $fx, callable $fdx, float $guess): float |
||
| 45 | } |
||
| 46 |