
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (* (pow k m) a_m)))
(*
a_s
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 5e+191)
(/ (* (pow k m) (- (/ a_m (hypot 1.0 k)))) (- (hypot 1.0 k)))
t_0))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = pow(k, m) * a_m;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191) {
tmp = (pow(k, m) * -(a_m / hypot(1.0, k))) / -hypot(1.0, k);
} else {
tmp = t_0;
}
return a_s * tmp;
}
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = Math.pow(k, m) * a_m;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191) {
tmp = (Math.pow(k, m) * -(a_m / Math.hypot(1.0, k))) / -Math.hypot(1.0, k);
} else {
tmp = t_0;
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): t_0 = math.pow(k, m) * a_m tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191: tmp = (math.pow(k, m) * -(a_m / math.hypot(1.0, k))) / -math.hypot(1.0, k) else: tmp = t_0 return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64((k ^ m) * a_m) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 5e+191) tmp = Float64(Float64((k ^ m) * Float64(-Float64(a_m / hypot(1.0, k)))) / Float64(-hypot(1.0, k))); else tmp = t_0; end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) t_0 = (k ^ m) * a_m; tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191) tmp = ((k ^ m) * -(a_m / hypot(1.0, k))) / -hypot(1.0, k); else tmp = t_0; end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+191], N[(N[(N[Power[k, m], $MachinePrecision] * (-N[(a$95$m / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / (-N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision])), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a_m\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 5 \cdot 10^{+191}:\\
\;\;\;\;\frac{{k}^{m} \cdot \left(-\frac{a_m}{\mathsf{hypot}\left(1, k\right)}\right)}{-\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
\end{array}
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (let* ((t_0 (/ (hypot 1.0 k) (sqrt (pow k m))))) (* a_s (* (/ 1.0 t_0) (/ a_m t_0)))))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = hypot(1.0, k) / sqrt(pow(k, m));
return a_s * ((1.0 / t_0) * (a_m / t_0));
}
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = Math.hypot(1.0, k) / Math.sqrt(Math.pow(k, m));
return a_s * ((1.0 / t_0) * (a_m / t_0));
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): t_0 = math.hypot(1.0, k) / math.sqrt(math.pow(k, m)) return a_s * ((1.0 / t_0) * (a_m / t_0))
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64(hypot(1.0, k) / sqrt((k ^ m))) return Float64(a_s * Float64(Float64(1.0 / t_0) * Float64(a_m / t_0))) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) t_0 = hypot(1.0, k) / sqrt((k ^ m)); tmp = a_s * ((1.0 / t_0) * (a_m / t_0)); end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision] / N[Sqrt[N[Power[k, m], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(a$95$m / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \frac{\mathsf{hypot}\left(1, k\right)}{\sqrt{{k}^{m}}}\\
a_s \cdot \left(\frac{1}{t_0} \cdot \frac{a_m}{t_0}\right)
\end{array}
\end{array}
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (pow (/ (sqrt a_m) (/ (hypot 1.0 k) (sqrt (pow k m)))) 2.0)))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * pow((sqrt(a_m) / (hypot(1.0, k) / sqrt(pow(k, m)))), 2.0);
}
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * Math.pow((Math.sqrt(a_m) / (Math.hypot(1.0, k) / Math.sqrt(Math.pow(k, m)))), 2.0);
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * math.pow((math.sqrt(a_m) / (math.hypot(1.0, k) / math.sqrt(math.pow(k, m)))), 2.0)
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * (Float64(sqrt(a_m) / Float64(hypot(1.0, k) / sqrt((k ^ m)))) ^ 2.0)) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * ((sqrt(a_m) / (hypot(1.0, k) / sqrt((k ^ m)))) ^ 2.0); end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[Power[N[(N[Sqrt[a$95$m], $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision] / N[Sqrt[N[Power[k, m], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot {\left(\frac{\sqrt{a_m}}{\frac{\mathsf{hypot}\left(1, k\right)}{\sqrt{{k}^{m}}}}\right)}^{2}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (* (pow k m) a_m)))
(*
a_s
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 5e+191)
(/ a_m (/ (+ 1.0 (* k (+ k 10.0))) (pow k m)))
t_0))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = pow(k, m) * a_m;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191) {
tmp = a_m / ((1.0 + (k * (k + 10.0))) / pow(k, m));
} else {
tmp = t_0;
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a_m
if ((t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))) <= 5d+191) then
tmp = a_m / ((1.0d0 + (k * (k + 10.0d0))) / (k ** m))
else
tmp = t_0
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = Math.pow(k, m) * a_m;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191) {
tmp = a_m / ((1.0 + (k * (k + 10.0))) / Math.pow(k, m));
} else {
tmp = t_0;
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): t_0 = math.pow(k, m) * a_m tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191: tmp = a_m / ((1.0 + (k * (k + 10.0))) / math.pow(k, m)) else: tmp = t_0 return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64((k ^ m) * a_m) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 5e+191) tmp = Float64(a_m / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / (k ^ m))); else tmp = t_0; end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) t_0 = (k ^ m) * a_m; tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+191) tmp = a_m / ((1.0 + (k * (k + 10.0))) / (k ^ m)); else tmp = t_0; end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+191], N[(a$95$m / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a_m\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 5 \cdot 10^{+191}:\\
\;\;\;\;\frac{a_m}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -1.95e-16)
(/ a_m (/ (+ 1.0 (* k 10.0)) (pow k m)))
(if (<= m 0.11) (/ a_m (+ 1.0 (* k (+ k 10.0)))) (* (pow k m) a_m)))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -1.95e-16) {
tmp = a_m / ((1.0 + (k * 10.0)) / pow(k, m));
} else if (m <= 0.11) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = pow(k, m) * a_m;
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-1.95d-16)) then
tmp = a_m / ((1.0d0 + (k * 10.0d0)) / (k ** m))
else if (m <= 0.11d0) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (k ** m) * a_m
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -1.95e-16) {
tmp = a_m / ((1.0 + (k * 10.0)) / Math.pow(k, m));
} else if (m <= 0.11) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = Math.pow(k, m) * a_m;
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -1.95e-16: tmp = a_m / ((1.0 + (k * 10.0)) / math.pow(k, m)) elif m <= 0.11: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = math.pow(k, m) * a_m return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -1.95e-16) tmp = Float64(a_m / Float64(Float64(1.0 + Float64(k * 10.0)) / (k ^ m))); elseif (m <= 0.11) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64((k ^ m) * a_m); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= -1.95e-16) tmp = a_m / ((1.0 + (k * 10.0)) / (k ^ m)); elseif (m <= 0.11) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = (k ^ m) * a_m; end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -1.95e-16], N[(a$95$m / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.11], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -1.95 \cdot 10^{-16}:\\
\;\;\;\;\frac{a_m}{\frac{1 + k \cdot 10}{{k}^{m}}}\\
\mathbf{elif}\;m \leq 0.11:\\
\;\;\;\;\frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a_m\\
\end{array}
\end{array}
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 4.2) (/ a_m (/ (+ 1.0 (* k k)) (pow k m))) (* (pow k m) a_m))))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 4.2) {
tmp = a_m / ((1.0 + (k * k)) / pow(k, m));
} else {
tmp = pow(k, m) * a_m;
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 4.2d0) then
tmp = a_m / ((1.0d0 + (k * k)) / (k ** m))
else
tmp = (k ** m) * a_m
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 4.2) {
tmp = a_m / ((1.0 + (k * k)) / Math.pow(k, m));
} else {
tmp = Math.pow(k, m) * a_m;
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 4.2: tmp = a_m / ((1.0 + (k * k)) / math.pow(k, m)) else: tmp = math.pow(k, m) * a_m return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 4.2) tmp = Float64(a_m / Float64(Float64(1.0 + Float64(k * k)) / (k ^ m))); else tmp = Float64((k ^ m) * a_m); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= 4.2) tmp = a_m / ((1.0 + (k * k)) / (k ^ m)); else tmp = (k ^ m) * a_m; end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 4.2], N[(a$95$m / N[(N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 4.2:\\
\;\;\;\;\frac{a_m}{\frac{1 + k \cdot k}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a_m\\
\end{array}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (or (<= m -1.95e-16) (not (<= m 0.11)))
(* (pow k m) a_m)
(/ a_m (+ 1.0 (* k (+ k 10.0)))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if ((m <= -1.95e-16) || !(m <= 0.11)) {
tmp = pow(k, m) * a_m;
} else {
tmp = a_m / (1.0 + (k * (k + 10.0)));
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-1.95d-16)) .or. (.not. (m <= 0.11d0))) then
tmp = (k ** m) * a_m
else
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if ((m <= -1.95e-16) || !(m <= 0.11)) {
tmp = Math.pow(k, m) * a_m;
} else {
tmp = a_m / (1.0 + (k * (k + 10.0)));
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if (m <= -1.95e-16) or not (m <= 0.11): tmp = math.pow(k, m) * a_m else: tmp = a_m / (1.0 + (k * (k + 10.0))) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if ((m <= -1.95e-16) || !(m <= 0.11)) tmp = Float64((k ^ m) * a_m); else tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if ((m <= -1.95e-16) || ~((m <= 0.11))) tmp = (k ^ m) * a_m; else tmp = a_m / (1.0 + (k * (k + 10.0))); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[Or[LessEqual[m, -1.95e-16], N[Not[LessEqual[m, 0.11]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -1.95 \cdot 10^{-16} \lor \neg \left(m \leq 0.11\right):\\
\;\;\;\;{k}^{m} \cdot a_m\\
\mathbf{else}:\\
\;\;\;\;\frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -5.5e+16)
(/ 1.0 (/ (* k 10.0) a_m))
(if (<= m 0.9) (/ a_m (+ 1.0 (* k 10.0))) (* -10.0 (* k a_m))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -5.5e+16) {
tmp = 1.0 / ((k * 10.0) / a_m);
} else if (m <= 0.9) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-5.5d+16)) then
tmp = 1.0d0 / ((k * 10.0d0) / a_m)
else if (m <= 0.9d0) then
tmp = a_m / (1.0d0 + (k * 10.0d0))
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -5.5e+16) {
tmp = 1.0 / ((k * 10.0) / a_m);
} else if (m <= 0.9) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -5.5e+16: tmp = 1.0 / ((k * 10.0) / a_m) elif m <= 0.9: tmp = a_m / (1.0 + (k * 10.0)) else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -5.5e+16) tmp = Float64(1.0 / Float64(Float64(k * 10.0) / a_m)); elseif (m <= 0.9) tmp = Float64(a_m / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= -5.5e+16) tmp = 1.0 / ((k * 10.0) / a_m); elseif (m <= 0.9) tmp = a_m / (1.0 + (k * 10.0)); else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -5.5e+16], N[(1.0 / N[(N[(k * 10.0), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.9], N[(a$95$m / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -5.5 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{\frac{k \cdot 10}{a_m}}\\
\mathbf{elif}\;m \leq 0.9:\\
\;\;\;\;\frac{a_m}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 1.1) (/ a_m (+ 1.0 (* k (+ k 10.0)))) (* -10.0 (* k a_m)))))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 1.1) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.1d0) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 1.1) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 1.1: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 1.1) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= 1.1) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 1.1], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 1.1:\\
\;\;\;\;\frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -0.00182)
(* 0.1 (/ a_m k))
(if (<= m 0.47) a_m (* -10.0 (* k a_m))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -0.00182) {
tmp = 0.1 * (a_m / k);
} else if (m <= 0.47) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.00182d0)) then
tmp = 0.1d0 * (a_m / k)
else if (m <= 0.47d0) then
tmp = a_m
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -0.00182) {
tmp = 0.1 * (a_m / k);
} else if (m <= 0.47) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -0.00182: tmp = 0.1 * (a_m / k) elif m <= 0.47: tmp = a_m else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -0.00182) tmp = Float64(0.1 * Float64(a_m / k)); elseif (m <= 0.47) tmp = a_m; else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= -0.00182) tmp = 0.1 * (a_m / k); elseif (m <= 0.47) tmp = a_m; else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -0.00182], N[(0.1 * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.47], a$95$m, N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -0.00182:\\
\;\;\;\;0.1 \cdot \frac{a_m}{k}\\
\mathbf{elif}\;m \leq 0.47:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -0.0025)
(/ 1.0 (/ (* k 10.0) a_m))
(if (<= m 0.55) a_m (* -10.0 (* k a_m))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -0.0025) {
tmp = 1.0 / ((k * 10.0) / a_m);
} else if (m <= 0.55) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.0025d0)) then
tmp = 1.0d0 / ((k * 10.0d0) / a_m)
else if (m <= 0.55d0) then
tmp = a_m
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -0.0025) {
tmp = 1.0 / ((k * 10.0) / a_m);
} else if (m <= 0.55) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -0.0025: tmp = 1.0 / ((k * 10.0) / a_m) elif m <= 0.55: tmp = a_m else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -0.0025) tmp = Float64(1.0 / Float64(Float64(k * 10.0) / a_m)); elseif (m <= 0.55) tmp = a_m; else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= -0.0025) tmp = 1.0 / ((k * 10.0) / a_m); elseif (m <= 0.55) tmp = a_m; else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -0.0025], N[(1.0 / N[(N[(k * 10.0), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.55], a$95$m, N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -0.0025:\\
\;\;\;\;\frac{1}{\frac{k \cdot 10}{a_m}}\\
\mathbf{elif}\;m \leq 0.55:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 0.195) a_m (* -10.0 (* k a_m)))))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 0.195) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.195d0) then
tmp = a_m
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 0.195) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 0.195: tmp = a_m else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 0.195) tmp = a_m; else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= 0.195) tmp = a_m; else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 0.195], a$95$m, N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 0.195:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s a_m))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a_s * a_m
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * a_m
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * a_m) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * a_m; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * a$95$m), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot a_m
\end{array}
herbie shell --seed 2023350
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))