propeller/docs/propeller.tools.math.html
2023-03-29 15:14:56 -04:00

23 lines
21 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>propeller.tools.math documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Propeller</span> <span class="project-version">0.3.2</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="A_Guide_To_Propeller.html"><div class="inner"><span>A Guide to Propeller</span></div></a></li><li class="depth-1 "><a href="Adding_Genetic_Operators.html"><div class="inner"><span>Adding Genetic Operators</span></div></a></li><li class="depth-1 "><a href="Adding_Problem.html"><div class="inner"><span>Adding a Problem</span></div></a></li><li class="depth-1 "><a href="Adding_Selection_Method.html"><div class="inner"><span>Adding a Selection Method</span></div></a></li><li class="depth-1 "><a href="Additional_Instructions.html"><div class="inner"><span>Additional Instructions</span></div></a></li><li class="depth-1 "><a href="Generating_Documentation.html"><div class="inner"><span>Generating Documentation for Propeller</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>propeller</span></div></div></li><li class="depth-2 branch"><a href="propeller.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-2 branch"><a href="propeller.gp.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gp</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>problems</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>PSB1</span></div></div></li><li class="depth-4 branch"><a href="propeller.problems.PSB1.count-odds.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>count-odds</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB1.grade.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>grade</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB1.scrabble-score.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrabble-score</span></div></a></li><li class="depth-4"><a href="propeller.problems.PSB1.small-or-large.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>small-or-large</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>PSB2</span></div></div></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.basement.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>basement</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.bouncing-balls.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bouncing-balls</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.bowling.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bowling</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.camel-case.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>camel-case</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.dice-game.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>dice-game</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.fizz-buzz.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fizz-buzz</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.fuel-cost.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fuel-cost</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.gcd.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gcd</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.luhn.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>luhn</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.middle-character.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middle-character</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.paired-digits.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>paired-digits</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.shopping-list.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>shopping-list</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.snow-day.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>snow-day</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.solve-boolean.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>solve-boolean</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.spin-words.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>spin-words</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.square-digits.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>square-digits</span></div></a></li><li class="depth-4 branch"><a href="propeller.problems.PSB2.substitution-cipher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>substitution-cipher</span></div></a></li><li class="depth-4"><a href="propeller.problems.PSB2.twitter.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twitter</span></div></a></li><li class="depth-3 branch"><a href="propeller.problems.complex-regression.html"><div class="inner"><span class="tree" style="top: -579px;"><span class="top" style="height: 588px;"></span><span class="bottom"></span></span><span>complex-regression</span></div></a></li><li class="depth-3 branch"><a href="propeller.problems.float-regression.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>float-regression</span></div></a></li><li class="depth-3 branch"><a href="propeller.problems.integer-regression.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>integer-regression</span></div></a></li><li class="depth-3 branch"><a href="propeller.problems.simple-classification.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simple-classification</span></div></a></li><li class="depth-3 branch"><a href="propeller.problems.simple-regression.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simple-regression</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>software</span></div></div></li><li class="depth-4 branch"><a href="propeller.problems.software.number-io.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>number-io</span></div></a></li><li class="depth-4"><a href="propeller.problems.software.smallest.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>smallest</span></div></a></li><li class="depth-3 branch"><a href="propeller.problems.string-classification.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>string-classification</span></div></a></li><li class="depth-3"><a href="propeller.problems.valiant.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>valiant</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -1075px;"><span class="top" style="height: 1084px;"></span><span class="bottom"></span></span><span>push</span></div></div></li><li class="depth-3"><a href="propeller.push.instructions.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>instructions</span></div></a></li><li class="depth-4 branch"><a href="propeller.push.instructions.bool.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bool</span></div></a></li><li class="depth-4 branch"><a href="propeller.push.instructions.character.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>character</span></div></a></li><li class="depth-4 branch"><a href="propeller.push.instructions.code.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>code</span></div></a></li><li class="depth-4 branch"><a href="propeller.push.instructions.input-output.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>input-output</span></div></a></li><li class="depth-4 branch"><a href="propeller.push.instructions.numeric.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>numeric</span></div></a></li><li class="depth-4 branch"><a href="propeller.push.instructions.polymorphic.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>polymorphic</span></div></a></li><li class="depth-4 branch"><a href="propeller.push.instructions.string.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>string</span></div></a></li><li class="depth-4"><a href="propeller.push.instructions.vector.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vector</span></div></a></li><li class="depth-3 branch"><a href="propeller.push.interpreter.html"><div class="inner"><span class="tree" style="top: -269px;"><span class="top" style="height: 278px;"></span><span class="bottom"></span></span><span>interpreter</span></div></a></li><li class="depth-3 branch"><a href="propeller.push.limits.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>limits</span></div></a></li><li class="depth-3"><a href="propeller.push.state.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>state</span></div></a></li><li class="depth-2 branch"><a href="propeller.selection.html"><div class="inner"><span class="tree" style="top: -393px;"><span class="top" style="height: 402px;"></span><span class="bottom"></span></span><span>selection</span></div></a></li><li class="depth-2 branch"><a href="propeller.simplification.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simplification</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tools</span></div></div></li><li class="depth-3 branch"><a href="propeller.tools.calculus.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>calculus</span></div></a></li><li class="depth-3 branch"><a href="propeller.tools.character.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>character</span></div></a></li><li class="depth-3 branch"><a href="propeller.tools.distributions.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>distributions</span></div></a></li><li class="depth-3 branch current"><a href="propeller.tools.math.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>math</span></div></a></li><li class="depth-3"><a href="propeller.tools.metrics.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>metrics</span></div></a></li><li class="depth-2 branch"><a href="propeller.utils.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="propeller.variation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>variation</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="propeller.tools.math.html#var-abs"><div class="inner"><span>abs</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-approx.3D"><div class="inner"><span>approx=</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-ceil"><div class="inner"><span>ceil</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-cos"><div class="inner"><span>cos</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-div"><div class="inner"><span>div</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-exp"><div class="inner"><span>exp</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-floor"><div class="inner"><span>floor</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-log"><div class="inner"><span>log</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-mean"><div class="inner"><span>mean</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-median"><div class="inner"><span>median</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-median-absolute-deviation"><div class="inner"><span>median-absolute-deviation</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-pow"><div class="inner"><span>pow</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-root"><div class="inner"><span>root</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-round"><div class="inner"><span>round</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-sign"><div class="inner"><span>sign</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-sin"><div class="inner"><span>sin</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-sqrt"><div class="inner"><span>sqrt</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-square"><div class="inner"><span>square</span></div></a></li><li class="depth-1"><a href="propeller.tools.math.html#var-tan"><div class="inner"><span>tan</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">propeller.tools.math</h1><div class="doc"><div class="markdown"><p>Math functions.</p>
</div></div><div class="public anchor" id="var-abs"><h3>abs</h3><div class="usage"><code>(abs x)</code></div><div class="doc"><div class="markdown"><p>Returns the absolute value of a number.</p>
</div></div></div><div class="public anchor" id="var-approx.3D"><h3>approx=</h3><div class="usage"><code>(approx= x y epsilon)</code></div><div class="doc"><div class="markdown"><p>Returns true if the absolute difference between x and y is less than or equal to some specified error level, epsilon.</p>
</div></div></div><div class="public anchor" id="var-ceil"><h3>ceil</h3><div class="usage"><code>(ceil x)</code></div><div class="doc"><div class="markdown"><p>Returns the smallest integer greater than or equal to x.</p>
</div></div></div><div class="public anchor" id="var-cos"><h3>cos</h3><div class="usage"><code>(cos x)</code></div><div class="doc"><div class="markdown"><p>Returns the cosine of an angle (specified in radians).</p>
</div></div></div><div class="public anchor" id="var-div"><h3>div</h3><div class="usage"><code>(div x y)</code></div><div class="doc"><div class="markdown"><p>Returns the result of floating point division between x and y.</p>
</div></div></div><div class="public anchor" id="var-exp"><h3>exp</h3><div class="usage"><code>(exp x)</code></div><div class="doc"><div class="markdown"><p>Returns Eulers number (approx. 2.71) raised to the given power.</p>
</div></div></div><div class="public anchor" id="var-floor"><h3>floor</h3><div class="usage"><code>(floor x)</code></div><div class="doc"><div class="markdown"><p>Returns the largest integer less than or equal to x.</p>
</div></div></div><div class="public anchor" id="var-log"><h3>log</h3><div class="usage"><code>(log x base)</code><code>(log x)</code></div><div class="doc"><div class="markdown"><p>Returns the logarithm of x with the given base. If called with only one argument, returns the natural logarithm (base e) of the given value.</p>
</div></div></div><div class="public anchor" id="var-mean"><h3>mean</h3><div class="usage"><code>(mean coll)</code></div><div class="doc"><div class="markdown"><p>Returns the mean.</p>
</div></div></div><div class="public anchor" id="var-median"><h3>median</h3><div class="usage"><code>(median coll)</code></div><div class="doc"><div class="markdown"><p>Returns the median.</p>
</div></div></div><div class="public anchor" id="var-median-absolute-deviation"><h3>median-absolute-deviation</h3><div class="usage"><code>(median-absolute-deviation coll)</code></div><div class="doc"><div class="markdown"><p>Returns the median absolute deviation.</p>
</div></div></div><div class="public anchor" id="var-pow"><h3>pow</h3><div class="usage"><code>(pow x n)</code></div><div class="doc"><div class="markdown"><p>Returns the value obtained by raising the first argument to the power of the second argument.</p>
</div></div></div><div class="public anchor" id="var-root"><h3>root</h3><div class="usage"><code>(root x n)</code></div><div class="doc"><div class="markdown"><p>Returns the root of x with base n.</p>
</div></div></div><div class="public anchor" id="var-round"><h3>round</h3><div class="usage"><code>(round x)</code></div><div class="doc"><div class="markdown"><p>Returns the value of x rounded to the nearest integer.</p>
</div></div></div><div class="public anchor" id="var-sign"><h3>sign</h3><div class="usage"><code>(sign x)</code></div><div class="doc"><div class="markdown"><p>Returns the 1 if the argument is positive, -1 if the argument is negative, and 0 if the argument is zero.</p>
</div></div></div><div class="public anchor" id="var-sin"><h3>sin</h3><div class="usage"><code>(sin x)</code></div><div class="doc"><div class="markdown"><p>Returns the sine of an angle (specified in radians).</p>
</div></div></div><div class="public anchor" id="var-sqrt"><h3>sqrt</h3><div class="usage"><code>(sqrt x)</code></div><div class="doc"><div class="markdown"><p>Returns the square root of the given value.</p>
</div></div></div><div class="public anchor" id="var-square"><h3>square</h3><div class="usage"><code>(square x)</code></div><div class="doc"><div class="markdown"><p>Returns the square of the given value.</p>
</div></div></div><div class="public anchor" id="var-tan"><h3>tan</h3><div class="usage"><code>(tan x)</code></div><div class="doc"><div class="markdown"><p>Returns the tangent of an angle (specified in radians).</p>
</div></div></div></div></body></html>