
(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 11 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 (* (* y z) (- (tanh (/ t y)) (tanh (/ x y)))))))
(if (<= t_1 (- INFINITY))
(* (- t x) z)
(if (<= t_1 2e+286) t_1 (- x (* z (- x t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (t - x) * z;
} else if (t_1 <= 2e+286) {
tmp = t_1;
} else {
tmp = x - (z * (x - t));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (t - x) * z;
} else if (t_1 <= 2e+286) {
tmp = t_1;
} else {
tmp = x - (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y)))) tmp = 0 if t_1 <= -math.inf: tmp = (t - x) * z elif t_1 <= 2e+286: tmp = t_1 else: tmp = x - (z * (x - t)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(t - x) * z); elseif (t_1 <= 2e+286) tmp = t_1; else tmp = Float64(x - Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y * z) * (tanh((t / y)) - tanh((x / y)))); tmp = 0.0; if (t_1 <= -Inf) tmp = (t - x) * z; elseif (t_1 <= 2e+286) tmp = t_1; else tmp = x - (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 2e+286], t$95$1, N[(x - N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(t - x\right) \cdot z\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+286}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -inf.0Initial program 56.5%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -inf.0 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 2.00000000000000007e286Initial program 98.8%
if 2.00000000000000007e286 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) Initial program 52.7%
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (fma (- (* (- (tanh (/ x y)) (tanh (/ t y))) y)) z x))
double code(double x, double y, double z, double t) {
return fma(-((tanh((x / y)) - tanh((t / y))) * y), z, x);
}
function code(x, y, z, t) return fma(Float64(-Float64(Float64(tanh(Float64(x / y)) - tanh(Float64(t / y))) * y)), z, x) end
code[x_, y_, z_, t_] := N[((-N[(N[(N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]) * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-\left(\tanh \left(\frac{x}{y}\right) - \tanh \left(\frac{t}{y}\right)\right) \cdot y, z, x\right)
\end{array}
Initial program 93.8%
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (if (<= y 7.2e-124) x (fma (- (* (- (/ x y) (tanh (/ t y))) y)) z x)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.2e-124) {
tmp = x;
} else {
tmp = fma(-(((x / y) - tanh((t / y))) * y), z, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 7.2e-124) tmp = x; else tmp = fma(Float64(-Float64(Float64(Float64(x / y) - tanh(Float64(t / y))) * y)), z, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.2e-124], x, N[((-N[(N[(N[(x / y), $MachinePrecision] - N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]) * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{-124}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\left(\frac{x}{y} - \tanh \left(\frac{t}{y}\right)\right) \cdot y, z, x\right)\\
\end{array}
\end{array}
if y < 7.20000000000000019e-124Initial program 93.5%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 7.20000000000000019e-124 < y Initial program 94.3%
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z t)
:precision binary64
(if (<= y 7.6e-124)
x
(if (<= y 7.5e+165)
(- x (* (* y z) (- (/ x y) (tanh (/ t y)))))
(- x (* z (- x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.6e-124) {
tmp = x;
} else if (y <= 7.5e+165) {
tmp = x - ((y * z) * ((x / y) - tanh((t / y))));
} else {
tmp = x - (z * (x - 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 <= 7.6d-124) then
tmp = x
else if (y <= 7.5d+165) then
tmp = x - ((y * z) * ((x / y) - tanh((t / y))))
else
tmp = x - (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.6e-124) {
tmp = x;
} else if (y <= 7.5e+165) {
tmp = x - ((y * z) * ((x / y) - Math.tanh((t / y))));
} else {
tmp = x - (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 7.6e-124: tmp = x elif y <= 7.5e+165: tmp = x - ((y * z) * ((x / y) - math.tanh((t / y)))) else: tmp = x - (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 7.6e-124) tmp = x; elseif (y <= 7.5e+165) tmp = Float64(x - Float64(Float64(y * z) * Float64(Float64(x / y) - tanh(Float64(t / y))))); else tmp = Float64(x - Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 7.6e-124) tmp = x; elseif (y <= 7.5e+165) tmp = x - ((y * z) * ((x / y) - tanh((t / y)))); else tmp = x - (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.6e-124], x, If[LessEqual[y, 7.5e+165], N[(x - N[(N[(y * z), $MachinePrecision] * N[(N[(x / y), $MachinePrecision] - N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.6 \cdot 10^{-124}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+165}:\\
\;\;\;\;x - \left(y \cdot z\right) \cdot \left(\frac{x}{y} - \tanh \left(\frac{t}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < 7.60000000000000025e-124Initial program 93.5%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 7.60000000000000025e-124 < y < 7.49999999999999996e165Initial program 98.1%
Simplified0
Taylor expanded in x around 0 0
Simplified0
if 7.49999999999999996e165 < y Initial program 87.4%
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z t)
:precision binary64
(if (<= y 9.5e-18)
x
(if (<= y 9.6e+112)
(- x (* (* y z) (- (tanh (/ x y)) (/ t y))))
(- x (* z (- x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e-18) {
tmp = x;
} else if (y <= 9.6e+112) {
tmp = x - ((y * z) * (tanh((x / y)) - (t / y)));
} else {
tmp = x - (z * (x - 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 <= 9.5d-18) then
tmp = x
else if (y <= 9.6d+112) then
tmp = x - ((y * z) * (tanh((x / y)) - (t / y)))
else
tmp = x - (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e-18) {
tmp = x;
} else if (y <= 9.6e+112) {
tmp = x - ((y * z) * (Math.tanh((x / y)) - (t / y)));
} else {
tmp = x - (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 9.5e-18: tmp = x elif y <= 9.6e+112: tmp = x - ((y * z) * (math.tanh((x / y)) - (t / y))) else: tmp = x - (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 9.5e-18) tmp = x; elseif (y <= 9.6e+112) tmp = Float64(x - Float64(Float64(y * z) * Float64(tanh(Float64(x / y)) - Float64(t / y)))); else tmp = Float64(x - Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 9.5e-18) tmp = x; elseif (y <= 9.6e+112) tmp = x - ((y * z) * (tanh((x / y)) - (t / y))); else tmp = x - (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 9.5e-18], x, If[LessEqual[y, 9.6e+112], N[(x - N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision] - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{+112}:\\
\;\;\;\;x - \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{x}{y}\right) - \frac{t}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < 9.5000000000000003e-18Initial program 94.3%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 9.5000000000000003e-18 < y < 9.6e112Initial program 99.8%
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 9.6e112 < y Initial program 88.3%
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= y 2.12e+55) x (- x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.12e+55) {
tmp = x;
} else {
tmp = x - (z * (x - 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.12d+55) then
tmp = x
else
tmp = x - (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.12e+55) {
tmp = x;
} else {
tmp = x - (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.12e+55: tmp = x else: tmp = x - (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.12e+55) tmp = x; else tmp = Float64(x - Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.12e+55) tmp = x; else tmp = x - (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.12e+55], x, N[(x - N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.12 \cdot 10^{+55}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < 2.12000000000000007e55Initial program 94.6%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 2.12000000000000007e55 < y Initial program 90.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= y 3.5e+56) x (+ x (* t z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.5e+56) {
tmp = x;
} else {
tmp = x + (t * 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 <= 3.5d+56) then
tmp = x
else
tmp = x + (t * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.5e+56) {
tmp = x;
} else {
tmp = x + (t * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.5e+56: tmp = x else: tmp = x + (t * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.5e+56) tmp = x; else tmp = Float64(x + Float64(t * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.5e+56) tmp = x; else tmp = x + (t * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.5e+56], x, N[(x + N[(t * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot z\\
\end{array}
\end{array}
if y < 3.49999999999999999e56Initial program 94.6%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 3.49999999999999999e56 < y Initial program 90.0%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e+105) (* (- t x) z) x))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+105) {
tmp = (t - 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 <= (-4.2d+105)) then
tmp = (t - 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 <= -4.2e+105) {
tmp = (t - x) * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e+105: tmp = (t - x) * z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e+105) tmp = Float64(Float64(t - x) * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.2e+105) tmp = (t - x) * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e+105], N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+105}:\\
\;\;\;\;\left(t - x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.2000000000000002e105Initial program 80.1%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
if -4.2000000000000002e105 < z Initial program 96.5%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= z -2.4e+204) (* (- x) z) x))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.4e+204) {
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 <= (-2.4d+204)) 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 <= -2.4e+204) {
tmp = -x * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.4e+204: tmp = -x * z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.4e+204) tmp = Float64(Float64(-x) * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.4e+204) tmp = -x * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.4e+204], N[((-x) * z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+204}:\\
\;\;\;\;\left(-x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.4e204Initial program 81.2%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if -2.4e204 < z Initial program 95.1%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= y 3.15e+252) x (* t z)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.15e+252) {
tmp = x;
} else {
tmp = t * 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 <= 3.15d+252) then
tmp = x
else
tmp = t * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.15e+252) {
tmp = x;
} else {
tmp = t * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.15e+252: tmp = x else: tmp = t * z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.15e+252) tmp = x; else tmp = Float64(t * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.15e+252) tmp = x; else tmp = t * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.15e+252], x, N[(t * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.15 \cdot 10^{+252}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot z\\
\end{array}
\end{array}
if y < 3.1500000000000002e252Initial program 94.0%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 3.1500000000000002e252 < y Initial program 86.9%
Simplified0
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(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 93.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(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 2024110
(FPCore (x y z t)
:name "SynthBasics:moogVCF from YampaSynth-0.2"
:precision binary64
:alt
(+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))