1// polynomial for approximating exp(x)-1 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 = 5; 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, [|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