xref: /freebsd/contrib/arm-optimized-routines/pl/math/tools/expm1.sollya (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1// polynomial for approximating exp(x)-1 in double precision
2//
3// Copyright (c) 2022-2023, Arm Limited.
4// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
5
6deg = 12;
7
8a = -log(2)/2;
9b = log(2)/2;
10
11f = proc(y) {
12  return exp(y)-1;
13};
14
15poly = fpminimax(f(x), deg, [|double ...|], [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), D, RN);
22