
(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 10 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 (+ x (* z (- (* y (tanh (/ t y))) (* y (tanh (/ x y)))))))
double code(double x, double y, double z, double t) {
return x + (z * ((y * tanh((t / y))) - (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 + (z * ((y * tanh((t / y))) - (y * tanh((x / y)))))
end function
public static double code(double x, double y, double z, double t) {
return x + (z * ((y * Math.tanh((t / y))) - (y * Math.tanh((x / y)))));
}
def code(x, y, z, t): return x + (z * ((y * math.tanh((t / y))) - (y * math.tanh((x / y)))))
function code(x, y, z, t) return Float64(x + Float64(z * Float64(Float64(y * tanh(Float64(t / y))) - Float64(y * tanh(Float64(x / y)))))) end
function tmp = code(x, y, z, t) tmp = x + (z * ((y * tanh((t / y))) - (y * tanh((x / y))))); end
code[x_, y_, z_, t_] := N[(x + N[(z * N[(N[(y * N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y * N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \left(y \cdot \tanh \left(\frac{t}{y}\right) - y \cdot \tanh \left(\frac{x}{y}\right)\right)
\end{array}
Initial program 92.9%
sub-neg92.9%
distribute-lft-in90.3%
Applied egg-rr90.3%
Taylor expanded in z around 0 10.8%
+-commutative10.8%
mul-1-neg10.8%
Simplified97.7%
(FPCore (x y z t) :precision binary64 (+ x (* z (* y (- (tanh (/ t y)) (tanh (/ x y)))))))
double code(double x, double y, double z, double t) {
return x + (z * (y * (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 + (z * (y * (tanh((t / y)) - tanh((x / y)))))
end function
public static double code(double x, double y, double z, double t) {
return x + (z * (y * (Math.tanh((t / y)) - Math.tanh((x / y)))));
}
def code(x, y, z, t): return x + (z * (y * (math.tanh((t / y)) - math.tanh((x / y)))))
function code(x, y, z, t) return Float64(x + Float64(z * Float64(y * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))) end
function tmp = code(x, y, z, t) tmp = x + (z * (y * (tanh((t / y)) - tanh((x / y))))); end
code[x_, y_, z_, t_] := N[(x + N[(z * N[(y * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)
\end{array}
Initial program 92.9%
sub-neg92.9%
distribute-lft-in90.3%
Applied egg-rr90.3%
Taylor expanded in z around 0 10.8%
+-commutative10.8%
mul-1-neg10.8%
Simplified97.7%
Taylor expanded in z around 0 10.8%
associate-/l*10.8%
rec-exp10.8%
rec-exp10.8%
tanh-def-a37.1%
associate-/l*37.1%
Simplified97.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (tanh (/ t y)))) (if (<= y 4.3e+95) (+ x (* y (* z t_1))) (+ x (* z (- (* y t_1) x))))))
double code(double x, double y, double z, double t) {
double t_1 = tanh((t / y));
double tmp;
if (y <= 4.3e+95) {
tmp = x + (y * (z * t_1));
} else {
tmp = x + (z * ((y * t_1) - 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) :: t_1
real(8) :: tmp
t_1 = tanh((t / y))
if (y <= 4.3d+95) then
tmp = x + (y * (z * t_1))
else
tmp = x + (z * ((y * t_1) - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.tanh((t / y));
double tmp;
if (y <= 4.3e+95) {
tmp = x + (y * (z * t_1));
} else {
tmp = x + (z * ((y * t_1) - x));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.tanh((t / y)) tmp = 0 if y <= 4.3e+95: tmp = x + (y * (z * t_1)) else: tmp = x + (z * ((y * t_1) - x)) return tmp
function code(x, y, z, t) t_1 = tanh(Float64(t / y)) tmp = 0.0 if (y <= 4.3e+95) tmp = Float64(x + Float64(y * Float64(z * t_1))); else tmp = Float64(x + Float64(z * Float64(Float64(y * t_1) - x))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = tanh((t / y)); tmp = 0.0; if (y <= 4.3e+95) tmp = x + (y * (z * t_1)); else tmp = x + (z * ((y * t_1) - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e+95], N[(x + N[(y * N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(y * t$95$1), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tanh \left(\frac{t}{y}\right)\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{+95}:\\
\;\;\;\;x + y \cdot \left(z \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y \cdot t\_1 - x\right)\\
\end{array}
\end{array}
if y < 4.3e95Initial program 94.1%
Taylor expanded in x around 0 21.1%
associate-/r*21.1%
div-sub21.1%
rec-exp21.1%
rec-exp21.1%
tanh-def-a85.7%
Simplified85.7%
if 4.3e95 < y Initial program 84.3%
sub-neg84.3%
distribute-lft-in73.2%
Applied egg-rr73.2%
Taylor expanded in z around 0 31.6%
+-commutative31.6%
mul-1-neg31.6%
Simplified93.3%
Taylor expanded in x around 0 53.2%
neg-mul-153.2%
+-commutative53.2%
associate-/l*53.2%
rec-exp53.2%
rec-exp53.2%
tanh-def-a92.0%
unsub-neg92.0%
Simplified92.0%
(FPCore (x y z t) :precision binary64 (if (<= y 7.2e+117) (+ x (* y (* z (tanh (/ t y))))) (fma t z (* x (- 1.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.2e+117) {
tmp = x + (y * (z * tanh((t / y))));
} else {
tmp = fma(t, z, (x * (1.0 - z)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 7.2e+117) tmp = Float64(x + Float64(y * Float64(z * tanh(Float64(t / y))))); else tmp = fma(t, z, Float64(x * Float64(1.0 - z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.2e+117], N[(x + N[(y * N[(z * N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * z + N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{+117}:\\
\;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, x \cdot \left(1 - z\right)\right)\\
\end{array}
\end{array}
if y < 7.20000000000000025e117Initial program 94.1%
Taylor expanded in x around 0 21.8%
associate-/r*21.8%
div-sub21.8%
rec-exp21.8%
rec-exp21.8%
tanh-def-a85.8%
Simplified85.8%
if 7.20000000000000025e117 < y Initial program 83.1%
+-commutative83.1%
associate-*l*86.2%
fma-define86.2%
Simplified86.2%
Taylor expanded in y around inf 71.6%
Taylor expanded in t around 0 85.3%
associate-+r+85.3%
*-rgt-identity85.3%
mul-1-neg85.3%
distribute-rgt-neg-in85.3%
mul-1-neg85.3%
distribute-lft-in85.3%
+-commutative85.3%
fma-define85.4%
mul-1-neg85.4%
unsub-neg85.4%
Simplified85.4%
(FPCore (x y z t) :precision binary64 (if (<= y 3e+38) x (fma t z (* x (- 1.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3e+38) {
tmp = x;
} else {
tmp = fma(t, z, (x * (1.0 - z)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 3e+38) tmp = x; else tmp = fma(t, z, Float64(x * Float64(1.0 - z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 3e+38], x, N[(t * z + N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, x \cdot \left(1 - z\right)\right)\\
\end{array}
\end{array}
if y < 3.0000000000000001e38Initial program 93.8%
+-commutative93.8%
associate-*l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in y around 0 69.6%
if 3.0000000000000001e38 < y Initial program 88.2%
+-commutative88.2%
associate-*l*90.3%
fma-define90.3%
Simplified90.3%
Taylor expanded in y around inf 73.1%
Taylor expanded in t around 0 82.7%
associate-+r+82.7%
*-rgt-identity82.7%
mul-1-neg82.7%
distribute-rgt-neg-in82.7%
mul-1-neg82.7%
distribute-lft-in82.7%
+-commutative82.7%
fma-define82.8%
mul-1-neg82.8%
unsub-neg82.8%
Simplified82.8%
(FPCore (x y z t) :precision binary64 (if (<= y 2.8e+38) x (+ (* x (- 1.0 z)) (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.8e+38) {
tmp = x;
} else {
tmp = (x * (1.0 - z)) + (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 <= 2.8d+38) then
tmp = x
else
tmp = (x * (1.0d0 - z)) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.8e+38) {
tmp = x;
} else {
tmp = (x * (1.0 - z)) + (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.8e+38: tmp = x else: tmp = (x * (1.0 - z)) + (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.8e+38) tmp = x; else tmp = Float64(Float64(x * Float64(1.0 - z)) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.8e+38) tmp = x; else tmp = (x * (1.0 - z)) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.8e+38], x, N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.8 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right) + z \cdot t\\
\end{array}
\end{array}
if y < 2.8e38Initial program 93.8%
+-commutative93.8%
associate-*l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in y around 0 69.6%
if 2.8e38 < y Initial program 88.2%
Taylor expanded in y around inf 70.9%
clear-num70.9%
un-div-inv71.0%
Applied egg-rr71.0%
Taylor expanded in x around inf 75.8%
neg-mul-175.8%
associate-+r+75.8%
sub-neg75.8%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in x around 0 82.7%
Final simplification71.6%
(FPCore (x y z t) :precision binary64 (if (<= y 1.6e+38) x (+ x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.6e+38) {
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 <= 1.6d+38) 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 <= 1.6e+38) {
tmp = x;
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.6e+38: tmp = x else: tmp = x + (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.6e+38) 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 <= 1.6e+38) tmp = x; else tmp = x + (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.6e+38], x, N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 1.59999999999999993e38Initial program 93.8%
+-commutative93.8%
associate-*l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in y around 0 69.6%
if 1.59999999999999993e38 < y Initial program 88.2%
Taylor expanded in y around inf 82.7%
(FPCore (x y z t) :precision binary64 (if (<= y 1.25e+35) x (+ x (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.25e+35) {
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 <= 1.25d+35) 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 <= 1.25e+35) {
tmp = x;
} else {
tmp = x + (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.25e+35: tmp = x else: tmp = x + (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.25e+35) 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 <= 1.25e+35) tmp = x; else tmp = x + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.25e+35], x, N[(x + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{+35}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot t\\
\end{array}
\end{array}
if y < 1.25000000000000005e35Initial program 93.8%
+-commutative93.8%
associate-*l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in y around 0 69.4%
if 1.25000000000000005e35 < y Initial program 88.4%
Taylor expanded in y around inf 71.7%
Taylor expanded in t around inf 75.8%
*-commutative75.8%
Simplified75.8%
(FPCore (x y z t) :precision binary64 (if (<= y 1.25e+95) x (* x (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.25e+95) {
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+95) 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+95) {
tmp = x;
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.25e+95: tmp = x else: tmp = x * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.25e+95) 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+95) tmp = x; else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.25e+95], x, N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{+95}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < 1.25000000000000006e95Initial program 94.1%
+-commutative94.1%
associate-*l*98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in y around 0 69.2%
if 1.25000000000000006e95 < y Initial program 84.3%
+-commutative84.3%
associate-*l*87.1%
fma-define87.1%
Simplified87.1%
Taylor expanded in y around inf 73.5%
Taylor expanded in t around 0 56.9%
*-rgt-identity56.9%
mul-1-neg56.9%
distribute-rgt-neg-in56.9%
mul-1-neg56.9%
distribute-lft-in56.9%
mul-1-neg56.9%
unsub-neg56.9%
Simplified56.9%
(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 92.9%
+-commutative92.9%
associate-*l*96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in y around 0 66.6%
(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 2024167
(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))))))