
(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 (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+301)))
(+ x (* z (- t x)))
t_1)))
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 <= -((double) INFINITY)) || !(t_1 <= 5e+301)) {
tmp = x + (z * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+301)) {
tmp = x + (z * (t - x));
} else {
tmp = t_1;
}
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 <= -math.inf) or not (t_1 <= 5e+301): tmp = x + (z * (t - x)) else: tmp = t_1 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 <= Float64(-Inf)) || !(t_1 <= 5e+301)) tmp = Float64(x + Float64(z * Float64(t - x))); else tmp = t_1; 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 <= -Inf) || ~((t_1 <= 5e+301))) tmp = x + (z * (t - x)); else tmp = t_1; 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+301]], $MachinePrecision]], N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\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 -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+301}\right):\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -inf.0 or 5.0000000000000004e301 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) Initial program 35.7%
Taylor expanded in y around inf 94.0%
if -inf.0 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 5.0000000000000004e301Initial program 99.5%
Final simplification98.9%
(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 91.8%
+-commutative91.8%
associate-*l*97.4%
fma-define97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (if (<= y 5.3e+150) (fma y (* z (tanh (/ t y))) x) (+ x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.3e+150) {
tmp = fma(y, (z * tanh((t / y))), x);
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 5.3e+150) tmp = fma(y, Float64(z * tanh(Float64(t / y))), x); else tmp = Float64(x + Float64(z * Float64(t - x))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 5.3e+150], N[(y * N[(z * N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.3 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(y, z \cdot \tanh \left(\frac{t}{y}\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 5.30000000000000013e150Initial program 95.7%
+-commutative95.7%
associate-*l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in x around 0 23.5%
associate-/r*23.5%
div-sub23.5%
rec-exp23.6%
rec-exp23.6%
tanh-def-a83.4%
Simplified83.4%
if 5.30000000000000013e150 < y Initial program 62.4%
Taylor expanded in y around inf 84.9%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (<= y 4.8e+150) (+ x (* y (* z (tanh (/ t y))))) (+ x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.8e+150) {
tmp = x + (y * (z * tanh((t / y))));
} 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 <= 4.8d+150) then
tmp = x + (y * (z * tanh((t / y))))
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 <= 4.8e+150) {
tmp = x + (y * (z * Math.tanh((t / y))));
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.8e+150: tmp = x + (y * (z * math.tanh((t / y)))) else: tmp = x + (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.8e+150) tmp = Float64(x + Float64(y * Float64(z * tanh(Float64(t / y))))); 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 <= 4.8e+150) tmp = x + (y * (z * tanh((t / y)))); else tmp = x + (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.8e+150], N[(x + N[(y * N[(z * N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{+150}:\\
\;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 4.80000000000000005e150Initial program 95.7%
Taylor expanded in x around 0 23.5%
associate-/r*23.5%
div-sub23.5%
rec-exp23.6%
rec-exp23.6%
tanh-def-a83.4%
Simplified83.4%
if 4.80000000000000005e150 < y Initial program 62.4%
Taylor expanded in y around inf 84.9%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y 7.5e-46) (and (not (<= y 4.4e-16)) (<= y 1.5e+100))) x (+ x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= 7.5e-46) || (!(y <= 4.4e-16) && (y <= 1.5e+100))) {
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 <= 7.5d-46) .or. (.not. (y <= 4.4d-16)) .and. (y <= 1.5d+100)) 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 <= 7.5e-46) || (!(y <= 4.4e-16) && (y <= 1.5e+100))) {
tmp = x;
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= 7.5e-46) or (not (y <= 4.4e-16) and (y <= 1.5e+100)): tmp = x else: tmp = x + (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= 7.5e-46) || (!(y <= 4.4e-16) && (y <= 1.5e+100))) 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 <= 7.5e-46) || (~((y <= 4.4e-16)) && (y <= 1.5e+100))) tmp = x; else tmp = x + (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, 7.5e-46], And[N[Not[LessEqual[y, 4.4e-16]], $MachinePrecision], LessEqual[y, 1.5e+100]]], x, N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{-46} \lor \neg \left(y \leq 4.4 \cdot 10^{-16}\right) \land y \leq 1.5 \cdot 10^{+100}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 7.50000000000000027e-46 or 4.40000000000000001e-16 < y < 1.49999999999999993e100Initial program 95.9%
Taylor expanded in x around inf 69.1%
if 7.50000000000000027e-46 < y < 4.40000000000000001e-16 or 1.49999999999999993e100 < y Initial program 72.2%
Taylor expanded in y around inf 78.9%
Final simplification70.8%
(FPCore (x y z t)
:precision binary64
(if (<= y 3.3e+99)
x
(if (or (<= y 3.6e+191) (not (<= y 4.3e+281)))
(* x (- 1.0 z))
(* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+99) {
tmp = x;
} else if ((y <= 3.6e+191) || !(y <= 4.3e+281)) {
tmp = x * (1.0 - z);
} else {
tmp = 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 <= 3.3d+99) then
tmp = x
else if ((y <= 3.6d+191) .or. (.not. (y <= 4.3d+281))) then
tmp = x * (1.0d0 - z)
else
tmp = 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 <= 3.3e+99) {
tmp = x;
} else if ((y <= 3.6e+191) || !(y <= 4.3e+281)) {
tmp = x * (1.0 - z);
} else {
tmp = z * (t - x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.3e+99: tmp = x elif (y <= 3.6e+191) or not (y <= 4.3e+281): tmp = x * (1.0 - z) else: tmp = z * (t - x) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e+99) tmp = x; elseif ((y <= 3.6e+191) || !(y <= 4.3e+281)) tmp = Float64(x * Float64(1.0 - z)); else tmp = Float64(z * Float64(t - x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.3e+99) tmp = x; elseif ((y <= 3.6e+191) || ~((y <= 4.3e+281))) tmp = x * (1.0 - z); else tmp = z * (t - x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e+99], x, If[Or[LessEqual[y, 3.6e+191], N[Not[LessEqual[y, 4.3e+281]], $MachinePrecision]], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+191} \lor \neg \left(y \leq 4.3 \cdot 10^{+281}\right):\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 3.2999999999999999e99Initial program 96.0%
Taylor expanded in x around inf 68.6%
if 3.2999999999999999e99 < y < 3.5999999999999999e191 or 4.2999999999999998e281 < y Initial program 63.6%
Taylor expanded in y around inf 78.8%
Taylor expanded in x around inf 59.5%
mul-1-neg59.5%
unsub-neg59.5%
Simplified59.5%
if 3.5999999999999999e191 < y < 4.2999999999999998e281Initial program 77.0%
Taylor expanded in y around inf 84.6%
Taylor expanded in z around inf 68.6%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (<= x -3.5e-226) x (if (<= x 2.5e-214) (* z t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.5e-226) {
tmp = x;
} else if (x <= 2.5e-214) {
tmp = z * t;
} else {
tmp = 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 (x <= (-3.5d-226)) then
tmp = x
else if (x <= 2.5d-214) then
tmp = z * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.5e-226) {
tmp = x;
} else if (x <= 2.5e-214) {
tmp = z * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.5e-226: tmp = x elif x <= 2.5e-214: tmp = z * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.5e-226) tmp = x; elseif (x <= 2.5e-214) tmp = Float64(z * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.5e-226) tmp = x; elseif (x <= 2.5e-214) tmp = z * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.5e-226], x, If[LessEqual[x, 2.5e-214], N[(z * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-226}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-214}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.5e-226 or 2.4999999999999999e-214 < x Initial program 93.7%
Taylor expanded in x around inf 73.2%
if -3.5e-226 < x < 2.4999999999999999e-214Initial program 83.5%
Taylor expanded in y around inf 55.8%
Taylor expanded in x around 0 40.3%
*-commutative40.3%
Simplified40.3%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 (if (<= y 1.15e+100) x (* x (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.15e+100) {
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.15d+100) 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.15e+100) {
tmp = x;
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.15e+100: tmp = x else: tmp = x * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.15e+100) 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.15e+100) tmp = x; else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.15e+100], x, N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{+100}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < 1.14999999999999995e100Initial program 96.0%
Taylor expanded in x around inf 68.6%
if 1.14999999999999995e100 < y Initial program 67.8%
Taylor expanded in y around inf 80.6%
Taylor expanded in x around inf 51.8%
mul-1-neg51.8%
unsub-neg51.8%
Simplified51.8%
Final simplification66.1%
(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 91.8%
Taylor expanded in x around inf 63.4%
Final simplification63.4%
(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 2024039
(FPCore (x y z t)
:name "SynthBasics:moogVCF from YampaSynth-0.2"
:precision binary64
:herbie-target
(+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))