calculate_earnings_yield
Calculate the earnings yield: earnings per share divided by share price — the inverse of the P/E ratio, expressing the earnings return on the share price as a percentage. Formula: Earnings Yield = EPS / Share Price. WHEN TO USE: Use to compare equity earnings returns directly against bond yields or the risk-free rate, or as a quick value screen — a high earnings yield can signal a cheap stock. WHEN NOT TO USE: Do NOT use when EPS is negative or zero (the yield is meaningless); use it as a complement to, not a replacement for, the P/E ratio (calculate_pe_ratio). BEHAVIOUR: pure deterministic calculation — no side effects, no network or storage access; idempotent and non-destructive; identical inputs always produce identical outputs. Division by zero or non-finite inputs returns an explicit error instead of a number. RETURNS: JSON object { earnings_yield: decimal (e.g. 0.05 = 5%), earnings_yield_pct: number (e.g. 5.0), pe_ratio: number (e.g. 20 = 20x), inputs }. The P/E ratio is the reciprocal of the earnings yield, returned so a client gets both figures from one call. PARAMETERS: earnings_per_share (required): Earnings per share (trailing or forward), e.g. 2.50. Must be > 0 for a meaningful yield. share_price (required): Current share price in currency units, e.g. 50.00. Must be > 0.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| share_price | Yes | Current share price in currency units, e.g. 50.00. Must be > 0. | |
| earnings_per_share | Yes | Earnings per share (trailing or forward), e.g. 2.50. Must be > 0 for a meaningful yield. |