diff options
Diffstat (limited to 'pl/math/tools/log1p.sollya')
-rw-r--r-- | pl/math/tools/log1p.sollya | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/pl/math/tools/log1p.sollya b/pl/math/tools/log1p.sollya deleted file mode 100644 index 598a36af0339..000000000000 --- a/pl/math/tools/log1p.sollya +++ /dev/null @@ -1,30 +0,0 @@ -// polynomial for approximating log(1+x) in double precision -// -// Copyright (c) 2022-2023, Arm Limited. -// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception - -deg = 20; - -a = sqrt(2)/2-1; -b = sqrt(2)-1; - -f = proc(y) { - return log(1+y); -}; - -approx = proc(poly, d) { - return remez(1 - poly(x)/f(x), deg-d, [a;b], x^d/f(x), 1e-10); -}; - -poly = x; -for i from 2 to deg do { - p = roundcoefficients(approx(poly,i), [|D ...|]); - poly = poly + x^i*coeff(p,0); -}; - - -print("coeffs:"); -display = hexadecimal; -for i from 2 to deg do coeff(poly,i); -print("rel error:", accurateinfnorm(1-poly(x)/f(x), [a;b], 30)); -print("in [",a,b,"]"); |