Evaluates the bond-equivalent yield of a Treasury bill.
#include <imsl.h>
float
imsl_f_bond_equivalent_yield (struct
tm settlement,
struct
tm maturity, float discount_rate)
The type double function is imsl_d_bond_equivalent_yield.
struct tm
settlement (Input)
The date on which payment is made to
settle a trade. For a more detailed discussion on dates see the Usage Notes
section of this chapter.
struct tm maturity
(Input)
The date on which the bond comes due, and principal and accrued
interest are paid. For a more detailed discussion on dates see the Usage Notes
section of this chapter.
float
discount_rate (Input)
The interest rate implied when a
security is sold for less than its value at maturity in lieu of interest
payments.
The bond-equivalent yield of a Treasury bill. If no result can be computed, NaN is returned.
Function imsl_f_bond_equivalent_yield computes the bond-equivalent yield for a Treasury bill.
It is computed using the following:


otherwise,

In the above equation, DSM represents the number of days starting at settlement date to maturity date.
In this example, imsl_f_bond_equivalent_yield computes the bond-equivalent yield for a Treasury bill with the settlement date of July 1, 1999, the maturity date of July 1, 2000, and discount rate of 5% at the issue date.
#include <stdio.h>
#include "imsl.h"
void main()
{
struct tm settlement, maturity;
float discount = .05;
float yield;
settlement.tm_year = 99;
settlement.tm_mon = 6;
settlement.tm_mday = 1;
maturity.tm_year = 100;
maturity.tm_mon = 6;
maturity.tm_mday = 1;
yield = imsl_f_bond_equivalent_yield (settlement, maturity, discount);
printf ("The bond-equivalent yield for the T-bill is %.2f%%.\n",
yield * 100.);
}
The bond-equivalent yield for the T-bill is 5.29%.
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |