obliczenia_naukowe/l2/2.jl
2024-11-11 00:40:18 +01:00

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")