25 lines
405 B
Julia
Executable file
25 lines
405 B
Julia
Executable file
#!/usr/bin/env julia
|
|
|
|
# Jacek Poziemski 272389
|
|
|
|
import Pkg
|
|
Pkg.add("Plots")
|
|
using Plots
|
|
|
|
"""
|
|
f(x::Float64)::Float64
|
|
|
|
Calculate `e^x * ln(1 + e^-x)`.
|
|
|
|
# Arguments
|
|
- `x::Float64`: argument of the function
|
|
"""
|
|
function f(x::Float64)::Float64
|
|
return exp(x) * log(one(Float64) + exp(-x))
|
|
end
|
|
|
|
x = range(-10, 40, length=1000)
|
|
y = map(x -> f(x), x)
|
|
|
|
plot(x, y, label = "f(x)")
|
|
png("2-julia-plots.png")
|