-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
11 lines (11 loc) · 1.05 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
<b>Logistic function</b> <a class=right href="https://hyperskill.org/learn/step/6348">Open on JetBrains Academy</a>
<br><br>
<html>
<head></head>
<body>
<p>Write a program that reads an integer and calculates the value of its logistic function. A logistic function, or sigmoid function, is a function defined by the formula <span class="math-tex">\(\sigma(x) = \frac{1}{1 + e^{-x}} = \frac{e^x}{e^{x} + 1}\)</span>.</p>
<p>Print the result <strong>rounded to 2 decimal places</strong>.</p>
<p>You can use <code class="java">math.e</code> constant equal to <code class="java">2.718281…</code> or sort of a shortcut <code class="java">math.exp(x)</code> function, which is considered more accurate than <code class="java">math.e ** x</code> or <code class="java">pow(math.e, x)</code>.</p>
</body>
</html><br><b>Sample Input:</b><br>-40<br><br><b>Sample Output:</b><br>0.0<br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<a href="https://hyperskill.org/learn/step/6256">Show topic summary</a>