xref: /freebsd/contrib/arm-optimized-routines/pl/math/tools/cbrtf.sollya (revision 1c4ee7dfb8affed302171232b0f612e6bcba3c10)
1// polynomial for approximating cbrt(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 = 3;
7
8a = 0.5;
9b = 1;
10
11
12f = x^(1/3);
13
14poly = fpminimax(f, deg, [|single ...|], [a;b]);
15
16display = hexadecimal;
17print("rel error:", accurateinfnorm(1-poly(x)/f(x), [a;b], 30));
18print("in [",a,b,"]");
19print("coeffs:");
20for i from 0 to deg do round(coeff(poly,i), SG, RN);
21