This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Find a root of a scalar function */ | |
root_scalar = LAMBDA(f, x_low, x_high, [x_atol], [x_rtol], [y_tol], [max_iter], | |
LET( | |
x_atol, IF(ISOMITTED(x_atol), 0.000000000001, x_atol), | |
x_rtol, IF(ISOMITTED(x_rtol), 0.000001, x_rtol), | |
y_tol, IF(ISOMITTED(y_tol), 1E-22, y_tol), | |
max_iter, IF(ISOMITTED(max_iter), 20, max_iter), | |
f_low, f(x_low), | |
f_high, f(x_high), | |
IF( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2022 Andrea Altomani | |
// Released under the MIT license. See the file `LICENSE`. | |
/** Complex multiplication */ | |
CMULT = LAMBDA(z, w, | |
LET( | |
x, CHOOSECOLS(z, 1), | |
y, CHOOSECOLS(z, 2), | |
u, CHOOSECOLS(w, 1), |