File : numerics-ops.adb


with Ada.Numerics.Generic_Elementary_Functions;

pragma Elaborate_All (Ada.Numerics.Generic_Elementary_Functions);

package body Numerics.Ops is

  package Numeric_EF is new Ada.Numerics.Generic_Elementary_Functions(Numeric);

  function "*"(R: Rep; S: Numeric) return Numeric is
  begin
    return Numeric(R)*S;
  end "*";

  function "/"(S: Numeric; R: Rep) return Numeric is
  begin
    return S/Numeric(R);
  end "/";

  function Sqr(S: Numeric) return Numeric is
  begin
    return S*S;
  end Sqr;

  function Inv(S: Numeric) return Numeric is
  begin
    return Numeric(1.0)/S;
  end Inv;

  function Lambda(M,N: Integer) return Numeric is
  begin
    return Numeric(M)-Numeric(2*N)/(Numeric_EF.Sqrt(Numeric(5.0))+Numeric(1.0));
  end Lambda;

  function Cosh(S: Numeric) return Numeric renames Numeric_EF.Cosh;
  function Sinh(S: Numeric) return Numeric renames Numeric_EF.Sinh;
  function Exp(S: Numeric) return Numeric renames Numeric_EF.Exp;
  function Log(S: Numeric) return Numeric renames Numeric_EF.Log;

end Numerics.Ops;