TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Transcendentals

Format-generic executable transcendental functions #

Importing BinaryInterchange.Transcendentals adds deterministic exp, log, sinh, cosh, tanh, sin, and cos operations for Model fmt, with reusable fixed-point primitives and explicit approximation configuration.

Approximation and certificates #

Tangent can be computed as sin x / cos x, with rounding after sine, cosine, and division and increased sensitivity near zeros of cosine. There is no dedicated tangent kernel. These functions use nearest-even destination rounding and return values without IEEE status flags.

sinCosResult and sinCosWithResult report arguments beyond the selected configuration's trigonometric exponent budget. Value-only sine and cosine map this failure to invalidResult. Config.generatedFullRange opts into constants large enough for the format's full exponent range, with correspondingly larger generation costs. Successful reduction is not an accuracy certificate.

ExactExpression can round an exactly represented rational expression once, but real transcendentals are not rational operations in general. A composition of these kernels therefore approximates and rounds at each function boundary. Certifying one final rounding for the whole composition requires a real enclosure or another exact-real procedure covering that composition.

Import this module for the Model functions and instances, or FloatLib.Floats.Formats.BinaryInterchange.Configured.Transcendentals for the configured types. These imports add the binary elementary functions to those available from import FloatLib. The MathFunctions class and its host Float and real instances are available by default. Individual kernel submodules can be imported separately; #float_info loads only Contract through BinaryInterchange/Info/Profile.lean.

@[instance_reducible]

Deterministic floating-point exponentiation.

@[instance_reducible]

Generic deterministic transcendental and elementary functions.