mathutil

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Unlicense Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Acos

func Acos(x float64) float64

func AddBatch

func AddBatch(a, b []float64) []float64

func AddBatchF32

func AddBatchF32(a, b []float32) []float32

func Asin

func Asin(x float64) float64

func Atan

func Atan(x float64) float64

func Cos

func Cos(x float64) float64

func CosBatch

func CosBatch(x []float64) []float64

func CosBatchF32

func CosBatchF32(x []float32) []float32

func Cosh

func Cosh(x float64) float64

func CoshBatch

func CoshBatch(x []float64) []float64

func DivBatch

func DivBatch(a, b []float64) []float64

func Exp

func Exp(x float64) float64

func ExpBatch

func ExpBatch(x []float64) []float64

func ExpBatchF32

func ExpBatchF32(x []float32) []float32

func FMA

func FMA(x, y, z float64) float64

func IsEML

func IsEML() bool

IsEML returns true if the EMLGo backend is active. Without the "emlgo" build tag, this always returns false.

func IsFloat64Excluded

func IsFloat64Excluded() bool

func IsForceStandard

func IsForceStandard() bool

IsForceStandard is always false without the emlgo build tag.

func Log

func Log(x float64) float64

func LogBatch

func LogBatch(x []float64) []float64

func MulBatch

func MulBatch(a, b []float64) []float64

func MulBatchF32

func MulBatchF32(a, b []float32) []float32

func NegBatch

func NegBatch(x []float64) []float64

func Pow

func Pow(x, y float64) float64

func PowBatch

func PowBatch(x []float64, y float64) []float64

func PushStandard

func PushStandard() (restore func())

PushStandard is a no-op without the emlgo build tag (backend is always standard).

func SetBackend

func SetBackend(b Backend)

SetBackend changes the active math backend globally. Without the "emlgo" build tag, switching to BackendEML is a no-op.

func SetFloat64Excluded

func SetFloat64Excluded(excluded bool)

Part 7: float64 exclusion stub — no-op without emlgo build tag

func Sin

func Sin(x float64) float64

func SinBatch

func SinBatch(x []float64) []float64

func SinBatchF32

func SinBatchF32(x []float32) []float32

func Sinh

func Sinh(x float64) float64

func SinhBatch

func SinhBatch(x []float64) []float64

func Sqrt

func Sqrt(x float64) float64

func SqrtBatch

func SqrtBatch(x []float64) []float64

func SubBatch

func SubBatch(a, b []float64) []float64

func Tan

func Tan(x float64) float64

func TanBatch

func TanBatch(x []float64) []float64

func Tanh

func Tanh(x float64) float64

func TanhBatch

func TanhBatch(x []float64) []float64

Types

type Backend

type Backend int32

Backend identifies which math kernel backend is active.

const (
	// BackendStandard routes calculations to Go's standard "math" library.
	BackendStandard Backend = 0
	// BackendEML routes calculations to the high-performance EMLGo SIMD & fastmath library.
	BackendEML Backend = 1
)

func GetBackend

func GetBackend() Backend

GetBackend returns the currently active math backend.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL