1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
//! # Corporate Finance
//!
//! Provides a set of basic functions commonly used in corporate finance and tools for constructing Captial Asset Pricing Model (CAPM).
// Re-Exports
pub use ;
use ;
use crateDigiFiError;
use crate;
/// Measure of how revenue growth translates to growth of income.
///
/// Degree of Operating Leverage = (% Change in Profits) / (% Change in Sales) = 1 + Total Fixed Cost / (Quantity of Goods Sold * (Price per Unit - Variable Cost per Unit) - Total Fixed Cost)
///
/// # Input
/// - `quantity_of_goods`: Quantity of goods sold
/// - `price_per_unit`: Price of every unit of good sold
/// - `variable_cost_per_unit`: Variable cost accumulated when producing a unit of good
/// - `total_fixed_cost`: Total fixed costs of producing all units sold
///
/// # Output
/// - Degree of operating leverage (DOL)
///
/// # LaTeX Formula
/// - DOL = 1 = \\frac{F}{Q(P-V) - F}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Operating_leverage>
/// - Original Source: N/A
/// Monetary value of earnings per outstanding share of common stock for a company during a defined period of time.
///
/// EPS = (Net Income - Preferred Dividends) / Number of Common Shares Outstanding
///
/// # Input
/// - `net_income`: Net income
/// - `preferred_dividends`: Total dividends paid to the holders of the preferred stock
/// - `n_common_shares_outstanding`: Number of common shares outstanding
///
/// # Output
/// - Earnings per share (EPS)
///
/// # LaTeX Formula
/// - EPS = \\frac{(I-D_{pref})}{N_{common}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Earnings_per_share>
/// - Original Source: N/A
/// The ratio of market price to earnings.
///
/// Price-to-Earnings Ratio = Share Price / Earnings per Share
///
/// # Input
/// - `share_price`: Share price of the company
/// - `eps`: Earnings per share of the company
///
/// # Output
/// - P/E ratio
///
/// # LaTeX Formula
/// - PE = \\frac{P}{EPS}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Price%E2%80%93earnings_ratio>
/// - Original Source: N/A
/// Valuation metric for determining the relative trade-off between the price of a stock, the earnings generated per share (i.e., EPS),
/// and the company's expected growth.
///
/// PEG Ratio = (Share Price / Earnings per Share) / EPS Growth
///
/// # Input
/// - `share_price`: Share price of the company
/// - `eps`: Earnings per share of the company
/// - `eps_growth`: Growth rate of EPS in the specified time windoes (e.g., annual)
///
/// # Ouput
/// - PEG ratio
///
/// # LaTeX Formula
/// - PEG = \\frac{P/EPS}{EPS_{\\text{growth rate}}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/PEG_ratio>
/// - Original Source: N/A
/// The ratio of market price to book value.
///
/// Price-to-Book Ratio = Market Capitalization / Book Value
///
/// # Input
/// - `market_cap`: Market capitalization of the company
/// - `book_value`: Value of the assets minus liabilities
///
/// # Output
/// - PB ratio
///
/// # LaTeX Formula
/// - PB = \\frac{Market Capitalization}{Book Value}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/P/B_ratio>
/// - Original Source: N/A
/// The ratio of dividend issued by the company to share price.
///
/// Dividend Yield = 100 * Dividend / Share Price
///
/// # Input
/// - `share_price`: Share price of the company
/// - `dividend`: Amount of dividend paid out by the company per defined period
///
/// # Output
/// - Dividend yield
///
/// # LaTeX Formula
/// - D_{Y} = 100\\frac{D}{P}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Dividend_yield>
/// - Original Source: N/A
/// Enterprise value is the sum of a company's market capitalization and any debts, minus cash or cash equivalents on hand.
///
/// EV = Maarket Cap - Total Debt + Cash & Cash Equivalents
///
/// # Input
/// - `market_cap`: Market capitalization of the company
/// - `total_debt`: Total debt of the company
/// - `cash`: Cash and cash equivalents (May not include marketable securities)
///
/// # Output
/// - Enterprise value (EV)
///
/// # LaTeX Formula
/// - EV = \\textit{Market Capitalization}+\\textit{Total Debt}-\\textit{Cash and Cash Equivalents}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Enterprise_value>
/// - Original Source: N/A
/// Measure of the value of a stock that compares a company's enterprise value to its revenue.
/// EV/R is one of several fundamental indicators that investors use to determine whether a stock is priced fairly.
/// The EV/R multiple is also often used to determine a company's valuation in the case of a potential acquisition.
/// It’s also called the enterprise value-to-sales multiple.
///
/// # Input
/// - `market_cap`: Market capitalization of the company
/// - `total_debt`: Total debt of the company
/// - `cash`: Cash and cash equivalents (May not include marketable securities)
/// - `revenue`: Total amount of income generated by the sale of goods and services related to the primary operations of a business.
///
/// # Output
/// - EV/Revenue multiple
///
/// # LaTeX Formula
/// - \\frac{EV}{R} = \\frac{\\textit{Market Capitalization}+\\textit{Total Debt}-\\textit{Cash and Cash Equivalents}}{\\textit{Revenue}}
///
/// # Links
/// - Wikipedia: N/A
/// - Original Source: N/A
/// Valuation multiple used to determine the fair market value of a company.
/// By contrast to the more widely available P/E ratio (price-earnings ratio) it includes debt as part of the value of the
/// company in the numerator and excludes costs such as the need to replace depreciating plant, interest on debt,
/// and taxes owed from the earnings or denominator.
///
/// # Input
/// - `market_cap`: Market capitalization of the company
/// - `total_debt`: Total debt of the company
/// - `cash`: Cash and cash equivalents (May not include marketable securities)
/// - `ebitda`: EBITDA of the company
///
/// # Output
/// - EV/EBITDA multiple
///
/// # LaTeX Formula
/// - \\frac{EV}{EBITDA} = \\frac{\\textit{Market Capitalization}+\\textit{Total Debt}-\\textit{Cash and Cash Equivalents}}{\\textit{EBITDA}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/EV/Ebitda>
/// - Original Source: N/A
/// Value of assets of the company minus its liabilities.
///
/// Book Value = Assets - Liabilities
///
/// # Input
/// - `assets`: Total assets of the company
/// - `liabilities`: Total liabilities of the company
///
/// # Output
/// - Book value
///
/// # LaTeX Formula
/// - \\textit{Book Value} = \\textit{Assets} - \\textit{Liabilities}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Book_value>
/// - Original Source: N/A
/// Liquidity ratio that measures whether a firm has enough resources to meet its short-term obligations.
///
/// Current Ratio = Current Assets / Current Liabilities
///
/// # Input
/// - `current_assets`: Asset that can reasonably be expected to be sold, consumed, or exhausted through the normal operations of
/// a business within the current fiscal year, operating cycle, or financial year
/// - `current_liabilities`: Liabilities of a business that are expected to be settled in cash within one fiscal year or
/// the firm's operating cycle, whichever is longer
///
/// # Output
/// - Current ratio
///
/// # LaTeX Formula
/// \\text{Current Ratio} = \\frac{\\text{Current Assets}}{\\text{Current Liabilities}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Current_ratio>
/// - Original Source: N/A
/// Liquidity ratio that measures the ability of a company to use near-cash assets (or 'quick' assets
/// to extinguish or retire current liabilities immediately.
///
/// Quick Ratio = (Current Assets - Inventories) / Current Liabilities
///
/// # Input
/// - `current_assets`: Asset that can reasonably be expected to be sold, consumed, or exhausted through the normal operations of
/// a business within the current fiscal year, operating cycle, or financial year
/// - `inventories`: Raw materials used in production as well as the goods produced that are available for sale
/// - `current_liabilities`: Liabilities of a business that are expected to be settled in cash within one fiscal year or
/// the firm's operating cycle, whichever is longer
///
/// # Output
/// - Quick ratio (i.e., acid-test ratio)
///
/// # LaTeX Formula
/// - \\text{Quick Ratio} = \\frac{\\text{Current Assets - Inventories}}{\\text{Current Liabilities}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Quick_ratio>
/// - Original Source: N/A
/// Financial ratio that determines the value of incremental sales, which guides pricing and promotion decisions.
///
/// Gross Margin = (Revenue - CoGS) / Revenue
///
/// # Input
/// - `revenue`: Total amount of income generated by the sale of goods and services related to the primary operations of a business.
/// - `cost_of_goods_sold`: Carrying value of goods sold during a particular period
///
/// # Output
/// - Gross margin
///
/// # LaTeX Formula
/// - \\text{Gross Margin} = \\frac{\\text{Revenue - CoGS}}{\\text{Revenue}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Gross_margin>
/// - Original Source: N/A
/// Financial ratio that measures the profitability of ventures after accounting for all costs.
///
/// Operating Margin = Operating Income / Revenue
///
/// # Input
/// - `operating_income`: Profit a company makes from its core business operations after deducting all operating expenses
/// - `revenue`: Total amount of income generated by the sale of goods and services related to the primary operations of a business.
///
/// # Output
/// - Operating margin
///
/// # LaTeX Formula
/// - \\text{Operating Margin} = \\frac{\\text{Operating Income}}{\\text{Revenue}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Operating_margin>
/// - Original Source: N/A
/// Financial ratio that measures the percentage of profit earned by a company in relation to its revenue.
///
/// Net Profit Margin = Net Income / Revenue
///
/// # Input
/// - `net_income`: Company's income minus cost of goods sold, expenses, depreciation and amortization, interest,
/// and taxes, and other expenses for an accounting period
/// - `revenue`: Total amount of income generated by the sale of goods and services related to the primary operations of a business.
///
/// # Output
/// - Net profit margin
///
/// # LaTeX Formula
/// - \\text{Net Profit Margin} = \\frac{\\text{Net Income}}{\\text{Revenue}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Profit_margin
/// - Original Source: N/A
/// Cost of equity capital (Market capitalization rate).
///
/// Cost of Equity Capital = (Expected Dividend + Expected Share Price - Share Price) / Share Price
///
/// # Input
/// - `share_price`: Share price of the company
/// - `expected_dividend`: Expected dividend to be received in the future
/// - `expected_share_price`: Expected share price of the company in the future
///
/// # Output
/// - Cost of equity capital (Market capitalization rate)
///
/// # LaTeX Formula
/// - r = \\frac{D_{t+1} + P_{t+1} - P_{t}}{P_{t}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Cost_of_equity>
/// - Original Source: N/A
/// Ratio of dividends to earnings per share.
///
/// Payout Ratio = Dividend per Share / Earnings per Share
///
/// # Input
/// - `dividend_per_share`: Dividend per share paid out closest to the latest earnings
/// - `earnings_per_share`: Earnings per share
///
/// # Output
/// - Payout ratio
///
/// # LaTeX Formula
/// - \\textit{Payout Ratio} = \\frac{D_{t}}{EPS_{t}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Dividend_payout_ratio>
/// - Original Source: N/A
/// One minus payout ratio.
///
/// Plowback Ratio = 1 - (Dividend per Share / Earnings per Share)
///
/// # Input
/// - `dividend_per_share`: Dividend per share paid out closest to the latest earnings
/// - `earnings_per_share`: Earnings per share
///
/// # Output
/// - Plowback ratio
///
/// # LaTeX Formula
/// - \\textit{Plowback Ratio} = 1 - \\frac{D_{t}}{EPS_{t}}
///
/// # Links
/// - Wikipedia: N/A
/// - Original Source: N/A
/// Measure for predicting the likelihood of bankrupcy of a company.
///
/// # Input
/// - `ebit`: EBIT of the company
/// - `total_assets`: Total assets of the company
/// - `sales`: Total sales of the company
/// - `equity`: Market value of equity
/// - `total_liabilities`: Total liabilities of the company
/// - `retained_earnings`: Retained earnings of the company
/// - `working_capital`: Working capital of the company
///
/// # Output
/// - Altman's Z-Score: If the value is below 1.81 - there is a high vulnerability to bankrupcy,
/// if the value is above 2.99 - there is a low vulnerability to bankrupcy
///
/// # LaTeX Formula
/// - Z = 3.3\\frac{EBIT}{\\textit{Total Assets}} + 1.0\\frac{Sales}{Assets} + 0.6\\frac{Equity}{\\textit{Total Liabilities}} +
/// 1.4\\frac{\\textit{Retained Earning}}{\\textit{Total Assets}} + 1.2\\frac{\\textit{Working Capital}}{\\textit{Total Assets}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Altman_Z-score>
/// - Origina Source: <https://doi.org/10.1002/9781118266236.ch19>
/// Computes the weighted average cost of capital (WACC), which is the expected return on the company's assets.
///
/// WACC = (Debt / (Debt+Equity) * (1 - Corporate Tax Rate) * Return on Debt) + (Equity / (Debt+Equity) * Return on Equity)
///
/// # Input
/// - `equity`: Total equity of the company
/// - `debt`: Total debt of the company
/// - `return_on_equity`: Expected return on equity of the company
/// - `return_on_debt`: Expected return on debt of the company
/// - `corporate_tax`: Corporate tax rate on earnings after interest, EBT
///
/// # Output
/// - Weighted average cost of capital (WACC)
///
/// # LaTeX Formula
/// - r_{A} = [r_{D}(1-T_{c})\\frac{D}{E+D}] + [r_{E}\\frac{E}{E+D}]
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Weighted_average_cost_of_capital>
/// - Original Source: N/A
/// Computes expected return on the equity (ROE) portion of the company.
///
/// ROE = Return on Assets + (Return on Assets - Return on Debt * (1 - Corporate Tax Rate)) * Debt / Equity
///
/// # Input
/// - `equity`: Total equity of the company
/// - `debt`: Total debt of the company
/// - `return_on_assets`: Return on all assets (WACC) of the company
/// - `return_on_debt`: Expected return on debt of the company
/// - `corporate_tax`: Corporate tax rate on earnings after interest, EBT
///
/// # Output
/// - Expected return on equity (ROE)
///
/// # LaTeX Formula
/// - r_{E} = r_{A} + (r_{A}-r_{D}(1-T_{c}))\\frac{D}{E}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Return_on_equity>
/// - Original Source: N/A
/// Measure of a company's financial performance. It is calculated by dividing net income by shareholders' equity.
/// Because shareholders' equity is equal to a company’s assets minus its debt, ROE is a way of showing a company's
/// return on net assets.
///
/// ROE = Net Income / Shareholder's Equity
///
/// # Input
/// - `net_income`: Net income of the company
/// - `equity`: Average shareholder's equity
///
/// # Output
/// - Return on equity (ROE)
///
/// # LaTeX Formula
/// - ROE = \\frac{\\textit{Net Income}}{Equity}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Return_on_equity>
/// - Original Source: N/A
/// Measure of a company's performance, but the ROE is split into multiple components.
///
/// ROE = Net Profit Margin * Total Asset Turnover * Financial Leverage
///
/// # Input
/// - `net_profit_margin`: Net profit margin
/// - `total_asset_turnover`: Financial ratio that measures the efficiency of a company's use of its assets in generating sales revenue or sales income to the company
/// - `total_assets`: Total assets of the company
/// - `total_shareholders_equity`: Total shareholder's equity
///
/// # Output
/// - DuPont return on equity (ROE)
///
/// # LaTeX Formula
/// - ROE_{DuPont} = \\textit{Net Profit Margin} \\times \\textit{Total Asset Turnover} \\times\\frac{\\textit{Total Assets}}{\\textit{Total Shareholders' Equity}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/DuPont_analysis>
/// - Original Source: N/A
/// Financial ratio that indicates how profitable a company is relative to its total assets.
/// It can used to determine how efficiently a company uses its resources to generate a profit.
///
/// ROA = Net Income / Total Assets
///
/// # Input
/// - `net_income`: Net income of the company
/// - `total_assets`: Average total assets
///
/// # Output
/// - Return on assets (ROA)
///
/// # LaTeX Formula
/// - ROA = \\frac{\\textit{Net Income}}{\\textit{Total Assets}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Return_on_assets>
/// - Original Source: N/A
/// Performance measure used to evaluate the efficiency or profitability of an investment or compare the efficiency
/// of a number of different investments. ROI tries to directly measure the amount of return on a particular investment,
/// relative to the investment’s cost.
///
/// ROI = (Gain from Investment - Cost of Investment) / Cost of Investment
///
/// # Input
/// - `gain_from_investment`: Gain from investment (e.g., revenue)
/// - `cost_of_investment`: Cost of investment (e.g., cost of goods sold)
///
/// # Output
/// - Return on investment (ROI)
///
/// # LaTeX Formula
/// - ROI = \\frac{Gain - Cost}{Cost}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Return_on_investment>
/// - Original Source: N/A
/// Ratio indicating the relative proportion of shareholders' equity and debt used to finance the company's assets.
///
/// D/E = Debt / Equity
///
/// # Input
/// - `debt`: Debt portion of the corporate structure
/// - `equity`: Equity portion of the corporate structure
///
/// # Output
/// Debt-to-Equity ratio
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Debt-to-equity_ratio>
/// - Original Source: N/A
/// Unlevered beta, which is the systematic risk of the company's assets.
///
/// Unlevered Beta = (Debt / (Debt+Equity) * Beta of Debt) + (Equity / (Debt+Equity) * Beta of Equity)
///
/// # Input
/// - `equity`: Total equity of the company
/// - `debt`: Total debt of the company
/// - `beta_equity`: Levered beta of the company
/// - `beta_debt`: Beta debt of the company
///
/// # Output
/// - Unlevered beta
///
/// # LaTeX Formula
/// - \\beta_{A} = [\\beta_{D}\\frac{D}{E+D}] + [\\beta_{E}\\frac{E}{E+D}]
/// Levered beta, which is the equity-only beta of the company.
///
/// Levered Beta = Beta of Assets + (Beta of Assets - Beta of Debt) * (Debt / Equity)
///
/// # Input
/// - `equity`: Total equity of the company
/// - `debt`: Total debt of the company
/// - `beta_assets`: Unlevered beta of the company
/// - `beta_debt`: Beta debt of the company
///
/// # Output
/// - Levered beta
///
/// # LaTeX Formula
/// - \\beta_{E} = \\beta_{A} + (\\beta_{A} - \\beta_{D})\\frac{D}{E}
/// Calculates an advantage of debt financing for a company as opposed to equity financing from perspective of tax optimisation.
///
/// Relative Tax Advantage of Debt = (1 - Personal Tax on Interest Income) / ((1 - Effective Personal Tax) * (1 - Corporate Tax))
///
/// # Input
/// - `corporate_tax`: Corporate tax rate applied to a company after debt payout
/// - `personal_tax`: Personal tax rate on a interest income
/// - `effective_personal_tax`: Effective tax rate on equity income comprising personal tax on dividend income and personal tax on capital gains income
///
/// # Output
/// - Relative tax advantage of debt ratio
///
/// # LaTeX Formula
/// - \\textit{Relative Tax Advantage of Debt} = \\frac{1-T_{p}}{(1-T_{pE})(1-T_{c})}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Tax_benefits_of_debt>
/// - Original Source: N/A
/// Interest coverage ratio (i.e., Times-Interest Earned) is a measure of company's ability to honour its debt payments.
///
/// Note: EBITDA can be used instead of EBIT.
///
/// Interest Coverage Ratio = EBIT / Interest Expense
///
/// # Input
/// - `EBIT`: Earnings before interest and taxes
/// - `interest_expense`: Cost of borrowing money from financial institutions incurred by the company
///
/// # Output
/// - Interest coverage ratio
///
/// # LaTeX Formula
/// - \\textit{Interest Coverage Ratio} = \\frac{EBIT}{\\textit{Interest Expense}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Times_interest_earned>
/// - Original Source: N/A
/// Debt service covergae ratio (i.e., Debt coverage Ratio) is a measure of company's ability to generate sufficient cash to cover its debt obligations,
/// including interest, principal, and lease payments.
///
/// DSCR = Operating Income / Current Debt Obligations
///
/// # Input
/// - `operating_income`: Profit a company makes from its core business operations after deducting all operating expenses
/// - `current_debt_obligations`: Current debt obligations, including any interest, principal, sinking funds, and lease payments
/// that are due over the next financial period (e.g., year)
///
/// # Output
/// - Debt service coverage ratio
///
/// # LaTeX Formula
/// - \\textit{DSCR} = \\frac{\\textit{Operating Income}}{\\textit{Current Debt Obligations}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Debt_service_coverage_ratio>
/// - Original Source: N/A
/// Asset coverage ratio is a measure of how well a company can repay its debts by sellingor liquidating its assets.
///
/// Asset Coverage Ratio = (Total Assets - Current Liabilities) / Total Debt
///
/// # Input
/// - `total_assets`: Total assets of the company
/// - `current_liabilities`: Liabilities of a business that are expected to be settled in cash within one fiscal year or
/// the firm's operating cycle, whichever is longer
/// - `total_debt`: Total debt of the company
///
/// # Output
/// - Asset coverage ratio
///
/// # LaTeX Formula
/// - \\textit{Asset Coverage Ratio} = \\frac{\\textit{Total Assets} - \\textit{Current Liabilities}}{\\textit{Total Debt}}
///
/// # Links
/// - Wikipedia: N/A
/// - Original Source: N/A
/// Liquidity ratio is a measure a company's ability to repay short-term creditors out of its total cash.
///
/// Liquidity Ratio = Liquid Assets / Current Liabilities
///
/// # Input
/// - `Liquid_assets`: Cash of the company on the balance sheet
/// - `current_liabilities`: Liabilities of a business that are expected to be settled in cash within one fiscal year or
/// the firm's operating cycle, whichever is longer
///
/// # Output
/// - Liquidity ratio
///
/// # LaTeX Formula
/// - \\textit{Liquidity Ratio} = \\frac{\\textit{Liquid Assets}}{\\textit{Current Liabilities}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Liquidity_ratio>
/// - Original Source: N/A
/// Cash flow to debt ratio is a measure of how long it would take the company to repay all its debt using only cash flow from operations.
///
/// CF/D = Operating Cash Flow / Total Debt
///
/// # Input
/// - `operating_cash_flow`: Cash generated from core business activities
/// - `total_debt`: Total debt of the company
///
/// # Output
/// - Cash flow to debt ratio
///
/// # LaTeX Formula
/// - \\textit{CF/D} = \\frac{\\textit{Operating Cash Flow}}{\\textit{Total Debt}}
///
/// # Links
/// - Wikipedia: <https://en.wikipedia.org/wiki/Cash-flow-to-debt_ratio>
/// - Original Source: N/A
/// Discounting cash flow model that is solved for the price at the horizon (i.e., the price of the stock at a certain horizon
/// after dividends up until that horizon have been issued).
///
/// # Input
/// - `share_price`: Share price of the company
/// - `dividend`: Amount of dividend paid out by the company per defined period
/// - `horizon`: Time horizon at which to price the stock (i.e., time periods between current share price and the future share price)
/// - `discount_rate`: Discount rate for future cash flows from period-to-period
/// - `dividend_growth_rate`: Growth rate of the dividend from period-to-period
///
/// # Output
/// - Stock price at the given horizon discounted to today
///
/// # Examples
///
/// ```rust
/// use digifi::utilities::TEST_ACCURACY;
/// use digifi::corporate_finance::dcf_price_at_horizon;
///
/// let share_price_at_horizon: f64 = dcf_price_at_horizon(100.0, 2.0, 3.5, 0.03, 0.01).unwrap();
///
/// assert!((share_price_at_horizon - 103.71078349920816).abs() < TEST_ACCURACY);
/// ```
/// Discounting cash flow model that is solved for the dividend until horizon (i.e., the dividend that must be paid out for stock price to
/// reach the price at the horizon).
///
/// # Input
/// - `share_price`: Share price of the company
/// - `share_price_horizon`: Share price of the company at the specified horizon
/// - `horizon`: Time horizon at which to price the stock (i.e., time periods between current share price and the future share price)
/// - `discount_rate`: Discount rate for future cash flows from period-to-period
/// - `dividend_growth_rate`: Growth rate of the dividend from period-to-period
///
/// # Output
/// - Dividend that should be paid out to reach the specified stock price at the horizon
///
/// # Examples
///
/// ```rust
/// use digifi::utilities::TEST_ACCURACY;
/// use digifi::corporate_finance::dcf_dividend_until_horizon;
///
/// let dividend: f64 = dcf_dividend_until_horizon(100.0, 103.71078349920816, 3.5, 0.03, 0.01).unwrap();
///
/// assert!((dividend - 2.0).abs() < TEST_ACCURACY);
/// ```