/*
** obscure.ops
*/

#include <math.h>

VERSION = PARROT_VERSION;

=head1 NAME

obscure.ops

=cut

=head1 DESCRIPTION

Parrot's library of obscure ops.

=cut


###############################################################################

=head2 Obscure trigonometric operations

Reference:

    Abramowitz, M. and Stegum, C. A. (Eds.). Handbook of Mathematical
    Functions with Formulas, Graphs, and Mathematical Tables, 9th printing.
    New York: Dover, p. 78, 1972.

=over 4

=cut


########################################

=item B<covers>(n, n)

Set $1 to the coversine (in radians) of $2.

=cut

inline op covers(out NUM, in NUM) {
  $1 = 1.0 - sin($2);
  goto NEXT();
}


########################################

=item B<exsec>(n, n)

Set $1 to the exsecant of $2 (given in radians).

=cut


inline op exsec(out NUM, in NUM) {
  $1 = (1.0 / cos($2)) - 1.0;
  goto NEXT();
}


########################################

=item B<hav>(n, n)

Set $1 to the haversine (in radians) of $2.

=cut

inline op hav(out NUM, in NUM) {
  $1 = 0.5 * (1.0 - cos($2));
  goto NEXT();
}


########################################

=item B<vers>(n, n)

Set $1 to the versine (in radians) of $2.

=cut

inline op vers(out NUM, in NUM) {
  $1 = 1.0 - cos($2);
  goto NEXT();
}


=back

=cut


###############################################################################

=head1 COPYRIGHT

Copyright (C) 2001-2003 The Perl Foundation.  All rights reserved.

=head1 LICENSE

This program is free software. It is subject to the same license
as the Parrot interpreter itself.

=cut

