Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
3 answers
273 views

I am implementing a method berechneCosinus(float x, int ordnung) in Java that should approximate the cosine of x using the Taylor series up to the specified order. My questions: Can I optimize the ...
Andre's user avatar
  • 19
4 votes
1 answer
135 views

Consider the following function: ƒ(x) = sin(sqrt(x)) / sqrt(x) if x > 0 ƒ(x) = 1 if x = 0 ƒ(x) = sinh(sqrt(-x)) / sqrt(-x) if x < 0 This is an entire function with a Taylor series at 0 of: 1/1!...
emacs drives me nuts's user avatar
8 votes
2 answers
759 views

First, it is most compact sine approximation ever. It seems i can do better than Remez in terms of precision/performance. Here [0,pi/2] approximation range. double p[] = -0.0020836519336891552, -0....
minorlogic's user avatar
  • 2,055
0 votes
2 answers
156 views

I have 2 approximations for both functions, however the log2(x) takes in an FP number, and outputs a fixed point number; and the 2^x takes in an integer, and outputs a floating point number. the ...
auzifriend's user avatar
2 votes
1 answer
163 views

It is a famous question which asked about finding longest nondecreasing subsequence from a given array. The question is well studied and have O(n log n) time complexity solutions. I have encountered a ...
tsh's user avatar
  • 4,838
2 votes
1 answer
97 views

I am trying to approximate 255 / sqrt(x) using Newton's method to avoid using division or the sqrt() operation on an architecture where those operations are expensive. My derivation is: y = 255 / sqrt(...
the five states's user avatar
2 votes
2 answers
189 views

Here is a function to approximate log10(x+1) for (x+1) < ~1.2: a = 1.097 b = 0.085 c = 2.31 ans = 1 / (a - b*x + c/x) It should look like that: It works by adjusting harmonic mean to match log10,...
luaenjoyer's user avatar
1 vote
2 answers
186 views

I'm trying to generate a decent [3,1] rational least squares polynomial approximation to asin(x)+sqrt(1-x^2) on [0,1] and failing dismally :( The problem is that it has a pole for this particular ...
Martin Brown's user avatar
  • 3,666
1 vote
0 answers
109 views

