1// polynomial for approximating double precision tan(x)
2//
3// Copyright (c) 2023, Arm Limited.
4// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
5
6deg = 8;
7
8// interval bounds
9a = 0x1.0p-126;
10b = pi / 8;
11
12display = hexadecimal;
13
14f = (tan(sqrt(x))-sqrt(x))/x^(3/2);
15poly = fpminimax(f, deg, [|double ...|], [a*a;b*b]);
16
17//print("rel error:", accurateinfnorm(1-poly(x)/f(x), [a;b], 30));
18print("in [",a,b,"]");
19print("coeffs:");
20for i from 0 to deg do coeff(poly,i);
21