xref: /freebsd/contrib/arm-optimized-routines/pl/math/tools/log1pf.sollya (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1// polynomial for approximating log(1+x) in single precision
2//
3// Copyright (c) 2022-2023, Arm Limited.
4// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
5
6deg = 10;
7
8a = -0.25;
9b = 0.5;
10
11f = proc(y) {
12  return log(1+y);
13};
14
15poly = fpminimax(f(x), deg, [|single ...|], [a;b]);
16
17display = hexadecimal;
18print("rel error:", accurateinfnorm(1-poly(x)/f(x), [a;b], 30));
19print("in [",a,b,"]");
20print("coeffs:");
21for i from 2 to deg do round(coeff(poly,i), SG, RN);
22