Skip to content

sigilante/saloon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Scientific ALgorithms in hOON

wip as of ~2023.3.24

Transcendental and algebraic functions in native Hoon (and later jets).

It's time to supersede lazytrig.

Arms in ++rs and other @r-servicing cores will be provided with necessary transcendental and trigonometric functions.

As a first pass, we implement operators for @rs, @rd, @rq, and @rh. After Lagoon is merged, we implement @lvs, @lms, @lvd, and @lmd.

  • @rs
  • @rd
  • @rq
  • @rh
  • @rsc
  • @rdc
  • @rqc
  • @rhc
  • @lvs
  • @lvd
  • @lvq
  • @lvh
  • @lms
  • @lmd
  • @lmq
  • @lmh

This requires us to finally resolves the treatment of complex numbers in Hoon (which I've here noted as @rsc etc.).

  • Possible four-letter alternative names: sake, salt, saxe, soon, star
  • Possible two-letter core names: sa, sl

Checkmarks are a first pass in @rs single-precision floating-point implementation:

Constants

  • pi
  • e
  • i (complex only)
  • phi
  • sqrt2

Comparison

  • isclose
  • allclose (over a (list @r))
  • isint
  • isreal (complex only)
  • isimag (complex only)

Algebraic

  • sgn (also ++sig for compatibility)
  • abs
  • sqrt
  • cbrt
  • arg
  • conj (complex conjugate) (complex only)
  • pow
  • pown (faster integer pow)
  • log
  • log10
  • log2
  • exp
  • binomial (Binomial coefficient)

Trigonometric

  • sin
  • cos
  • tan
  • csc
  • sec
  • cot
  • arcsin
  • arccos
  • arctan
  • arccsc
  • arcsec
  • arccot
  • crd (chord)
  • siv (versine)

Hyperbolic

  • sinh
  • cosh
  • tanh
  • csch
  • sech
  • coth
  • arcsinh
  • arccosh
  • arctanh
  • arccsch
  • arcsech
  • arccoth

Analytical

  • besselj
  • bessely
  • besseli
  • besselk
  • ai
  • bi
  • gamma
  • elliptic
  • zeta

Operations

  • round (regular banker's roundaing)
    • round-decimal (rounding to specific accuracy, e.g. .100.01)
  • linspace (++gulf which evenly spans a range in floating-point)
  • iota (APL-style ++gulf in floating-point)
  • diff (placeholder for adaptive algorithm in future)
    • difffinite (finite difference)
    • diffpade (Padé approximation)
  • integrate (placeholder for adaptive algorithm as door in future)
    • inttrapez (trapezoid rule)
    • intsimpson (Simpson's rule)
  • newton (locate a function zero using Newton's method)

The library will pass through ++rs behaviors for ++add and so forth for ease of use. Thus Saloon's ++rs can act as a drop-in core for almost all Hoon ++rs arms (except ++exp and ++ma).

References

About

Scientific ALgorithms in hOON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages