
(FPCore (x y z t) :precision binary64 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t): return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t) return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))))) end
function tmp = code(x, y, z, t) tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y)))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t): return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t) return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))))) end
function tmp = code(x, y, z, t) tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y)))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (* (- (tanh (/ t y)) (tanh (/ x y))) z) y x))
double code(double x, double y, double z, double t) {
return fma(((tanh((t / y)) - tanh((x / y))) * z), y, x);
}
function code(x, y, z, t) return fma(Float64(Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))) * z), y, x) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)
\end{array}
Initial program 96.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6498.7
Applied rewrites98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.65e+158) (not (<= t 1.7e+26))) (+ x (* (* y z) (/ (pow (/ (+ (/ (fma t (/ t x) t) x) 1.0) (- x)) -1.0) y))) (fma (* (- (/ t y) (tanh (/ x y))) z) y x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.65e+158) || !(t <= 1.7e+26)) {
tmp = x + ((y * z) * (pow((((fma(t, (t / x), t) / x) + 1.0) / -x), -1.0) / y));
} else {
tmp = fma((((t / y) - tanh((x / y))) * z), y, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.65e+158) || !(t <= 1.7e+26)) tmp = Float64(x + Float64(Float64(y * z) * Float64((Float64(Float64(Float64(fma(t, Float64(t / x), t) / x) + 1.0) / Float64(-x)) ^ -1.0) / y))); else tmp = fma(Float64(Float64(Float64(t / y) - tanh(Float64(x / y))) * z), y, x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.65e+158], N[Not[LessEqual[t, 1.7e+26]], $MachinePrecision]], N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Power[N[(N[(N[(N[(t * N[(t / x), $MachinePrecision] + t), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / (-x)), $MachinePrecision], -1.0], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+158} \lor \neg \left(t \leq 1.7 \cdot 10^{+26}\right):\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \frac{{\left(\frac{\frac{\mathsf{fma}\left(t, \frac{t}{x}, t\right)}{x} + 1}{-x}\right)}^{-1}}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\
\end{array}
\end{array}
if t < -1.65000000000000009e158 or 1.7000000000000001e26 < t Initial program 99.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6436.7
Applied rewrites36.7%
Applied rewrites13.9%
Taylor expanded in x around inf
Applied rewrites56.8%
if -1.65000000000000009e158 < t < 1.7000000000000001e26Initial program 94.1%
Taylor expanded in y around inf
lower-/.f6482.9
Applied rewrites82.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6487.0
Applied rewrites87.0%
Final simplification76.3%
(FPCore (x y z t)
:precision binary64
(if (<= y 3.7e-166)
(+ x (* (* y z) (/ (pow (/ (+ 1.0 (/ (+ (/ (* x x) t) x) t)) t) -1.0) y)))
(if (<= y 2.45e-11)
(+
x
(* (* y z) (/ (pow (/ (+ (/ (fma t (/ t x) t) x) 1.0) (- x)) -1.0) y)))
(fma (- t x) z x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.7e-166) {
tmp = x + ((y * z) * (pow(((1.0 + ((((x * x) / t) + x) / t)) / t), -1.0) / y));
} else if (y <= 2.45e-11) {
tmp = x + ((y * z) * (pow((((fma(t, (t / x), t) / x) + 1.0) / -x), -1.0) / y));
} else {
tmp = fma((t - x), z, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 3.7e-166) tmp = Float64(x + Float64(Float64(y * z) * Float64((Float64(Float64(1.0 + Float64(Float64(Float64(Float64(x * x) / t) + x) / t)) / t) ^ -1.0) / y))); elseif (y <= 2.45e-11) tmp = Float64(x + Float64(Float64(y * z) * Float64((Float64(Float64(Float64(fma(t, Float64(t / x), t) / x) + 1.0) / Float64(-x)) ^ -1.0) / y))); else tmp = fma(Float64(t - x), z, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.7e-166], N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Power[N[(N[(1.0 + N[(N[(N[(N[(x * x), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], -1.0], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e-11], N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Power[N[(N[(N[(N[(t * N[(t / x), $MachinePrecision] + t), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / (-x)), $MachinePrecision], -1.0], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.7 \cdot 10^{-166}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \frac{{\left(\frac{1 + \frac{\frac{x \cdot x}{t} + x}{t}}{t}\right)}^{-1}}{y}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-11}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \frac{{\left(\frac{\frac{\mathsf{fma}\left(t, \frac{t}{x}, t\right)}{x} + 1}{-x}\right)}^{-1}}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
\end{array}
\end{array}
if y < 3.7000000000000003e-166Initial program 98.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6443.5
Applied rewrites43.5%
Applied rewrites34.6%
Taylor expanded in t around inf
Applied rewrites55.9%
Taylor expanded in t around inf
Applied rewrites59.2%
if 3.7000000000000003e-166 < y < 2.4499999999999999e-11Initial program 100.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6445.7
Applied rewrites45.7%
Applied rewrites29.9%
Taylor expanded in x around inf
Applied rewrites66.5%
if 2.4499999999999999e-11 < y Initial program 90.8%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6484.9
Applied rewrites84.9%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (<= y 6.3e-18) (+ x (* (* y z) (/ (pow (/ (+ 1.0 (/ (+ (/ (* x x) t) x) t)) t) -1.0) y))) (fma (- t x) z x)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.3e-18) {
tmp = x + ((y * z) * (pow(((1.0 + ((((x * x) / t) + x) / t)) / t), -1.0) / y));
} else {
tmp = fma((t - x), z, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 6.3e-18) tmp = Float64(x + Float64(Float64(y * z) * Float64((Float64(Float64(1.0 + Float64(Float64(Float64(Float64(x * x) / t) + x) / t)) / t) ^ -1.0) / y))); else tmp = fma(Float64(t - x), z, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.3e-18], N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Power[N[(N[(1.0 + N[(N[(N[(N[(x * x), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], -1.0], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.3 \cdot 10^{-18}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \frac{{\left(\frac{1 + \frac{\frac{x \cdot x}{t} + x}{t}}{t}\right)}^{-1}}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
\end{array}
\end{array}
if y < 6.3000000000000004e-18Initial program 98.4%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6443.6
Applied rewrites43.6%
Applied rewrites33.3%
Taylor expanded in t around inf
Applied rewrites54.8%
Taylor expanded in t around inf
Applied rewrites58.8%
if 6.3000000000000004e-18 < y Initial program 90.9%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6485.1
Applied rewrites85.1%
Final simplification66.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- x) z x)))
(if (<= y 8.2e-275)
t_1
(if (<= y 1.55e-195)
(+ x (* (* y z) (pow (/ (fma x (/ y t) y) t) -1.0)))
(if (<= y 5.5e-13) t_1 (fma (- t x) z x))))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-x, z, x);
double tmp;
if (y <= 8.2e-275) {
tmp = t_1;
} else if (y <= 1.55e-195) {
tmp = x + ((y * z) * pow((fma(x, (y / t), y) / t), -1.0));
} else if (y <= 5.5e-13) {
tmp = t_1;
} else {
tmp = fma((t - x), z, x);
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(-x), z, x) tmp = 0.0 if (y <= 8.2e-275) tmp = t_1; elseif (y <= 1.55e-195) tmp = Float64(x + Float64(Float64(y * z) * (Float64(fma(x, Float64(y / t), y) / t) ^ -1.0))); elseif (y <= 5.5e-13) tmp = t_1; else tmp = fma(Float64(t - x), z, x); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) * z + x), $MachinePrecision]}, If[LessEqual[y, 8.2e-275], t$95$1, If[LessEqual[y, 1.55e-195], N[(x + N[(N[(y * z), $MachinePrecision] * N[Power[N[(N[(x * N[(y / t), $MachinePrecision] + y), $MachinePrecision] / t), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-13], t$95$1, N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-x, z, x\right)\\
\mathbf{if}\;y \leq 8.2 \cdot 10^{-275}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-195}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot {\left(\frac{\mathsf{fma}\left(x, \frac{y}{t}, y\right)}{t}\right)}^{-1}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
\end{array}
\end{array}
if y < 8.19999999999999949e-275 or 1.55000000000000001e-195 < y < 5.49999999999999979e-13Initial program 98.3%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6453.8
Applied rewrites53.8%
Taylor expanded in x around inf
Applied rewrites56.7%
if 8.19999999999999949e-275 < y < 1.55000000000000001e-195Initial program 100.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f649.7
Applied rewrites9.7%
Applied rewrites9.7%
Taylor expanded in t around inf
Applied rewrites51.4%
if 5.49999999999999979e-13 < y Initial program 90.8%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6484.9
Applied rewrites84.9%
Final simplification64.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.9e+48) (not (<= t 8e-7))) (fma (* (- (tanh (/ t y)) (/ x y)) z) y x) (fma (* (- (/ t y) (tanh (/ x y))) z) y x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e+48) || !(t <= 8e-7)) {
tmp = fma(((tanh((t / y)) - (x / y)) * z), y, x);
} else {
tmp = fma((((t / y) - tanh((x / y))) * z), y, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.9e+48) || !(t <= 8e-7)) tmp = fma(Float64(Float64(tanh(Float64(t / y)) - Float64(x / y)) * z), y, x); else tmp = fma(Float64(Float64(Float64(t / y) - tanh(Float64(x / y))) * z), y, x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.9e+48], N[Not[LessEqual[t, 8e-7]], $MachinePrecision]], N[(N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[(x / y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+48} \lor \neg \left(t \leq 8 \cdot 10^{-7}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot z, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\
\end{array}
\end{array}
if t < -2.8999999999999999e48 or 7.9999999999999996e-7 < t Initial program 96.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.0
Applied rewrites99.0%
Taylor expanded in x around 0
lower-/.f6476.1
Applied rewrites76.1%
if -2.8999999999999999e48 < t < 7.9999999999999996e-7Initial program 96.2%
Taylor expanded in y around inf
lower-/.f6489.1
Applied rewrites89.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6491.1
Applied rewrites91.1%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (<= y 5.5e-13) (fma (- x) z x) (fma (- t x) z x)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.5e-13) {
tmp = fma(-x, z, x);
} else {
tmp = fma((t - x), z, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 5.5e-13) tmp = fma(Float64(-x), z, x); else tmp = fma(Float64(t - x), z, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 5.5e-13], N[((-x) * z + x), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
\end{array}
\end{array}
if y < 5.49999999999999979e-13Initial program 98.4%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6451.5
Applied rewrites51.5%
Taylor expanded in x around inf
Applied rewrites54.7%
if 5.49999999999999979e-13 < y Initial program 90.8%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6484.9
Applied rewrites84.9%
(FPCore (x y z t) :precision binary64 (fma (- x) z x))
double code(double x, double y, double z, double t) {
return fma(-x, z, x);
}
function code(x, y, z, t) return fma(Float64(-x), z, x) end
code[x_, y_, z_, t_] := N[((-x) * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-x, z, x\right)
\end{array}
Initial program 96.2%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6461.2
Applied rewrites61.2%
Taylor expanded in x around inf
Applied rewrites58.6%
(FPCore (x y z t) :precision binary64 (* z t))
double code(double x, double y, double z, double t) {
return z * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = z * t
end function
public static double code(double x, double y, double z, double t) {
return z * t;
}
def code(x, y, z, t): return z * t
function code(x, y, z, t) return Float64(z * t) end
function tmp = code(x, y, z, t) tmp = z * t; end
code[x_, y_, z_, t_] := N[(z * t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot t
\end{array}
Initial program 96.2%
Taylor expanded in y around inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6461.2
Applied rewrites61.2%
Taylor expanded in x around 0
Applied rewrites13.1%
(FPCore (x y z t) :precision binary64 (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))
double code(double x, double y, double z, double t) {
return x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (y * (z * (tanh((t / y)) - tanh((x / y)))))
end function
public static double code(double x, double y, double z, double t) {
return x + (y * (z * (Math.tanh((t / y)) - Math.tanh((x / y)))));
}
def code(x, y, z, t): return x + (y * (z * (math.tanh((t / y)) - math.tanh((x / y)))))
function code(x, y, z, t) return Float64(x + Float64(y * Float64(z * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))) end
function tmp = code(x, y, z, t) tmp = x + (y * (z * (tanh((t / y)) - tanh((x / y))))); end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(z * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)
\end{array}
herbie shell --seed 2024309
(FPCore (x y z t)
:name "SynthBasics:moogVCF from YampaSynth-0.2"
:precision binary64
:alt
(! :herbie-platform default (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))