I am trying to plot this function:
#lang racket
(define (smoothsquare x)
((smooth square) x))
(define (square x)
(* x x))
(require plot)
(plot (function smoothsquare (- 1) 1))
(define dx 0.00001)
(define (smooth f)
(lambda (x) (/ (+ (f (- x dx))
(f x)
(f (+ x dx)))
3)))
but I get the following error: ". plot: could not determine sensible plot bounds; got x ∈ [-1,1], y ∈ [#f,#f]"
Why is that? Is there a way around this? I can think of a sensible plot bound for the y-axis, namely [-1,1], but I'm not sure how to tell it that.
I have read the intro here https://docs.racket-lang.org/plot/intro.html but it isn't helping me