Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Beazley's Problem Date: Mon, 23 Sep 2024 17:22:27 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: <87h6a5lx30.fsf@nightsong.com> References: <87tte941ko.fsf@nightsong.com> <87plow4v4p.fsf@nightsong.com> <0709b4b8b0bbf2a32d53649d1a6fbefbcd44a68a.camel@tilde.green> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Tue, 24 Sep 2024 02:22:28 +0200 (CEST) Injection-Info: dont-email.me; posting-host="5802c01959a5df245c2a5a0646fadea0"; logging-data="3064986"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bD/Ky6qZrHVN2Kt4SksBK" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:+W6NnIryRoYgTJTkWNoi+hVsfY0= sha1:n+Dy/xANJ0jmSmmHT0mXvHr1hG4= Bytes: 1711 ram@zedat.fu-berlin.de (Stefan Ram) writes: > Nobody up the thread was claiming it was functional. And you can > totally implement anything in an imperative or functional style. Yeah the confusion was because I posted a link to "Why FP Matters", which discusses these sorts of numerical hacks. > def f_prime(x: float) -> float: > return 2*x You might enjoy implementing that with automatic differentiation (not to be confused with symbolic differentiation) instead. http://blog.sigfpe.com/2005/07/automatic-differentiation.html