
(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 8 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 (* 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}
Initial program 91.5%
associate-*l*97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (tanh (/ t y))) (t_2 (+ x (* t_1 (* y z)))))
(if (<= y 1.7e+50)
t_2
(if (<= y 2.9e+123)
(+ x (* z (- (* y t_1) x)))
(if (<= y 1.96e+145) t_2 (+ x (* z (- t x))))))))
double code(double x, double y, double z, double t) {
double t_1 = tanh((t / y));
double t_2 = x + (t_1 * (y * z));
double tmp;
if (y <= 1.7e+50) {
tmp = t_2;
} else if (y <= 2.9e+123) {
tmp = x + (z * ((y * t_1) - x));
} else if (y <= 1.96e+145) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = tanh((t / y))
t_2 = x + (t_1 * (y * z))
if (y <= 1.7d+50) then
tmp = t_2
else if (y <= 2.9d+123) then
tmp = x + (z * ((y * t_1) - x))
else if (y <= 1.96d+145) then
tmp = t_2
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 t_1 = Math.tanh((t / y));
double t_2 = x + (t_1 * (y * z));
double tmp;
if (y <= 1.7e+50) {
tmp = t_2;
} else if (y <= 2.9e+123) {
tmp = x + (z * ((y * t_1) - x));
} else if (y <= 1.96e+145) {
tmp = t_2;
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.tanh((t / y)) t_2 = x + (t_1 * (y * z)) tmp = 0 if y <= 1.7e+50: tmp = t_2 elif y <= 2.9e+123: tmp = x + (z * ((y * t_1) - x)) elif y <= 1.96e+145: tmp = t_2 else: tmp = x + (z * (t - x)) return tmp
function code(x, y, z, t) t_1 = tanh(Float64(t / y)) t_2 = Float64(x + Float64(t_1 * Float64(y * z))) tmp = 0.0 if (y <= 1.7e+50) tmp = t_2; elseif (y <= 2.9e+123) tmp = Float64(x + Float64(z * Float64(Float64(y * t_1) - x))); elseif (y <= 1.96e+145) tmp = t_2; else tmp = Float64(x + Float64(z * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = tanh((t / y)); t_2 = x + (t_1 * (y * z)); tmp = 0.0; if (y <= 1.7e+50) tmp = t_2; elseif (y <= 2.9e+123) tmp = x + (z * ((y * t_1) - x)); elseif (y <= 1.96e+145) tmp = t_2; else tmp = x + (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(t$95$1 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e+50], t$95$2, If[LessEqual[y, 2.9e+123], N[(x + N[(z * N[(N[(y * t$95$1), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.96e+145], t$95$2, N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tanh \left(\frac{t}{y}\right)\\
t_2 := x + t_1 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{+50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+123}:\\
\;\;\;\;x + z \cdot \left(y \cdot t_1 - x\right)\\
\mathbf{elif}\;y \leq 1.96 \cdot 10^{+145}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 1.6999999999999999e50 or 2.9000000000000001e123 < y < 1.96e145Initial program 94.7%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in x around 0 25.9%
associate-*r*25.7%
associate-/r*25.7%
div-sub25.7%
rec-exp25.7%
rec-exp25.7%
tanh-def-a79.2%
Simplified79.2%
if 1.6999999999999999e50 < y < 2.9000000000000001e123Initial program 91.4%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 46.6%
+-commutative46.6%
Simplified91.8%
if 1.96e145 < y Initial program 76.5%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around inf 95.4%
Final simplification82.9%
(FPCore (x y z t) :precision binary64 (if (<= y 1.22e+145) (+ x (* (tanh (/ t y)) (* y z))) (+ x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.22e+145) {
tmp = x + (tanh((t / y)) * (y * z));
} 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.22d+145) then
tmp = x + (tanh((t / y)) * (y * z))
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.22e+145) {
tmp = x + (Math.tanh((t / y)) * (y * z));
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.22e+145: tmp = x + (math.tanh((t / y)) * (y * z)) else: tmp = x + (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.22e+145) tmp = Float64(x + Float64(tanh(Float64(t / y)) * Float64(y * z))); 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.22e+145) tmp = x + (tanh((t / y)) * (y * z)); else tmp = x + (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.22e+145], N[(x + N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.22 \cdot 10^{+145}:\\
\;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 1.21999999999999994e145Initial program 94.3%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in x around 0 27.1%
associate-*r*26.9%
associate-/r*26.9%
div-sub26.9%
rec-exp26.9%
rec-exp26.9%
tanh-def-a79.5%
Simplified79.5%
if 1.21999999999999994e145 < y Initial program 76.5%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around inf 95.4%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= y 270000000.0) x (if (<= y 2.35e+278) (+ x (* z t)) (* x (- 1.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 270000000.0) {
tmp = x;
} else if (y <= 2.35e+278) {
tmp = x + (z * t);
} 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 <= 270000000.0d0) then
tmp = x
else if (y <= 2.35d+278) then
tmp = x + (z * t)
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 <= 270000000.0) {
tmp = x;
} else if (y <= 2.35e+278) {
tmp = x + (z * t);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 270000000.0: tmp = x elif y <= 2.35e+278: tmp = x + (z * t) else: tmp = x * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 270000000.0) tmp = x; elseif (y <= 2.35e+278) tmp = Float64(x + Float64(z * t)); 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 <= 270000000.0) tmp = x; elseif (y <= 2.35e+278) tmp = x + (z * t); else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 270000000.0], x, If[LessEqual[y, 2.35e+278], N[(x + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 270000000:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{+278}:\\
\;\;\;\;x + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < 2.7e8Initial program 94.3%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 27.2%
+-commutative27.2%
Simplified74.7%
Taylor expanded in z around 0 63.9%
if 2.7e8 < y < 2.35e278Initial program 87.2%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in y around inf 77.4%
Taylor expanded in t around inf 70.1%
if 2.35e278 < y Initial program 54.8%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in x around 0 85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in x around inf 85.2%
neg-mul-185.2%
unsub-neg85.2%
Simplified85.2%
Final simplification66.1%
(FPCore (x y z t) :precision binary64 (if (<= y 1.6e+50) x (+ x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.6e+50) {
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+50) 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+50) {
tmp = x;
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.6e+50: tmp = x else: tmp = x + (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.6e+50) 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+50) tmp = x; else tmp = x + (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.6e+50], 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^{+50}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < 1.59999999999999991e50Initial program 94.5%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 27.2%
+-commutative27.2%
Simplified74.7%
Taylor expanded in z around 0 63.3%
if 1.59999999999999991e50 < y Initial program 83.0%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in y around inf 80.9%
Final simplification68.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.5e+97) (not (<= z 1.05e+162))) (* x (- z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e+97) || !(z <= 1.05e+162)) {
tmp = x * -z;
} 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 ((z <= (-3.5d+97)) .or. (.not. (z <= 1.05d+162))) then
tmp = x * -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e+97) || !(z <= 1.05e+162)) {
tmp = x * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.5e+97) or not (z <= 1.05e+162): tmp = x * -z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.5e+97) || !(z <= 1.05e+162)) tmp = Float64(x * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.5e+97) || ~((z <= 1.05e+162))) tmp = x * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.5e+97], N[Not[LessEqual[z, 1.05e+162]], $MachinePrecision]], N[(x * (-z)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+97} \lor \neg \left(z \leq 1.05 \cdot 10^{+162}\right):\\
\;\;\;\;x \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.5000000000000001e97 or 1.05e162 < z Initial program 77.6%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around 0 28.4%
+-commutative28.4%
Simplified74.2%
Taylor expanded in x around inf 32.4%
neg-mul-132.4%
unsub-neg32.4%
Simplified32.4%
Taylor expanded in z around inf 32.4%
mul-1-neg32.4%
distribute-lft-neg-in32.4%
*-commutative32.4%
Simplified32.4%
if -3.5000000000000001e97 < z < 1.05e162Initial program 96.3%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in x around 0 34.9%
+-commutative34.9%
Simplified80.7%
Taylor expanded in z around 0 75.1%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (<= y 1.75e+50) x (* x (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.75e+50) {
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.75d+50) 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.75e+50) {
tmp = x;
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.75e+50: tmp = x else: tmp = x * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.75e+50) 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.75e+50) tmp = x; else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.75e+50], x, N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.75 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < 1.75000000000000003e50Initial program 94.5%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around 0 27.2%
+-commutative27.2%
Simplified74.7%
Taylor expanded in z around 0 63.3%
if 1.75000000000000003e50 < y Initial program 83.0%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around 0 49.8%
+-commutative49.8%
Simplified91.0%
Taylor expanded in x around inf 54.6%
neg-mul-154.6%
unsub-neg54.6%
Simplified54.6%
Final simplification61.0%
(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.5%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in x around 0 33.2%
+-commutative33.2%
Simplified79.1%
Taylor expanded in z around 0 58.4%
Final simplification58.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 2023302
(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))))))