
(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 17 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 (* a_m (pow k m))))
(*
a_s
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 1e+271)
(* (pow k m) (/ a_m (fma k (+ k 10.0) 1.0)))
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 = a_m * pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+271) {
tmp = pow(k, m) * (a_m / fma(k, (k + 10.0), 1.0));
} 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(a_m * (k ^ m)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 1e+271) tmp = Float64((k ^ m) * Float64(a_m / fma(k, Float64(k + 10.0), 1.0))); else tmp = t_0; end return Float64(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[(a$95$m * N[Power[k, m], $MachinePrecision]), $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], 1e+271], N[(N[Power[k, m], $MachinePrecision] * N[(a$95$m / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $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 := a_m \cdot {k}^{m}\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+271}:\\
\;\;\;\;{k}^{m} \cdot \frac{a_m}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) < 9.99999999999999953e270Initial program 95.7%
associate-*l/94.7%
*-commutative94.7%
sqr-neg94.7%
associate-+l+94.7%
+-commutative94.7%
sqr-neg94.7%
distribute-rgt-out94.7%
fma-def94.7%
+-commutative94.7%
Simplified94.7%
if 9.99999999999999953e270 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 55.3%
associate-*l/53.2%
*-commutative53.2%
sqr-neg53.2%
associate-+l+53.2%
+-commutative53.2%
sqr-neg53.2%
distribute-rgt-out53.2%
fma-def53.2%
+-commutative53.2%
Simplified53.2%
Taylor expanded in k around 0 100.0%
Final simplification95.7%
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (let* ((t_0 (* a_m (pow k m))) (t_1 (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))))) (* a_s (if (<= t_1 1e+271) t_1 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 = a_m * pow(k, m);
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 1e+271) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = a_m * (k ** m)
t_1 = t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))
if (t_1 <= 1d+271) then
tmp = t_1
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 = a_m * Math.pow(k, m);
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 1e+271) {
tmp = t_1;
} 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 = a_m * math.pow(k, m) t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)) tmp = 0 if t_1 <= 1e+271: tmp = t_1 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(a_m * (k ^ m)) t_1 = Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) tmp = 0.0 if (t_1 <= 1e+271) tmp = t_1; 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 = a_m * (k ^ m); t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)); tmp = 0.0; if (t_1 <= 1e+271) tmp = t_1; 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[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$1, 1e+271], t$95$1, 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 := a_m \cdot {k}^{m}\\
t_1 := \frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k}\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;t_1 \leq 10^{+271}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) < 9.99999999999999953e270Initial program 95.7%
if 9.99999999999999953e270 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 55.3%
associate-*l/53.2%
*-commutative53.2%
sqr-neg53.2%
associate-+l+53.2%
+-commutative53.2%
sqr-neg53.2%
distribute-rgt-out53.2%
fma-def53.2%
+-commutative53.2%
Simplified53.2%
Taylor expanded in k around 0 100.0%
Final simplification96.5%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m 3.35)
(/ a_m (/ (+ 1.0 (* k (+ k 10.0))) (pow k m)))
(* a_m (pow k 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 <= 3.35) {
tmp = a_m / ((1.0 + (k * (k + 10.0))) / pow(k, m));
} else {
tmp = a_m * pow(k, 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 <= 3.35d0) then
tmp = a_m / ((1.0d0 + (k * (k + 10.0d0))) / (k ** m))
else
tmp = a_m * (k ** 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 <= 3.35) {
tmp = a_m / ((1.0 + (k * (k + 10.0))) / Math.pow(k, m));
} else {
tmp = a_m * Math.pow(k, 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 <= 3.35: tmp = a_m / ((1.0 + (k * (k + 10.0))) / math.pow(k, m)) else: tmp = a_m * math.pow(k, 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 <= 3.35) tmp = Float64(a_m / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / (k ^ m))); else tmp = Float64(a_m * (k ^ 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 <= 3.35) tmp = a_m / ((1.0 + (k * (k + 10.0))) / (k ^ m)); else tmp = a_m * (k ^ 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, 3.35], N[(a$95$m / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[Power[k, 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 3.35:\\
\;\;\;\;\frac{a_m}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;a_m \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 3.35000000000000009Initial program 95.1%
associate-/l*95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
if 3.35000000000000009 < m Initial program 71.2%
associate-*l/67.1%
*-commutative67.1%
sqr-neg67.1%
associate-+l+67.1%
+-commutative67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
fma-def67.1%
+-commutative67.1%
Simplified67.1%
Taylor expanded in k around 0 100.0%
Final simplification96.5%
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.1e-19)
(/ (pow k m) (/ 1.0 a_m))
(if (<= m 0.0008) (/ a_m (fma (+ k 10.0) k 1.0)) (* a_m (pow k 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.1e-19) {
tmp = pow(k, m) / (1.0 / a_m);
} else if (m <= 0.0008) {
tmp = a_m / fma((k + 10.0), k, 1.0);
} else {
tmp = a_m * pow(k, 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.1e-19) tmp = Float64((k ^ m) / Float64(1.0 / a_m)); elseif (m <= 0.0008) tmp = Float64(a_m / fma(Float64(k + 10.0), k, 1.0)); else tmp = Float64(a_m * (k ^ m)); end return Float64(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.1e-19], N[(N[Power[k, m], $MachinePrecision] / N[(1.0 / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0008], N[(a$95$m / N[(N[(k + 10.0), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[Power[k, 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 -4.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{{k}^{m}}{\frac{1}{a_m}}\\
\mathbf{elif}\;m \leq 0.0008:\\
\;\;\;\;\frac{a_m}{\mathsf{fma}\left(k + 10, k, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a_m \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -4.09999999999999985e-19Initial program 100.0%
*-commutative100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 100.0%
if -4.09999999999999985e-19 < m < 8.00000000000000038e-4Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in m around 0 90.3%
unpow290.3%
distribute-rgt-in90.3%
+-commutative90.3%
*-commutative90.3%
fma-def90.3%
+-commutative90.3%
Applied egg-rr90.3%
if 8.00000000000000038e-4 < m Initial program 71.2%
associate-*l/67.1%
*-commutative67.1%
sqr-neg67.1%
associate-+l+67.1%
+-commutative67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
fma-def67.1%
+-commutative67.1%
Simplified67.1%
Taylor expanded in k around 0 100.0%
Final simplification96.2%
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 -4.1e-19) (not (<= m 0.027)))
(* a_m (pow k 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 <= -4.1e-19) || !(m <= 0.027)) {
tmp = a_m * pow(k, 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 <= (-4.1d-19)) .or. (.not. (m <= 0.027d0))) then
tmp = a_m * (k ** 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 <= -4.1e-19) || !(m <= 0.027)) {
tmp = a_m * Math.pow(k, 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 <= -4.1e-19) or not (m <= 0.027): tmp = a_m * math.pow(k, 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 <= -4.1e-19) || !(m <= 0.027)) tmp = Float64(a_m * (k ^ 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 <= -4.1e-19) || ~((m <= 0.027))) tmp = a_m * (k ^ 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, -4.1e-19], N[Not[LessEqual[m, 0.027]], $MachinePrecision]], N[(a$95$m * N[Power[k, m], $MachinePrecision]), $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 -4.1 \cdot 10^{-19} \lor \neg \left(m \leq 0.027\right):\\
\;\;\;\;a_m \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -4.09999999999999985e-19 or 0.0269999999999999997 < m Initial program 86.5%
associate-*l/84.6%
*-commutative84.6%
sqr-neg84.6%
associate-+l+84.6%
+-commutative84.6%
sqr-neg84.6%
distribute-rgt-out84.6%
fma-def84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in k around 0 100.0%
if -4.09999999999999985e-19 < m < 0.0269999999999999997Initial program 91.0%
associate-/l*91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 90.3%
Final simplification96.2%
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.1e-19)
(/ (pow k m) (/ 1.0 a_m))
(if (<= m 0.0016) (/ a_m (+ 1.0 (* k (+ k 10.0)))) (* a_m (pow k 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.1e-19) {
tmp = pow(k, m) / (1.0 / a_m);
} else if (m <= 0.0016) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = a_m * pow(k, 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.1d-19)) then
tmp = (k ** m) / (1.0d0 / a_m)
else if (m <= 0.0016d0) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a_m * (k ** 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.1e-19) {
tmp = Math.pow(k, m) / (1.0 / a_m);
} else if (m <= 0.0016) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = a_m * Math.pow(k, 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.1e-19: tmp = math.pow(k, m) / (1.0 / a_m) elif m <= 0.0016: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = a_m * math.pow(k, 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.1e-19) tmp = Float64((k ^ m) / Float64(1.0 / a_m)); elseif (m <= 0.0016) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a_m * (k ^ 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.1e-19) tmp = (k ^ m) / (1.0 / a_m); elseif (m <= 0.0016) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = a_m * (k ^ 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.1e-19], N[(N[Power[k, m], $MachinePrecision] / N[(1.0 / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0016], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[Power[k, 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 -4.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{{k}^{m}}{\frac{1}{a_m}}\\
\mathbf{elif}\;m \leq 0.0016:\\
\;\;\;\;\frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a_m \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -4.09999999999999985e-19Initial program 100.0%
*-commutative100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 100.0%
if -4.09999999999999985e-19 < m < 0.00160000000000000008Initial program 91.0%
associate-/l*91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 90.3%
if 0.00160000000000000008 < m Initial program 71.2%
associate-*l/67.1%
*-commutative67.1%
sqr-neg67.1%
associate-+l+67.1%
+-commutative67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
fma-def67.1%
+-commutative67.1%
Simplified67.1%
Taylor expanded in k around 0 100.0%
Final simplification96.2%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (* -10.0 (* a_m k))))
(*
a_s
(if (<= k -2.7e+71)
(/ a_m (* k (+ k 10.0)))
(if (<= k -1e-269)
t_0
(if (<= k 4e-282)
(/ (/ a_m k) k)
(if (<= k 0.098) (+ a_m t_0) (* (/ 1.0 k) (/ a_m k)))))))))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 = -10.0 * (a_m * k);
double tmp;
if (k <= -2.7e+71) {
tmp = a_m / (k * (k + 10.0));
} else if (k <= -1e-269) {
tmp = t_0;
} else if (k <= 4e-282) {
tmp = (a_m / k) / k;
} else if (k <= 0.098) {
tmp = a_m + t_0;
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 = (-10.0d0) * (a_m * k)
if (k <= (-2.7d+71)) then
tmp = a_m / (k * (k + 10.0d0))
else if (k <= (-1d-269)) then
tmp = t_0
else if (k <= 4d-282) then
tmp = (a_m / k) / k
else if (k <= 0.098d0) then
tmp = a_m + t_0
else
tmp = (1.0d0 / k) * (a_m / k)
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 = -10.0 * (a_m * k);
double tmp;
if (k <= -2.7e+71) {
tmp = a_m / (k * (k + 10.0));
} else if (k <= -1e-269) {
tmp = t_0;
} else if (k <= 4e-282) {
tmp = (a_m / k) / k;
} else if (k <= 0.098) {
tmp = a_m + t_0;
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 = -10.0 * (a_m * k) tmp = 0 if k <= -2.7e+71: tmp = a_m / (k * (k + 10.0)) elif k <= -1e-269: tmp = t_0 elif k <= 4e-282: tmp = (a_m / k) / k elif k <= 0.098: tmp = a_m + t_0 else: tmp = (1.0 / k) * (a_m / k) 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(-10.0 * Float64(a_m * k)) tmp = 0.0 if (k <= -2.7e+71) tmp = Float64(a_m / Float64(k * Float64(k + 10.0))); elseif (k <= -1e-269) tmp = t_0; elseif (k <= 4e-282) tmp = Float64(Float64(a_m / k) / k); elseif (k <= 0.098) tmp = Float64(a_m + t_0); else tmp = Float64(Float64(1.0 / k) * Float64(a_m / k)); 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 = -10.0 * (a_m * k); tmp = 0.0; if (k <= -2.7e+71) tmp = a_m / (k * (k + 10.0)); elseif (k <= -1e-269) tmp = t_0; elseif (k <= 4e-282) tmp = (a_m / k) / k; elseif (k <= 0.098) tmp = a_m + t_0; else tmp = (1.0 / k) * (a_m / k); 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[(-10.0 * N[(a$95$m * k), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[k, -2.7e+71], N[(a$95$m / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -1e-269], t$95$0, If[LessEqual[k, 4e-282], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[k, 0.098], N[(a$95$m + t$95$0), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := -10 \cdot \left(a_m \cdot k\right)\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq -2.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{a_m}{k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;k \leq -1 \cdot 10^{-269}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 4 \cdot 10^{-282}:\\
\;\;\;\;\frac{\frac{a_m}{k}}{k}\\
\mathbf{elif}\;k \leq 0.098:\\
\;\;\;\;a_m + t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
\end{array}
if k < -2.69999999999999997e71Initial program 73.9%
associate-*l/73.9%
*-commutative73.9%
sqr-neg73.9%
associate-+l+73.9%
+-commutative73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
fma-def73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in k around inf 73.9%
unpow273.9%
distribute-rgt-in73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in m around 0 61.6%
+-commutative61.6%
Simplified61.6%
if -2.69999999999999997e71 < k < -9.9999999999999996e-270Initial program 100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 3.7%
Taylor expanded in k around inf 15.1%
if -9.9999999999999996e-270 < k < 4.0000000000000001e-282Initial program 100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 13.1%
Taylor expanded in k around inf 61.0%
*-un-lft-identity61.0%
unpow261.0%
times-frac61.0%
Applied egg-rr61.0%
associate-*l/61.0%
*-un-lft-identity61.0%
Applied egg-rr61.0%
if 4.0000000000000001e-282 < k < 0.098000000000000004Initial program 99.9%
associate-/l*99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 54.9%
Taylor expanded in k around 0 54.2%
if 0.098000000000000004 < k Initial program 75.3%
associate-/l*75.3%
sqr-neg75.3%
associate-+l+75.3%
sqr-neg75.3%
distribute-rgt-out75.3%
Simplified75.3%
Taylor expanded in m around 0 56.9%
Taylor expanded in k around inf 54.9%
*-un-lft-identity54.9%
unpow254.9%
times-frac62.2%
Applied egg-rr62.2%
Final simplification52.9%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k -9.6e+70)
(/ a_m (* k (+ k 10.0)))
(if (<= k -1e-269)
(* -10.0 (* a_m k))
(if (<= k 6e-279)
(/ (/ a_m k) k)
(if (<= k 48000.0)
(/ a_m (+ 1.0 (* k 10.0)))
(* (/ 1.0 k) (/ a_m k))))))))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 (k <= -9.6e+70) {
tmp = a_m / (k * (k + 10.0));
} else if (k <= -1e-269) {
tmp = -10.0 * (a_m * k);
} else if (k <= 6e-279) {
tmp = (a_m / k) / k;
} else if (k <= 48000.0) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 (k <= (-9.6d+70)) then
tmp = a_m / (k * (k + 10.0d0))
else if (k <= (-1d-269)) then
tmp = (-10.0d0) * (a_m * k)
else if (k <= 6d-279) then
tmp = (a_m / k) / k
else if (k <= 48000.0d0) then
tmp = a_m / (1.0d0 + (k * 10.0d0))
else
tmp = (1.0d0 / k) * (a_m / k)
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 (k <= -9.6e+70) {
tmp = a_m / (k * (k + 10.0));
} else if (k <= -1e-269) {
tmp = -10.0 * (a_m * k);
} else if (k <= 6e-279) {
tmp = (a_m / k) / k;
} else if (k <= 48000.0) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 k <= -9.6e+70: tmp = a_m / (k * (k + 10.0)) elif k <= -1e-269: tmp = -10.0 * (a_m * k) elif k <= 6e-279: tmp = (a_m / k) / k elif k <= 48000.0: tmp = a_m / (1.0 + (k * 10.0)) else: tmp = (1.0 / k) * (a_m / k) 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 (k <= -9.6e+70) tmp = Float64(a_m / Float64(k * Float64(k + 10.0))); elseif (k <= -1e-269) tmp = Float64(-10.0 * Float64(a_m * k)); elseif (k <= 6e-279) tmp = Float64(Float64(a_m / k) / k); elseif (k <= 48000.0) tmp = Float64(a_m / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(Float64(1.0 / k) * Float64(a_m / k)); 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 (k <= -9.6e+70) tmp = a_m / (k * (k + 10.0)); elseif (k <= -1e-269) tmp = -10.0 * (a_m * k); elseif (k <= 6e-279) tmp = (a_m / k) / k; elseif (k <= 48000.0) tmp = a_m / (1.0 + (k * 10.0)); else tmp = (1.0 / k) * (a_m / k); 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[k, -9.6e+70], N[(a$95$m / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -1e-269], N[(-10.0 * N[(a$95$m * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 6e-279], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[k, 48000.0], N[(a$95$m / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a$95$m / k), $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}\;k \leq -9.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{a_m}{k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;k \leq -1 \cdot 10^{-269}:\\
\;\;\;\;-10 \cdot \left(a_m \cdot k\right)\\
\mathbf{elif}\;k \leq 6 \cdot 10^{-279}:\\
\;\;\;\;\frac{\frac{a_m}{k}}{k}\\
\mathbf{elif}\;k \leq 48000:\\
\;\;\;\;\frac{a_m}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
if k < -9.59999999999999947e70Initial program 73.9%
associate-*l/73.9%
*-commutative73.9%
sqr-neg73.9%
associate-+l+73.9%
+-commutative73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
fma-def73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in k around inf 73.9%
unpow273.9%
distribute-rgt-in73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in m around 0 61.6%
+-commutative61.6%
Simplified61.6%
if -9.59999999999999947e70 < k < -9.9999999999999996e-270Initial program 100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 3.7%
Taylor expanded in k around inf 15.1%
if -9.9999999999999996e-270 < k < 5.9999999999999999e-279Initial program 100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 13.1%
Taylor expanded in k around inf 61.0%
*-un-lft-identity61.0%
unpow261.0%
times-frac61.0%
Applied egg-rr61.0%
associate-*l/61.0%
*-un-lft-identity61.0%
Applied egg-rr61.0%
if 5.9999999999999999e-279 < k < 48000Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in m around 0 53.8%
Taylor expanded in k around 0 52.4%
*-commutative52.4%
Simplified52.4%
if 48000 < k Initial program 74.3%
associate-/l*74.3%
sqr-neg74.3%
associate-+l+74.3%
sqr-neg74.3%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 58.1%
Taylor expanded in k around inf 57.0%
*-un-lft-identity57.0%
unpow257.0%
times-frac64.5%
Applied egg-rr64.5%
Final simplification53.0%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k 1.7e-281)
(/ a_m (/ k (/ 1.0 k)))
(if (<= k 48000.0)
(/ a_m (+ 1.0 (* k 10.0)))
(/ 1.0 (* (+ k 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 (k <= 1.7e-281) {
tmp = a_m / (k / (1.0 / k));
} else if (k <= 48000.0) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = 1.0 / ((k + 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 (k <= 1.7d-281) then
tmp = a_m / (k / (1.0d0 / k))
else if (k <= 48000.0d0) then
tmp = a_m / (1.0d0 + (k * 10.0d0))
else
tmp = 1.0d0 / ((k + 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 (k <= 1.7e-281) {
tmp = a_m / (k / (1.0 / k));
} else if (k <= 48000.0) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = 1.0 / ((k + 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 k <= 1.7e-281: tmp = a_m / (k / (1.0 / k)) elif k <= 48000.0: tmp = a_m / (1.0 + (k * 10.0)) else: tmp = 1.0 / ((k + 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 (k <= 1.7e-281) tmp = Float64(a_m / Float64(k / Float64(1.0 / k))); elseif (k <= 48000.0) tmp = Float64(a_m / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(1.0 / Float64(Float64(k + 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 (k <= 1.7e-281) tmp = a_m / (k / (1.0 / k)); elseif (k <= 48000.0) tmp = a_m / (1.0 + (k * 10.0)); else tmp = 1.0 / ((k + 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[k, 1.7e-281], N[(a$95$m / N[(k / N[(1.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 48000.0], N[(a$95$m / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(k + 10.0), $MachinePrecision] * N[(k / a$95$m), $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}\;k \leq 1.7 \cdot 10^{-281}:\\
\;\;\;\;\frac{a_m}{\frac{k}{\frac{1}{k}}}\\
\mathbf{elif}\;k \leq 48000:\\
\;\;\;\;\frac{a_m}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(k + 10\right) \cdot \frac{k}{a_m}}\\
\end{array}
\end{array}
if k < 1.7e-281Initial program 91.0%
associate-/l*91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 24.9%
Taylor expanded in k around inf 34.6%
*-un-lft-identity34.6%
unpow234.6%
times-frac28.5%
Applied egg-rr28.5%
*-commutative28.5%
associate-*l/28.5%
associate-/l*34.6%
Applied egg-rr34.6%
if 1.7e-281 < k < 48000Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in m around 0 53.8%
Taylor expanded in k around 0 52.4%
*-commutative52.4%
Simplified52.4%
if 48000 < k Initial program 74.3%
associate-/l*74.3%
sqr-neg74.3%
associate-+l+74.3%
sqr-neg74.3%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 58.1%
clear-num58.0%
distribute-rgt-in58.0%
unpow258.0%
inv-pow58.0%
unpow258.0%
distribute-rgt-in58.0%
+-commutative58.0%
fma-def58.0%
+-commutative58.0%
Applied egg-rr58.0%
unpow-158.0%
Simplified58.0%
Taylor expanded in k around inf 58.0%
unpow272.1%
distribute-rgt-in72.1%
+-commutative72.1%
Simplified58.0%
associate-/l*65.0%
associate-/r/65.0%
Applied egg-rr65.0%
Final simplification52.3%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -650.0)
(/ a_m (/ k (/ 1.0 k)))
(if (<= m 3.7) (/ a_m (+ 1.0 (* k (+ k 10.0)))) (* -10.0 (* a_m k))))))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 <= -650.0) {
tmp = a_m / (k / (1.0 / k));
} else if (m <= 3.7) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (a_m * k);
}
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 <= (-650.0d0)) then
tmp = a_m / (k / (1.0d0 / k))
else if (m <= 3.7d0) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (-10.0d0) * (a_m * k)
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 <= -650.0) {
tmp = a_m / (k / (1.0 / k));
} else if (m <= 3.7) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (a_m * k);
}
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 <= -650.0: tmp = a_m / (k / (1.0 / k)) elif m <= 3.7: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = -10.0 * (a_m * k) 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 <= -650.0) tmp = Float64(a_m / Float64(k / Float64(1.0 / k))); elseif (m <= 3.7) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(-10.0 * Float64(a_m * k)); 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 <= -650.0) tmp = a_m / (k / (1.0 / k)); elseif (m <= 3.7) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = -10.0 * (a_m * k); 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, -650.0], N[(a$95$m / N[(k / N[(1.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 3.7], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a$95$m * k), $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 -650:\\
\;\;\;\;\frac{a_m}{\frac{k}{\frac{1}{k}}}\\
\mathbf{elif}\;m \leq 3.7:\\
\;\;\;\;\frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a_m \cdot k\right)\\
\end{array}
\end{array}
if m < -650Initial program 100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 34.4%
Taylor expanded in k around inf 58.5%
*-un-lft-identity58.5%
unpow258.5%
times-frac49.5%
Applied egg-rr49.5%
*-commutative49.5%
associate-*l/49.5%
associate-/l*58.5%
Applied egg-rr58.5%
if -650 < m < 3.7000000000000002Initial program 91.6%
associate-/l*91.6%
sqr-neg91.6%
associate-+l+91.6%
sqr-neg91.6%
distribute-rgt-out91.6%
Simplified91.6%
Taylor expanded in m around 0 87.9%
if 3.7000000000000002 < m Initial program 71.2%
associate-/l*71.2%
sqr-neg71.2%
associate-+l+71.2%
sqr-neg71.2%
distribute-rgt-out71.2%
Simplified71.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 5.5%
Taylor expanded in k around inf 17.5%
Final simplification59.1%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k 3e-279)
(/ (/ a_m k) k)
(if (<= k 48000.0) a_m (* (/ 1.0 k) (/ a_m k))))))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 (k <= 3e-279) {
tmp = (a_m / k) / k;
} else if (k <= 48000.0) {
tmp = a_m;
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 (k <= 3d-279) then
tmp = (a_m / k) / k
else if (k <= 48000.0d0) then
tmp = a_m
else
tmp = (1.0d0 / k) * (a_m / k)
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 (k <= 3e-279) {
tmp = (a_m / k) / k;
} else if (k <= 48000.0) {
tmp = a_m;
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 k <= 3e-279: tmp = (a_m / k) / k elif k <= 48000.0: tmp = a_m else: tmp = (1.0 / k) * (a_m / k) 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 (k <= 3e-279) tmp = Float64(Float64(a_m / k) / k); elseif (k <= 48000.0) tmp = a_m; else tmp = Float64(Float64(1.0 / k) * Float64(a_m / k)); 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 (k <= 3e-279) tmp = (a_m / k) / k; elseif (k <= 48000.0) tmp = a_m; else tmp = (1.0 / k) * (a_m / k); 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[k, 3e-279], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[k, 48000.0], a$95$m, N[(N[(1.0 / k), $MachinePrecision] * N[(a$95$m / k), $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}\;k \leq 3 \cdot 10^{-279}:\\
\;\;\;\;\frac{\frac{a_m}{k}}{k}\\
\mathbf{elif}\;k \leq 48000:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
if k < 3e-279Initial program 91.0%
associate-/l*91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 24.9%
Taylor expanded in k around inf 34.6%
*-un-lft-identity34.6%
unpow234.6%
times-frac28.5%
Applied egg-rr28.5%
associate-*l/28.5%
*-un-lft-identity28.5%
Applied egg-rr28.5%
if 3e-279 < k < 48000Initial program 99.9%
associate-/l*99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 53.8%
Taylor expanded in k around 0 52.0%
if 48000 < k Initial program 74.3%
associate-/l*74.3%
sqr-neg74.3%
associate-+l+74.3%
sqr-neg74.3%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 58.1%
Taylor expanded in k around inf 57.0%
*-un-lft-identity57.0%
unpow257.0%
times-frac64.5%
Applied egg-rr64.5%
Final simplification50.4%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k 6.8e-282)
(/ (/ a_m k) k)
(if (<= k 0.098) (+ a_m (* -10.0 (* a_m k))) (* (/ 1.0 k) (/ a_m k))))))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 (k <= 6.8e-282) {
tmp = (a_m / k) / k;
} else if (k <= 0.098) {
tmp = a_m + (-10.0 * (a_m * k));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 (k <= 6.8d-282) then
tmp = (a_m / k) / k
else if (k <= 0.098d0) then
tmp = a_m + ((-10.0d0) * (a_m * k))
else
tmp = (1.0d0 / k) * (a_m / k)
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 (k <= 6.8e-282) {
tmp = (a_m / k) / k;
} else if (k <= 0.098) {
tmp = a_m + (-10.0 * (a_m * k));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 k <= 6.8e-282: tmp = (a_m / k) / k elif k <= 0.098: tmp = a_m + (-10.0 * (a_m * k)) else: tmp = (1.0 / k) * (a_m / k) 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 (k <= 6.8e-282) tmp = Float64(Float64(a_m / k) / k); elseif (k <= 0.098) tmp = Float64(a_m + Float64(-10.0 * Float64(a_m * k))); else tmp = Float64(Float64(1.0 / k) * Float64(a_m / k)); 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 (k <= 6.8e-282) tmp = (a_m / k) / k; elseif (k <= 0.098) tmp = a_m + (-10.0 * (a_m * k)); else tmp = (1.0 / k) * (a_m / k); 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[k, 6.8e-282], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[k, 0.098], N[(a$95$m + N[(-10.0 * N[(a$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a$95$m / k), $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}\;k \leq 6.8 \cdot 10^{-282}:\\
\;\;\;\;\frac{\frac{a_m}{k}}{k}\\
\mathbf{elif}\;k \leq 0.098:\\
\;\;\;\;a_m + -10 \cdot \left(a_m \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
if k < 6.79999999999999997e-282Initial program 91.0%
associate-/l*91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 24.9%
Taylor expanded in k around inf 34.6%
*-un-lft-identity34.6%
unpow234.6%
times-frac28.5%
Applied egg-rr28.5%
associate-*l/28.5%
*-un-lft-identity28.5%
Applied egg-rr28.5%
if 6.79999999999999997e-282 < k < 0.098000000000000004Initial program 99.9%
associate-/l*99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 54.9%
Taylor expanded in k around 0 54.2%
if 0.098000000000000004 < k Initial program 75.3%
associate-/l*75.3%
sqr-neg75.3%
associate-+l+75.3%
sqr-neg75.3%
distribute-rgt-out75.3%
Simplified75.3%
Taylor expanded in m around 0 56.9%
Taylor expanded in k around inf 54.9%
*-un-lft-identity54.9%
unpow254.9%
times-frac62.2%
Applied egg-rr62.2%
Final simplification50.5%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k 1.7e-280)
(/ 1.0 (* k (/ k a_m)))
(if (<= k 0.098) (+ a_m (* -10.0 (* a_m k))) (* (/ 1.0 k) (/ a_m k))))))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 (k <= 1.7e-280) {
tmp = 1.0 / (k * (k / a_m));
} else if (k <= 0.098) {
tmp = a_m + (-10.0 * (a_m * k));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 (k <= 1.7d-280) then
tmp = 1.0d0 / (k * (k / a_m))
else if (k <= 0.098d0) then
tmp = a_m + ((-10.0d0) * (a_m * k))
else
tmp = (1.0d0 / k) * (a_m / k)
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 (k <= 1.7e-280) {
tmp = 1.0 / (k * (k / a_m));
} else if (k <= 0.098) {
tmp = a_m + (-10.0 * (a_m * k));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 k <= 1.7e-280: tmp = 1.0 / (k * (k / a_m)) elif k <= 0.098: tmp = a_m + (-10.0 * (a_m * k)) else: tmp = (1.0 / k) * (a_m / k) 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 (k <= 1.7e-280) tmp = Float64(1.0 / Float64(k * Float64(k / a_m))); elseif (k <= 0.098) tmp = Float64(a_m + Float64(-10.0 * Float64(a_m * k))); else tmp = Float64(Float64(1.0 / k) * Float64(a_m / k)); 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 (k <= 1.7e-280) tmp = 1.0 / (k * (k / a_m)); elseif (k <= 0.098) tmp = a_m + (-10.0 * (a_m * k)); else tmp = (1.0 / k) * (a_m / k); 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[k, 1.7e-280], N[(1.0 / N[(k * N[(k / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.098], N[(a$95$m + N[(-10.0 * N[(a$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a$95$m / k), $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}\;k \leq 1.7 \cdot 10^{-280}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a_m}}\\
\mathbf{elif}\;k \leq 0.098:\\
\;\;\;\;a_m + -10 \cdot \left(a_m \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
if k < 1.6999999999999999e-280Initial program 91.0%
associate-/l*91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 24.9%
Taylor expanded in k around inf 34.6%
*-un-lft-identity34.6%
unpow234.6%
times-frac28.5%
Applied egg-rr28.5%
*-commutative28.5%
clear-num28.5%
frac-times29.0%
metadata-eval29.0%
Applied egg-rr29.0%
if 1.6999999999999999e-280 < k < 0.098000000000000004Initial program 99.9%
associate-/l*99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 54.9%
Taylor expanded in k around 0 54.2%
if 0.098000000000000004 < k Initial program 75.3%
associate-/l*75.3%
sqr-neg75.3%
associate-+l+75.3%
sqr-neg75.3%
distribute-rgt-out75.3%
Simplified75.3%
Taylor expanded in m around 0 56.9%
Taylor expanded in k around inf 54.9%
*-un-lft-identity54.9%
unpow254.9%
times-frac62.2%
Applied egg-rr62.2%
Final simplification50.6%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k 2.3e-281)
(/ a_m (/ k (/ 1.0 k)))
(if (<= k 48000.0) (/ a_m (+ 1.0 (* k 10.0))) (* (/ 1.0 k) (/ a_m k))))))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 (k <= 2.3e-281) {
tmp = a_m / (k / (1.0 / k));
} else if (k <= 48000.0) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 (k <= 2.3d-281) then
tmp = a_m / (k / (1.0d0 / k))
else if (k <= 48000.0d0) then
tmp = a_m / (1.0d0 + (k * 10.0d0))
else
tmp = (1.0d0 / k) * (a_m / k)
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 (k <= 2.3e-281) {
tmp = a_m / (k / (1.0 / k));
} else if (k <= 48000.0) {
tmp = a_m / (1.0 + (k * 10.0));
} else {
tmp = (1.0 / k) * (a_m / k);
}
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 k <= 2.3e-281: tmp = a_m / (k / (1.0 / k)) elif k <= 48000.0: tmp = a_m / (1.0 + (k * 10.0)) else: tmp = (1.0 / k) * (a_m / k) 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 (k <= 2.3e-281) tmp = Float64(a_m / Float64(k / Float64(1.0 / k))); elseif (k <= 48000.0) tmp = Float64(a_m / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(Float64(1.0 / k) * Float64(a_m / k)); 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 (k <= 2.3e-281) tmp = a_m / (k / (1.0 / k)); elseif (k <= 48000.0) tmp = a_m / (1.0 + (k * 10.0)); else tmp = (1.0 / k) * (a_m / k); 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[k, 2.3e-281], N[(a$95$m / N[(k / N[(1.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 48000.0], N[(a$95$m / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a$95$m / k), $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}\;k \leq 2.3 \cdot 10^{-281}:\\
\;\;\;\;\frac{a_m}{\frac{k}{\frac{1}{k}}}\\
\mathbf{elif}\;k \leq 48000:\\
\;\;\;\;\frac{a_m}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
if k < 2.29999999999999989e-281Initial program 91.0%
associate-/l*91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 24.9%
Taylor expanded in k around inf 34.6%
*-un-lft-identity34.6%
unpow234.6%
times-frac28.5%
Applied egg-rr28.5%
*-commutative28.5%
associate-*l/28.5%
associate-/l*34.6%
Applied egg-rr34.6%
if 2.29999999999999989e-281 < k < 48000Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in m around 0 53.8%
Taylor expanded in k around 0 52.4%
*-commutative52.4%
Simplified52.4%
if 48000 < k Initial program 74.3%
associate-/l*74.3%
sqr-neg74.3%
associate-+l+74.3%
sqr-neg74.3%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 58.1%
Taylor expanded in k around inf 57.0%
*-un-lft-identity57.0%
unpow257.0%
times-frac64.5%
Applied egg-rr64.5%
Final simplification52.2%
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (or (<= k 1e-280) (not (<= k 48000.0))) (/ (/ a_m k) 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 ((k <= 1e-280) || !(k <= 48000.0)) {
tmp = (a_m / k) / k;
} else {
tmp = 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 ((k <= 1d-280) .or. (.not. (k <= 48000.0d0))) then
tmp = (a_m / k) / k
else
tmp = 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 ((k <= 1e-280) || !(k <= 48000.0)) {
tmp = (a_m / k) / k;
} else {
tmp = 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 (k <= 1e-280) or not (k <= 48000.0): tmp = (a_m / k) / k else: tmp = 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 ((k <= 1e-280) || !(k <= 48000.0)) tmp = Float64(Float64(a_m / k) / k); else tmp = 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 ((k <= 1e-280) || ~((k <= 48000.0))) tmp = (a_m / k) / k; else tmp = 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[Or[LessEqual[k, 1e-280], N[Not[LessEqual[k, 48000.0]], $MachinePrecision]], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], a$95$m]), $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}\;k \leq 10^{-280} \lor \neg \left(k \leq 48000\right):\\
\;\;\;\;\frac{\frac{a_m}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;a_m\\
\end{array}
\end{array}
if k < 9.9999999999999996e-281 or 48000 < k Initial program 81.3%
associate-/l*81.3%
sqr-neg81.3%
associate-+l+81.3%
sqr-neg81.3%
distribute-rgt-out81.3%
Simplified81.3%
Taylor expanded in m around 0 44.2%
Taylor expanded in k around inf 47.6%
*-un-lft-identity47.6%
unpow247.6%
times-frac49.4%
Applied egg-rr49.4%
associate-*l/49.4%
*-un-lft-identity49.4%
Applied egg-rr49.4%
if 9.9999999999999996e-281 < k < 48000Initial program 99.9%
associate-/l*99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 53.8%
Taylor expanded in k around 0 52.0%
Final simplification50.4%
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 2.8e+36) a_m (* -10.0 (* a_m k)))))
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 <= 2.8e+36) {
tmp = a_m;
} else {
tmp = -10.0 * (a_m * k);
}
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 <= 2.8d+36) then
tmp = a_m
else
tmp = (-10.0d0) * (a_m * k)
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 <= 2.8e+36) {
tmp = a_m;
} else {
tmp = -10.0 * (a_m * k);
}
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 <= 2.8e+36: tmp = a_m else: tmp = -10.0 * (a_m * k) 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 <= 2.8e+36) tmp = a_m; else tmp = Float64(-10.0 * Float64(a_m * k)); 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 <= 2.8e+36) tmp = a_m; else tmp = -10.0 * (a_m * k); 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, 2.8e+36], a$95$m, N[(-10.0 * N[(a$95$m * k), $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 2.8 \cdot 10^{+36}:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a_m \cdot k\right)\\
\end{array}
\end{array}
if m < 2.8000000000000001e36Initial program 94.6%
associate-/l*94.6%
sqr-neg94.6%
associate-+l+94.6%
sqr-neg94.6%
distribute-rgt-out94.6%
Simplified94.6%
Taylor expanded in m around 0 65.0%
Taylor expanded in k around 0 29.5%
if 2.8000000000000001e36 < m Initial program 71.8%
associate-/l*71.8%
sqr-neg71.8%
associate-+l+71.8%
sqr-neg71.8%
distribute-rgt-out71.8%
Simplified71.8%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 5.6%
Taylor expanded in k around inf 17.9%
Final simplification26.3%
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}
Initial program 88.3%
associate-/l*88.3%
sqr-neg88.3%
associate-+l+88.3%
sqr-neg88.3%
distribute-rgt-out88.3%
Simplified88.3%
Taylor expanded in m around 0 47.8%
Taylor expanded in k around 0 22.3%
Final simplification22.3%
herbie shell --seed 2023319
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))