
(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 (let* ((t_1 (+ x (* (- (tanh (/ t y)) (tanh (/ x y))) (* y z))))) (if (<= t_1 1e+281) t_1 (+ (* z t) (* x (- 1.0 z))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((tanh((t / y)) - tanh((x / y))) * (y * z));
double tmp;
if (t_1 <= 1e+281) {
tmp = t_1;
} else {
tmp = (z * t) + (x * (1.0 - z));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((tanh((t / y)) - tanh((x / y))) * (y * z))
if (t_1 <= 1d+281) then
tmp = t_1
else
tmp = (z * t) + (x * (1.0d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((Math.tanh((t / y)) - Math.tanh((x / y))) * (y * z));
double tmp;
if (t_1 <= 1e+281) {
tmp = t_1;
} else {
tmp = (z * t) + (x * (1.0 - z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((math.tanh((t / y)) - math.tanh((x / y))) * (y * z)) tmp = 0 if t_1 <= 1e+281: tmp = t_1 else: tmp = (z * t) + (x * (1.0 - z)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))) * Float64(y * z))) tmp = 0.0 if (t_1 <= 1e+281) tmp = t_1; else tmp = Float64(Float64(z * t) + Float64(x * Float64(1.0 - z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((tanh((t / y)) - tanh((x / y))) * (y * z)); tmp = 0.0; if (t_1 <= 1e+281) tmp = t_1; else tmp = (z * t) + (x * (1.0 - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+281], t$95$1, N[(N[(z * t), $MachinePrecision] + N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot \left(y \cdot z\right)\\
\mathbf{if}\;t\_1 \leq 10^{+281}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 1e281Initial program 98.7%
if 1e281 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) Initial program 42.2%
Taylor expanded in y around inf 27.8%
Taylor expanded in x around 0 95.0%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (fma y (* z (- (tanh (/ t y)) (tanh (/ x y)))) x))
double code(double x, double y, double z, double t) {
return fma(y, (z * (tanh((t / y)) - tanh((x / y)))), x);
}
function code(x, y, z, t) return fma(y, Float64(z * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))), x) end
code[x_, y_, z_, t_] := N[(y * N[(z * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), x\right)
\end{array}
Initial program 94.3%
+-commutative94.3%
associate-*l*97.7%
fma-define97.7%
Simplified97.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.4e-100) (not (<= t 7.2e-43))) (+ x (* y (* z (tanh (/ t y))))) (fma y (* z (- (/ t y) (tanh (/ x y)))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.4e-100) || !(t <= 7.2e-43)) {
tmp = x + (y * (z * tanh((t / y))));
} else {
tmp = fma(y, (z * ((t / y) - tanh((x / y)))), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.4e-100) || !(t <= 7.2e-43)) tmp = Float64(x + Float64(y * Float64(z * tanh(Float64(t / y))))); else tmp = fma(y, Float64(z * Float64(Float64(t / y) - tanh(Float64(x / y)))), x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.4e-100], N[Not[LessEqual[t, 7.2e-43]], $MachinePrecision]], N[(x + N[(y * N[(z * N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{-100} \lor \neg \left(t \leq 7.2 \cdot 10^{-43}\right):\\
\;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z \cdot \left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right), x\right)\\
\end{array}
\end{array}
if t < -3.39999999999999976e-100 or 7.1999999999999998e-43 < t Initial program 96.7%
Taylor expanded in x around 0 10.7%
associate-/r*10.7%
div-sub10.7%
rec-exp10.7%
rec-exp10.7%
tanh-def-a87.5%
Simplified87.5%
if -3.39999999999999976e-100 < t < 7.1999999999999998e-43Initial program 91.0%
+-commutative91.0%
associate-*l*95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around 0 90.2%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (<= y 4.9e+73) (+ x (* (tanh (/ t y)) (* y z))) (+ x (- (* z t) (* z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.9e+73) {
tmp = x + (tanh((t / y)) * (y * z));
} else {
tmp = x + ((z * t) - (z * x));
}
return tmp;
}
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
real(8) :: tmp
if (y <= 4.9d+73) then
tmp = x + (tanh((t / y)) * (y * z))
else
tmp = x + ((z * t) - (z * x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.9e+73) {
tmp = x + (Math.tanh((t / y)) * (y * z));
} else {
tmp = x + ((z * t) - (z * x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.9e+73: tmp = x + (math.tanh((t / y)) * (y * z)) else: tmp = x + ((z * t) - (z * x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.9e+73) tmp = Float64(x + Float64(tanh(Float64(t / y)) * Float64(y * z))); else tmp = Float64(x + Float64(Float64(z * t) - Float64(z * x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.9e+73) tmp = x + (tanh((t / y)) * (y * z)); else tmp = x + ((z * t) - (z * x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.9e+73], N[(x + N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * t), $MachinePrecision] - N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.9 \cdot 10^{+73}:\\
\;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot t - z \cdot x\right)\\
\end{array}
\end{array}
if y < 4.8999999999999999e73Initial program 97.1%
Taylor expanded in x around 0 20.9%
associate-*r*20.8%
associate-/r*20.8%
div-sub20.8%
rec-exp20.8%
rec-exp20.8%
tanh-def-a82.1%
Simplified82.1%
if 4.8999999999999999e73 < y Initial program 84.0%
+-commutative84.0%
associate-*l*94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in y around inf 85.8%
fma-undefine85.8%
Applied egg-rr85.8%
associate-*r/86.0%
clear-num85.9%
Applied egg-rr85.9%
Taylor expanded in t around 0 91.3%
Final simplification84.0%
(FPCore (x y z t) :precision binary64 (if (<= y 1.45e+75) (+ x (* y (* z (tanh (/ t y))))) (+ x (- (* z t) (* z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45e+75) {
tmp = x + (y * (z * tanh((t / y))));
} else {
tmp = x + ((z * t) - (z * x));
}
return tmp;
}
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
real(8) :: tmp
if (y <= 1.45d+75) then
tmp = x + (y * (z * tanh((t / y))))
else
tmp = x + ((z * t) - (z * x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45e+75) {
tmp = x + (y * (z * Math.tanh((t / y))));
} else {
tmp = x + ((z * t) - (z * x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.45e+75: tmp = x + (y * (z * math.tanh((t / y)))) else: tmp = x + ((z * t) - (z * x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.45e+75) tmp = Float64(x + Float64(y * Float64(z * tanh(Float64(t / y))))); else tmp = Float64(x + Float64(Float64(z * t) - Float64(z * x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.45e+75) tmp = x + (y * (z * tanh((t / y)))); else tmp = x + ((z * t) - (z * x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.45e+75], N[(x + N[(y * N[(z * N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * t), $MachinePrecision] - N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45 \cdot 10^{+75}:\\
\;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot t - z \cdot x\right)\\
\end{array}
\end{array}
if y < 1.4499999999999999e75Initial program 97.1%
Taylor expanded in x around 0 20.9%
associate-/r*20.9%
div-sub20.9%
rec-exp20.9%
rec-exp20.9%
tanh-def-a82.1%
Simplified82.1%
if 1.4499999999999999e75 < y Initial program 84.0%
+-commutative84.0%
associate-*l*94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in y around inf 85.8%
fma-undefine85.8%
Applied egg-rr85.8%
associate-*r/86.0%
clear-num85.9%
Applied egg-rr85.9%
Taylor expanded in t around 0 91.3%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (<= y 2.2e-76) x (+ x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-76) {
tmp = x;
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
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
real(8) :: tmp
if (y <= 2.2d-76) then
tmp = x
else
tmp = x + (z * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-76) {
tmp = x;
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.2e-76: tmp = x else: tmp = x + (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.2e-76) tmp = x; else tmp = Float64(x + Float64(z * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.2e-76) tmp = x; else tmp = x + (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e-76], x, N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 2.19999999999999999e-76Initial program 96.5%
+-commutative96.5%
associate-*l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in y around 0 66.1%
if 2.19999999999999999e-76 < y Initial program 90.1%
Taylor expanded in y around inf 82.6%
(FPCore (x y z t) :precision binary64 (if (<= y 35000000.0) x (+ x (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 35000000.0) {
tmp = x;
} else {
tmp = x + (z * t);
}
return tmp;
}
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
real(8) :: tmp
if (y <= 35000000.0d0) then
tmp = x
else
tmp = x + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 35000000.0) {
tmp = x;
} else {
tmp = x + (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 35000000.0: tmp = x else: tmp = x + (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 35000000.0) tmp = x; else tmp = Float64(x + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 35000000.0) tmp = x; else tmp = x + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 35000000.0], x, N[(x + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 35000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot t\\
\end{array}
\end{array}
if y < 3.5e7Initial program 96.8%
+-commutative96.8%
associate-*l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in y around 0 65.9%
if 3.5e7 < y Initial program 87.9%
Taylor expanded in x around 0 43.0%
associate-/r*43.0%
div-sub43.0%
rec-exp43.0%
rec-exp43.0%
tanh-def-a76.6%
Simplified76.6%
Taylor expanded in y around inf 71.6%
+-commutative71.6%
*-commutative71.6%
Simplified71.6%
Final simplification67.5%
(FPCore (x y z t) :precision binary64 (if (<= y 1.25e+74) x (* x (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.25e+74) {
tmp = x;
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
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
real(8) :: tmp
if (y <= 1.25d+74) then
tmp = x
else
tmp = x * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.25e+74) {
tmp = x;
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.25e+74: tmp = x else: tmp = x * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.25e+74) tmp = x; else tmp = Float64(x * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.25e+74) tmp = x; else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.25e+74], x, N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{+74}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < 1.24999999999999991e74Initial program 97.1%
+-commutative97.1%
associate-*l*98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in y around 0 65.0%
if 1.24999999999999991e74 < y Initial program 84.0%
Taylor expanded in y around inf 75.4%
Taylor expanded in x around inf 69.4%
mul-1-neg69.4%
unsub-neg69.4%
Simplified69.4%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.3%
+-commutative94.3%
associate-*l*97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in y around 0 62.0%
(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 2024123
(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))))))