While implementing the mandelbrot set using java, I found that the rendering time of the program is ridiculously slower than other programs. public class FractalFormula { private Complex[] ...
noen's user avatar
  • 61
0 votes
0 answers
70 views

The value depends on three variables. I have a data set of type [x,y,z,w]. Here x,y,z are the input variables and w is the output result. Can I use maple to find a function that approximates a given ...
serj-great's user avatar
1 vote
0 answers
39 views

I currently deals with optimization problems with a convex constraint function by cvx. I consider approximating the function by point-wise maximum function composed of the tangent lines that can be ...
Takumi's user avatar
  • 11
1 vote
0 answers
32 views

given a set of n points P and a nxn matrix M such that for every two point u,v where M[u,v] is the distance between u and v , and the distance is pseudo metric, is there a property testing algorithem ...
usul's user avatar
  • 11
2 votes
2 answers
668 views

I have data x and y which are noisy evaluations of a function f:[0,alpha] -> [0,1]. I know very little about my function except that f(0) = 0 and f(alpha) = 1. Is there any way to enforce these ...
Geordie Williamson's user avatar
0 votes
0 answers
285 views

I have a question regarding my code. I have to solve an ODE: [y′(t)=(0.5−t)(y(t) + 1), y(0) = 1], numerically (and approximate), using the explicit and implicit Euler as well as the trapezoid method ...
juzze's user avatar
  • 3
0 votes
1 answer
51 views

There are some SO posts on calculating accuracy of a classification model in PyTorch, but I how do I calculate accuracy of an approximation model? For example, for classifications, I can usually count,...
Sagi Mann's user avatar
  • 3,708
-1 votes
1 answer
70 views

How do i construct a polynomial x1*x2*Ai(x1-x2)^n in python, n=6. I need it for approximation. Also I need to extract Ai. x1 and x2 are a set of experimental data. I don't really know how to do it. I ...
0 votes
0 answers
57 views

I have a tabular function of two vectors x and y x y -5.00000000000000e+000 9.08419036515801e+000 -4.86884290294375e+000 9.18474413956781e+000 -4.86842653120706e+000 9.28030145313736e+000 -4....
Дмитрий's user avatar
1 vote
1 answer
90 views

I want to approximate cos(x) from 0 to pi/4 using a quadratic polynomial. I believe I could train a perceptron using (say 1000) points in my range, with training inputs (x^2, x, 1) and with training ...
Leonardo Rioja's user avatar
1 vote
0 answers
102 views

Imagine that you have a bunch of points in R3, each with a value (say, temperature). You want to construct a regular grid in R3 and compute a value at each grid point, such that if you then use ...
Andrew Certain's user avatar
1 vote
0 answers
92 views

I'm using approx function on 2 identical list : unlist(fp_st_4_main[[1]],fp_st_4_main_extr[[1]]) 0.02438017 0.03842975 0.04504132 0.07231405 0.08884298 0.09917355 0.11363636 0.12644628 0.13966942 0....
liza read's user avatar
2 votes
3 answers
376 views

We must use a while loop to solve this problem (approximating the value of cos to within - or + 1-e10 ) and I believe I have all the right setup but I keep getting the error "missing value where ...
user23327933's user avatar
2 votes
4 answers
394 views

I'm attempting to approximate the constant e using 100,000 iterations and display the results where i is in multiples of 10,000 ranging from 10,000 to 100,000. The code I have is this: import math e =...
trb7074's user avatar
  • 53
2 votes
3 answers
152 views

I'm trying to compute about 1 trillion different pairwise jaccard scores on a laptop. I'm also not very patient. Each set tends to contain about 200-800 unique, pseudorandom 32-bit hashes. I've ...
Some Java Programmer's user avatar
0 votes
1 answer
621 views

Consider: Curve fit using Python SciPy I'm trying to find an algorithm to fit a sine curve into a data set. This is quite simple using Python SciPy, but now I have to bring the whole algorithm to an ...
Huy Pham's user avatar
0 votes
0 answers
70 views

In 3D, I need to find the cord length based on forces that describe the cord. I tried to do this, based on the following code with the following inputs: H the constant horizontal force q_verti the ...
Tim Moore's user avatar
1 vote
1 answer
198 views

I am trying to approximate 3d triangles with rectangular prisms but I cant figure out the math Im using lua Ive tried flattening the triangle to a 2d plane and approximating the triangles with normal ...
Bug's user avatar
  • 13
3 votes
3 answers
202 views

I am looking primarily for a theoretical answer, ideally one addressing my misunderstanding (below) about binary search algorithms. Practical examples are welcome as well. I have a complex function ...
Dennis's user avatar
  • 8,151
1 vote
1 answer
643 views

I am trying to find a matrix that satisfies six matrix equations. The equations are as follows: (Conjugate[ConjugateTranspose[B1]].X.ConjugateTranspose[B1]) == TotalPrB1, (Conjugate[ConjugateTranspose[...
Ruthless_Tornado's user avatar
0 votes
1 answer
252 views

Before approximating the data of my calculations, I decided to test the code on data from Q. Zhang, N. Sabelli, V. Buch; Potential energy surface of H⋅⋅⋅H2O. J. Chem. Phys. 15 July 1991; 95 (2): 1080–...
One-eight greek's user avatar
0 votes
0 answers
188 views

On paper it seems quite simple so forgive me if I'm missing something obvious. I've got 2 input arrays X1 and X2 of the same shape, and a target array Y also of the same shape. I'd like to combine X1 ...
Mike's user avatar
  • 11
0 votes
1 answer
541 views

I have n points on a unit sphere (n up to 10^9). I need to find nearest approximations of these points by n_samples Fibonacci sphere points (n_samples in my case is 65536). I.e. for each input point, ...
user2052436's user avatar
  • 5,087
23 votes
3 answers
14k views

If you were reading news about developments in graphics in the 1990s, you might have followed Jim Blinn's column in IEEE Computer Graphics & Applications, "Jim Blinn's corner." In the ...
Adam Hyland's user avatar
  • 1,077
0 votes
0 answers
87 views

Consider the following clustering algorithm in a semi-streaming setting. Suppose edges of a graph are coming in a stream and the clustering is done in the following way. Here N(u) denotes the ...
Sandra's user avatar
  • 101
0 votes
1 answer
310 views

The Cephes implementation of log1p is described in the documentation as Coefficients for log(1+x) = x - x**2/2 + x**3 P(x)/Q(x) where P(x) and Q(x) are two polynomials (with Q(x) a monic polynomial. ...
John's user avatar
  • 405
0 votes
1 answer
58 views

I am trying to speed up the following code that computes: where I only need to compute this function for x > y from 0 to 1 (but need very high discretization like dt = 0.001). I have vectorized my ...
Luke Bhan's user avatar
1 vote
1 answer
88 views

I want to compute the exact and an approximation of the Cumulative Distribution Function for the following density : f(x)= U(x;-1,2)/2 + U(x;0,1)/2 where U(.;a,b) is the uniform density function on ...
Smilia's user avatar
  • 123
2 votes
0 answers
94 views

I posted this question before but since Mathjax is not supported here, I took a picture of the compiled latex file and I am posting a picture of that.
Sandra's user avatar
  • 101
0 votes
1 answer
68 views

To approximate the function with Cheboshev polynomials, it is necessary to operate on the interval [-1,1]. How can these constants be recalculated if I want to approximate on another interval? ...
jeff_dust's user avatar
1 vote
0 answers
69 views

Problem I want to count the number of page hits that my site gets, without relying on an external service, e.g. countapi.xyz, and without invading user privacy by using Google Analytics. Idea ...
retep's user avatar
  • 227
2 votes
0 answers
111 views

Using the fact that Gaussian(λ=σ) is an approximation of Poisson(λ), I want to compute an approximation of Poisson noise using only uniform random numbers without using factorials. There are two ...
nishi's user avatar
  • 21
0 votes
1 answer
2k views

I wrote a very basic evolution algorithm. The way it's supposed to work is that the user types in the desired value, and the amount of generations to try to reach it. Then, the program will run ...
Angus McMillan's user avatar
0 votes
3 answers
554 views

The question is: Calculate the value of π from the infinite series. Print a table that shows the value of π approximated by one term of this series, by two terms, by three terms, and so on. How many ...
Hadiya Kashif's user avatar
1 vote
2 answers
314 views

I am working on the task where I have to Augment the data. For data augmentation, I have to do polynomial approximation of the data (Non linear data). But if I do the polynomial approximation, I am ...
Urvesh's user avatar
  • 465
0 votes
1 answer
244 views

I need to find the kernel (a.k.a. null space) of a 3*3 matrix which is of full rank 3, but very close to being singular and thus of rank 2. This means it has no null space unless you look for it with ...
Xirdal's user avatar
  • 77
0 votes
1 answer
57 views

I have a url with a page system. For instance https://myURL?p=50 But I want a script to find the last page available, for instance, let's say p=187 I have a function checkEmpty() that tells me whether ...
MrJay42's user avatar
  • 79
1 vote
0 answers
434 views

I want to approximate scattered 2D data onto a regular grid with slightly bigger dimensions than the surrounding box of scattered data in Python. My reference is the behavior of the R package mba. I ...
FordPrefect's user avatar
1 vote
1 answer
179 views

I am new to this, and tried to implement this algorithm by using uniform B-Spline. And I don't know where I did it wrong, the result just doesn't come out the way it supposed to be. I don't know if ...
scarlett's user avatar
1 vote
0 answers
176 views

I am integrating a differential equation with Runge-Kutta 2 method in order to obtain an approximate solution y_n(t), where n is a varying initial parameter. Then, for a sample of n's in a chosen ...
Matteo Menghini's user avatar
0 votes
1 answer
127 views

I am integrating an ODE of the first order of the form $\frac{d}{dr}P(r) = f(r)$ with a Runge-Kutta method of the second order (RK2) and the C programming language. I would like to estimate the first ...
Matteo Menghini's user avatar
3 votes
1 answer
109 views

I often find n^O(1/ε) in approximation algorithms. for example, in euclidean tsp, the number of portals(with its possible state) is equal to n^O(1/ε). here is the link to the source http://algo2.iti....
ryan chandra's user avatar

1
2 3 4 5
11