Lines Matching +full:long +full:- +full:term
1 // SPDX-License-Identifier: GPL-2.0-only
18 * Originally this was part of drivers/hwmon/bt1-pvt.c.
22 * to PVT data and vice-versa are following:
24 * N = 1.8322e-8*(T^4) + 2.343e-5*(T^3) + 8.7018e-3*(T^2) + 3.9269*(T^1) +
26 * T = -1.6743e-11*(N^4) + 8.1542e-8*(N^3) + -1.8201e-4*(N^2) +
27 * 3.1020e-1*(N^1) - 4.838e1
29 * where T = [-48.380, 147.438]C and N = [0, 1023].
38 * N = (18322e-20*(T^4) + 2343e-13*(T^3) + 87018e-9*(T^2) + 39269e-3*T +
40 * T = -16743e-12*(D^4) + 81542e-9*(D^3) - 182010e-6*(D^2) + 310200e-3*D -
42 * where T = [-48380, 147438] mC and N = [0, 1023].
58 * {4, -16743, 1000, 1},
60 * {2, -182010, 1000, 1},
62 * {0, -48380, 1, 1}
68 * polynomial_calc - calculate a polynomial using integer arithmetic
79 long polynomial_calc(const struct polynomial *poly, long data) in polynomial_calc()
81 const struct polynomial_term *term = poly->terms; in polynomial_calc() local
82 long total_divider = poly->total_divider ?: 1; in polynomial_calc()
83 long tmp, ret = 0; in polynomial_calc()
89 * We walk over each degree term up to the free one, and perform in polynomial_calc()
90 * the redistributed multiplication of the term coefficient, its in polynomial_calc()
97 tmp = term->coef; in polynomial_calc()
98 for (deg = 0; deg < term->deg; ++deg) in polynomial_calc()
99 tmp = mult_frac(tmp, data, term->divider); in polynomial_calc()
100 ret += tmp / term->divider_leftover; in polynomial_calc()
101 } while ((term++)->deg); in polynomial_calc()