
(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 16 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 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (* a_m (pow k m))))
(*
a_s
(if (<= m 1.45) (/ t_0 (+ 1.0 (* k (+ k 10.0)))) (pow (sqrt t_0) 2.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 (m <= 1.45) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} else {
tmp = pow(sqrt(t_0), 2.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 = a_m * (k ** m)
if (m <= 1.45d0) then
tmp = t_0 / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = sqrt(t_0) ** 2.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 t_0 = a_m * Math.pow(k, m);
double tmp;
if (m <= 1.45) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} else {
tmp = Math.pow(Math.sqrt(t_0), 2.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) tmp = 0 if m <= 1.45: tmp = t_0 / (1.0 + (k * (k + 10.0))) else: tmp = math.pow(math.sqrt(t_0), 2.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 (m <= 1.45) tmp = Float64(t_0 / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = sqrt(t_0) ^ 2.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); tmp = 0.0; if (m <= 1.45) tmp = t_0 / (1.0 + (k * (k + 10.0))); else tmp = sqrt(t_0) ^ 2.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]}, N[(a$95$s * If[LessEqual[m, 1.45], N[(t$95$0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]]), $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}\;m \leq 1.45:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{t\_0}\right)}^{2}\\
\end{array}
\end{array}
\end{array}
if m < 1.44999999999999996Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in a around 0 97.8%
if 1.44999999999999996 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
add-sqr-sqrt84.5%
pow284.5%
Applied egg-rr84.5%
Final simplification93.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m 2.95e-15)
(* a_m (/ (pow k 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 <= 2.95e-15) {
tmp = a_m * (pow(k, 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 <= 2.95d-15) then
tmp = a_m * ((k ** 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 <= 2.95e-15) {
tmp = a_m * (Math.pow(k, 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 <= 2.95e-15: tmp = a_m * (math.pow(k, 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 <= 2.95e-15) tmp = Float64(a_m * Float64((k ^ 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 <= 2.95e-15) tmp = a_m * ((k ^ 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, 2.95e-15], N[(a$95$m * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $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 2.95 \cdot 10^{-15}:\\
\;\;\;\;a\_m \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 2.94999999999999982e-15Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
if 2.94999999999999982e-15 < m Initial program 86.0%
associate-/l*86.0%
remove-double-neg86.0%
distribute-frac-neg286.0%
distribute-neg-frac286.0%
remove-double-neg86.0%
sqr-neg86.0%
associate-+l+86.0%
sqr-neg86.0%
distribute-rgt-out86.0%
Simplified86.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s a_m k m) :precision binary64 (let* ((t_0 (* a_m (pow k m)))) (* a_s (if (<= m 2.95e-15) (/ t_0 (+ 1.0 (* k (+ k 10.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 (m <= 2.95e-15) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} 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 = a_m * (k ** m)
if (m <= 2.95d-15) then
tmp = t_0 / (1.0d0 + (k * (k + 10.0d0)))
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 tmp;
if (m <= 2.95e-15) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} 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) tmp = 0 if m <= 2.95e-15: tmp = t_0 / (1.0 + (k * (k + 10.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 (m <= 2.95e-15) tmp = Float64(t_0 / Float64(1.0 + Float64(k * Float64(k + 10.0)))); 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); tmp = 0.0; if (m <= 2.95e-15) tmp = t_0 / (1.0 + (k * (k + 10.0))); 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]}, N[(a$95$s * If[LessEqual[m, 2.95e-15], N[(t$95$0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $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}\;m \leq 2.95 \cdot 10^{-15}:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if m < 2.94999999999999982e-15Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in a around 0 97.7%
if 2.94999999999999982e-15 < m Initial program 86.0%
associate-/l*86.0%
remove-double-neg86.0%
distribute-frac-neg286.0%
distribute-neg-frac286.0%
remove-double-neg86.0%
sqr-neg86.0%
associate-+l+86.0%
sqr-neg86.0%
distribute-rgt-out86.0%
Simplified86.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (or (<= m -3.5e-11) (not (<= m 2.95e-15)))
(* 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 <= -3.5e-11) || !(m <= 2.95e-15)) {
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 <= (-3.5d-11)) .or. (.not. (m <= 2.95d-15))) 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 <= -3.5e-11) || !(m <= 2.95e-15)) {
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 <= -3.5e-11) or not (m <= 2.95e-15): 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 <= -3.5e-11) || !(m <= 2.95e-15)) 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 <= -3.5e-11) || ~((m <= 2.95e-15))) 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, -3.5e-11], N[Not[LessEqual[m, 2.95e-15]], $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 -3.5 \cdot 10^{-11} \lor \neg \left(m \leq 2.95 \cdot 10^{-15}\right):\\
\;\;\;\;a\_m \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -3.50000000000000019e-11 or 2.94999999999999982e-15 < m Initial program 92.7%
associate-/l*92.7%
remove-double-neg92.7%
distribute-frac-neg292.7%
distribute-neg-frac292.7%
remove-double-neg92.7%
sqr-neg92.7%
associate-+l+92.7%
sqr-neg92.7%
distribute-rgt-out92.7%
Simplified92.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -3.50000000000000019e-11 < m < 2.94999999999999982e-15Initial program 95.8%
associate-/l*95.7%
remove-double-neg95.7%
distribute-frac-neg295.7%
distribute-neg-frac295.7%
remove-double-neg95.7%
sqr-neg95.7%
associate-+l+95.7%
sqr-neg95.7%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 95.3%
Final simplification98.3%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -11500000000.0)
(/ (/ a_m k) k)
(if (<= m 0.65)
(/ a_m (+ 1.0 (* k (+ k 10.0))))
(if (or (<= m 1.85e+176) (not (<= m 2.2e+233)))
(/ (/ a_m (* k (- (- -1.0) (/ (+ (/ -1.0 k) -10.0) k)))) k)
(+ a_m (* a_m (* k (- (* k (+ 99.0 (* k -980.0))) 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 0.65) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else if ((m <= 1.85e+176) || !(m <= 2.2e+233)) {
tmp = (a_m / (k * (-(-1.0) - (((-1.0 / k) + -10.0) / k)))) / k;
} else {
tmp = a_m + (a_m * (k * ((k * (99.0 + (k * -980.0))) - 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 <= (-11500000000.0d0)) then
tmp = (a_m / k) / k
else if (m <= 0.65d0) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else if ((m <= 1.85d+176) .or. (.not. (m <= 2.2d+233))) then
tmp = (a_m / (k * (-(-1.0d0) - ((((-1.0d0) / k) + (-10.0d0)) / k)))) / k
else
tmp = a_m + (a_m * (k * ((k * (99.0d0 + (k * (-980.0d0)))) - 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 0.65) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else if ((m <= 1.85e+176) || !(m <= 2.2e+233)) {
tmp = (a_m / (k * (-(-1.0) - (((-1.0 / k) + -10.0) / k)))) / k;
} else {
tmp = a_m + (a_m * (k * ((k * (99.0 + (k * -980.0))) - 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 <= -11500000000.0: tmp = (a_m / k) / k elif m <= 0.65: tmp = a_m / (1.0 + (k * (k + 10.0))) elif (m <= 1.85e+176) or not (m <= 2.2e+233): tmp = (a_m / (k * (-(-1.0) - (((-1.0 / k) + -10.0) / k)))) / k else: tmp = a_m + (a_m * (k * ((k * (99.0 + (k * -980.0))) - 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 <= -11500000000.0) tmp = Float64(Float64(a_m / k) / k); elseif (m <= 0.65) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif ((m <= 1.85e+176) || !(m <= 2.2e+233)) tmp = Float64(Float64(a_m / Float64(k * Float64(Float64(-(-1.0)) - Float64(Float64(Float64(-1.0 / k) + -10.0) / k)))) / k); else tmp = Float64(a_m + Float64(a_m * Float64(k * Float64(Float64(k * Float64(99.0 + Float64(k * -980.0))) - 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 <= -11500000000.0) tmp = (a_m / k) / k; elseif (m <= 0.65) tmp = a_m / (1.0 + (k * (k + 10.0))); elseif ((m <= 1.85e+176) || ~((m <= 2.2e+233))) tmp = (a_m / (k * (-(-1.0) - (((-1.0 / k) + -10.0) / k)))) / k; else tmp = a_m + (a_m * (k * ((k * (99.0 + (k * -980.0))) - 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[LessEqual[m, -11500000000.0], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 0.65], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[m, 1.85e+176], N[Not[LessEqual[m, 2.2e+233]], $MachinePrecision]], N[(N[(a$95$m / N[(k * N[((--1.0) - N[(N[(N[(-1.0 / k), $MachinePrecision] + -10.0), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], N[(a$95$m + N[(a$95$m * N[(k * N[(N[(k * N[(99.0 + N[(k * -980.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 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 -11500000000:\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{elif}\;m \leq 0.65:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 1.85 \cdot 10^{+176} \lor \neg \left(m \leq 2.2 \cdot 10^{+233}\right):\\
\;\;\;\;\frac{\frac{a\_m}{k \cdot \left(\left(--1\right) - \frac{\frac{-1}{k} + -10}{k}\right)}}{k}\\
\mathbf{else}:\\
\;\;\;\;a\_m + a\_m \cdot \left(k \cdot \left(k \cdot \left(99 + k \cdot -980\right) - 10\right)\right)\\
\end{array}
\end{array}
if m < -1.15e10Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 38.2%
Taylor expanded in k around inf 38.2%
*-un-lft-identity38.2%
distribute-lft-out38.2%
times-frac33.6%
Applied egg-rr33.6%
associate-*l/33.6%
*-lft-identity33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Simplified33.6%
Taylor expanded in k around inf 51.7%
if -1.15e10 < m < 0.650000000000000022Initial program 96.0%
associate-/l*95.9%
remove-double-neg95.9%
distribute-frac-neg295.9%
distribute-neg-frac295.9%
remove-double-neg95.9%
sqr-neg95.9%
associate-+l+95.9%
sqr-neg95.9%
distribute-rgt-out95.9%
Simplified95.9%
Taylor expanded in m around 0 93.4%
if 0.650000000000000022 < m < 1.8499999999999999e176 or 2.19999999999999999e233 < m Initial program 89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around inf 3.2%
*-un-lft-identity3.2%
distribute-lft-out3.2%
times-frac12.7%
Applied egg-rr12.7%
associate-*l/12.7%
*-lft-identity12.7%
+-commutative12.7%
associate-+l+12.7%
+-commutative12.7%
Simplified12.7%
Taylor expanded in k around -inf 32.7%
mul-1-neg32.7%
distribute-rgt-neg-in32.7%
sub-neg32.7%
metadata-eval32.7%
+-commutative32.7%
associate-*r/32.7%
+-commutative32.7%
distribute-lft-in32.7%
neg-mul-132.7%
distribute-neg-frac32.7%
metadata-eval32.7%
metadata-eval32.7%
Simplified32.7%
if 1.8499999999999999e176 < m < 2.19999999999999999e233Initial program 68.8%
associate-/l*68.8%
remove-double-neg68.8%
distribute-frac-neg268.8%
distribute-neg-frac268.8%
remove-double-neg68.8%
sqr-neg68.8%
associate-+l+68.8%
sqr-neg68.8%
distribute-rgt-out68.8%
Simplified68.8%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 34.1%
Taylor expanded in a around 0 34.1%
*-commutative34.1%
associate-*l*34.1%
Simplified34.1%
Taylor expanded in a around 0 45.9%
Final simplification61.9%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -11500000000.0)
(/ (/ a_m k) k)
(if (<= m 2.85e-39)
(/ a_m (+ 1.0 (* k (+ k 10.0))))
(/
(* k (- a_m (* k (+ (* k (+ a_m (* a_m -100.0))) (* a_m 10.0)))))
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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 2.85e-39) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = (k * (a_m - (k * ((k * (a_m + (a_m * -100.0))) + (a_m * 10.0))))) / 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 <= (-11500000000.0d0)) then
tmp = (a_m / k) / k
else if (m <= 2.85d-39) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (k * (a_m - (k * ((k * (a_m + (a_m * (-100.0d0)))) + (a_m * 10.0d0))))) / 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 2.85e-39) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = (k * (a_m - (k * ((k * (a_m + (a_m * -100.0))) + (a_m * 10.0))))) / 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 <= -11500000000.0: tmp = (a_m / k) / k elif m <= 2.85e-39: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = (k * (a_m - (k * ((k * (a_m + (a_m * -100.0))) + (a_m * 10.0))))) / 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 <= -11500000000.0) tmp = Float64(Float64(a_m / k) / k); elseif (m <= 2.85e-39) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(Float64(k * Float64(a_m - Float64(k * Float64(Float64(k * Float64(a_m + Float64(a_m * -100.0))) + Float64(a_m * 10.0))))) / 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 <= -11500000000.0) tmp = (a_m / k) / k; elseif (m <= 2.85e-39) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = (k * (a_m - (k * ((k * (a_m + (a_m * -100.0))) + (a_m * 10.0))))) / 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, -11500000000.0], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 2.85e-39], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * N[(a$95$m - N[(k * N[(N[(k * N[(a$95$m + N[(a$95$m * -100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a$95$m * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $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 -11500000000:\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{elif}\;m \leq 2.85 \cdot 10^{-39}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{k \cdot \left(a\_m - k \cdot \left(k \cdot \left(a\_m + a\_m \cdot -100\right) + a\_m \cdot 10\right)\right)}{k}\\
\end{array}
\end{array}
if m < -1.15e10Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 38.2%
Taylor expanded in k around inf 38.2%
*-un-lft-identity38.2%
distribute-lft-out38.2%
times-frac33.6%
Applied egg-rr33.6%
associate-*l/33.6%
*-lft-identity33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Simplified33.6%
Taylor expanded in k around inf 51.7%
if -1.15e10 < m < 2.8499999999999998e-39Initial program 95.8%
associate-/l*95.8%
remove-double-neg95.8%
distribute-frac-neg295.8%
distribute-neg-frac295.8%
remove-double-neg95.8%
sqr-neg95.8%
associate-+l+95.8%
sqr-neg95.8%
distribute-rgt-out95.8%
Simplified95.8%
Taylor expanded in m around 0 93.9%
if 2.8499999999999998e-39 < m Initial program 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in m around 0 6.8%
Taylor expanded in k around inf 6.8%
*-un-lft-identity6.8%
distribute-lft-out6.8%
times-frac15.1%
Applied egg-rr15.1%
associate-*l/15.1%
*-lft-identity15.1%
+-commutative15.1%
associate-+l+15.1%
+-commutative15.1%
Simplified15.1%
Taylor expanded in k around 0 35.3%
Final simplification61.2%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -13000000000.0)
(/ (/ a_m k) k)
(if (<= m 185000000000.0)
(/ a_m (+ 1.0 (* k (+ k 10.0))))
(/ (* k (+ a_m (* -10.0 (* a_m k)))) 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 <= -13000000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 185000000000.0) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = (k * (a_m + (-10.0 * (a_m * k)))) / 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 <= (-13000000000.0d0)) then
tmp = (a_m / k) / k
else if (m <= 185000000000.0d0) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (k * (a_m + ((-10.0d0) * (a_m * k)))) / 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 <= -13000000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 185000000000.0) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = (k * (a_m + (-10.0 * (a_m * k)))) / 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 <= -13000000000.0: tmp = (a_m / k) / k elif m <= 185000000000.0: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = (k * (a_m + (-10.0 * (a_m * k)))) / 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 <= -13000000000.0) tmp = Float64(Float64(a_m / k) / k); elseif (m <= 185000000000.0) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(Float64(k * Float64(a_m + Float64(-10.0 * Float64(a_m * k)))) / 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 <= -13000000000.0) tmp = (a_m / k) / k; elseif (m <= 185000000000.0) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = (k * (a_m + (-10.0 * (a_m * k)))) / 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, -13000000000.0], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 185000000000.0], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * N[(a$95$m + N[(-10.0 * N[(a$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $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 -13000000000:\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{elif}\;m \leq 185000000000:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{k \cdot \left(a\_m + -10 \cdot \left(a\_m \cdot k\right)\right)}{k}\\
\end{array}
\end{array}
if m < -1.3e10Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 38.2%
Taylor expanded in k around inf 38.2%
*-un-lft-identity38.2%
distribute-lft-out38.2%
times-frac33.6%
Applied egg-rr33.6%
associate-*l/33.6%
*-lft-identity33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Simplified33.6%
Taylor expanded in k around inf 51.7%
if -1.3e10 < m < 1.85e11Initial program 96.1%
associate-/l*96.1%
remove-double-neg96.1%
distribute-frac-neg296.1%
distribute-neg-frac296.1%
remove-double-neg96.1%
sqr-neg96.1%
associate-+l+96.1%
sqr-neg96.1%
distribute-rgt-out96.1%
Simplified96.1%
Taylor expanded in m around 0 89.8%
if 1.85e11 < m Initial program 85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around inf 3.1%
*-un-lft-identity3.1%
distribute-lft-out3.1%
times-frac12.3%
Applied egg-rr12.3%
associate-*l/12.3%
*-lft-identity12.3%
+-commutative12.3%
associate-+l+12.3%
+-commutative12.3%
Simplified12.3%
Taylor expanded in k around 0 21.9%
Final simplification57.3%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -11500000000.0)
(/ (/ a_m k) k)
(if (<= m 2.95e-15)
(/ a_m (+ 1.0 (* k (+ k 10.0))))
(/ (/ a_m (/ 1.0 k)) 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 2.95e-15) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = (a_m / (1.0 / k)) / 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 <= (-11500000000.0d0)) then
tmp = (a_m / k) / k
else if (m <= 2.95d-15) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (a_m / (1.0d0 / k)) / 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 2.95e-15) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = (a_m / (1.0 / k)) / 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 <= -11500000000.0: tmp = (a_m / k) / k elif m <= 2.95e-15: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = (a_m / (1.0 / k)) / 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 <= -11500000000.0) tmp = Float64(Float64(a_m / k) / k); elseif (m <= 2.95e-15) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(Float64(a_m / Float64(1.0 / k)) / 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 <= -11500000000.0) tmp = (a_m / k) / k; elseif (m <= 2.95e-15) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = (a_m / (1.0 / k)) / 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, -11500000000.0], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 2.95e-15], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m / N[(1.0 / k), $MachinePrecision]), $MachinePrecision] / k), $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 -11500000000:\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{elif}\;m \leq 2.95 \cdot 10^{-15}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a\_m}{\frac{1}{k}}}{k}\\
\end{array}
\end{array}
if m < -1.15e10Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 38.2%
Taylor expanded in k around inf 38.2%
*-un-lft-identity38.2%
distribute-lft-out38.2%
times-frac33.6%
Applied egg-rr33.6%
associate-*l/33.6%
*-lft-identity33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Simplified33.6%
Taylor expanded in k around inf 51.7%
if -1.15e10 < m < 2.94999999999999982e-15Initial program 95.9%
associate-/l*95.8%
remove-double-neg95.8%
distribute-frac-neg295.8%
distribute-neg-frac295.8%
remove-double-neg95.8%
sqr-neg95.8%
associate-+l+95.8%
sqr-neg95.8%
distribute-rgt-out95.8%
Simplified95.8%
Taylor expanded in m around 0 94.0%
if 2.94999999999999982e-15 < m Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in m around 0 4.6%
Taylor expanded in k around inf 4.6%
*-un-lft-identity4.6%
distribute-lft-out4.6%
times-frac13.1%
Applied egg-rr13.1%
associate-*l/13.1%
*-lft-identity13.1%
+-commutative13.1%
associate-+l+13.1%
+-commutative13.1%
Simplified13.1%
Taylor expanded in k around 0 21.2%
Final simplification57.0%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (or (<= k -4e-265) (not (<= k 0.1)))
(/ (/ a_m k) k)
(+ 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 ((k <= -4e-265) || !(k <= 0.1)) {
tmp = (a_m / k) / k;
} else {
tmp = a_m + (-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 ((k <= (-4d-265)) .or. (.not. (k <= 0.1d0))) then
tmp = (a_m / k) / k
else
tmp = a_m + ((-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 ((k <= -4e-265) || !(k <= 0.1)) {
tmp = (a_m / k) / k;
} else {
tmp = a_m + (-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 (k <= -4e-265) or not (k <= 0.1): tmp = (a_m / k) / k else: tmp = a_m + (-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 ((k <= -4e-265) || !(k <= 0.1)) tmp = Float64(Float64(a_m / k) / k); else tmp = Float64(a_m + 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 ((k <= -4e-265) || ~((k <= 0.1))) tmp = (a_m / k) / k; else tmp = a_m + (-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[Or[LessEqual[k, -4e-265], N[Not[LessEqual[k, 0.1]], $MachinePrecision]], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], N[(a$95$m + N[(-10.0 * N[(a$95$m * k), $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 -4 \cdot 10^{-265} \lor \neg \left(k \leq 0.1\right):\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;a\_m + -10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if k < -3.99999999999999994e-265 or 0.10000000000000001 < k Initial program 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in m around 0 44.1%
Taylor expanded in k around inf 44.1%
*-un-lft-identity44.1%
distribute-lft-out44.1%
times-frac45.4%
Applied egg-rr45.4%
associate-*l/45.4%
*-lft-identity45.4%
+-commutative45.4%
associate-+l+45.4%
+-commutative45.4%
Simplified45.4%
Taylor expanded in k around inf 45.5%
if -3.99999999999999994e-265 < k < 0.10000000000000001Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 52.7%
Taylor expanded in k around 0 52.3%
Final simplification48.1%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (or (<= k -4e-265) (not (<= k 10.0)))
(/ (/ a_m k) k)
(/ a_m (+ 1.0 (* 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 ((k <= -4e-265) || !(k <= 10.0)) {
tmp = (a_m / k) / k;
} else {
tmp = a_m / (1.0 + (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 ((k <= (-4d-265)) .or. (.not. (k <= 10.0d0))) then
tmp = (a_m / k) / k
else
tmp = a_m / (1.0d0 + (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 ((k <= -4e-265) || !(k <= 10.0)) {
tmp = (a_m / k) / k;
} else {
tmp = a_m / (1.0 + (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 (k <= -4e-265) or not (k <= 10.0): tmp = (a_m / k) / k else: tmp = a_m / (1.0 + (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 ((k <= -4e-265) || !(k <= 10.0)) tmp = Float64(Float64(a_m / k) / k); else tmp = Float64(a_m / Float64(1.0 + 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 ((k <= -4e-265) || ~((k <= 10.0))) tmp = (a_m / k) / k; else tmp = a_m / (1.0 + (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[k, -4e-265], N[Not[LessEqual[k, 10.0]], $MachinePrecision]], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], N[(a$95$m / N[(1.0 + N[(k * 10.0), $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 -4 \cdot 10^{-265} \lor \neg \left(k \leq 10\right):\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot 10}\\
\end{array}
\end{array}
if k < -3.99999999999999994e-265 or 10 < k Initial program 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in m around 0 44.1%
Taylor expanded in k around inf 44.1%
*-un-lft-identity44.1%
distribute-lft-out44.1%
times-frac45.4%
Applied egg-rr45.4%
associate-*l/45.4%
*-lft-identity45.4%
+-commutative45.4%
associate-+l+45.4%
+-commutative45.4%
Simplified45.4%
Taylor expanded in k around inf 45.5%
if -3.99999999999999994e-265 < k < 10Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 52.7%
Taylor expanded in k around 0 52.4%
*-commutative52.4%
Simplified52.4%
Final simplification48.1%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -11500000000.0)
(/ (/ a_m k) k)
(if (<= m 0.76) (/ a_m (+ 1.0 (* k k))) (/ (* a_m k) 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 0.76) {
tmp = a_m / (1.0 + (k * k));
} else {
tmp = (a_m * k) / 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 <= (-11500000000.0d0)) then
tmp = (a_m / k) / k
else if (m <= 0.76d0) then
tmp = a_m / (1.0d0 + (k * k))
else
tmp = (a_m * k) / 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 0.76) {
tmp = a_m / (1.0 + (k * k));
} else {
tmp = (a_m * k) / 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 <= -11500000000.0: tmp = (a_m / k) / k elif m <= 0.76: tmp = a_m / (1.0 + (k * k)) else: tmp = (a_m * k) / 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 <= -11500000000.0) tmp = Float64(Float64(a_m / k) / k); elseif (m <= 0.76) tmp = Float64(a_m / Float64(1.0 + Float64(k * k))); else tmp = Float64(Float64(a_m * k) / 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 <= -11500000000.0) tmp = (a_m / k) / k; elseif (m <= 0.76) tmp = a_m / (1.0 + (k * k)); else tmp = (a_m * k) / 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, -11500000000.0], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 0.76], N[(a$95$m / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m * k), $MachinePrecision] / k), $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 -11500000000:\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{elif}\;m \leq 0.76:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m \cdot k}{k}\\
\end{array}
\end{array}
if m < -1.15e10Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 38.2%
Taylor expanded in k around inf 38.2%
*-un-lft-identity38.2%
distribute-lft-out38.2%
times-frac33.6%
Applied egg-rr33.6%
associate-*l/33.6%
*-lft-identity33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Simplified33.6%
Taylor expanded in k around inf 51.7%
if -1.15e10 < m < 0.76000000000000001Initial program 96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in m around 0 93.4%
Taylor expanded in k around inf 93.3%
Taylor expanded in k around 0 90.2%
if 0.76000000000000001 < m Initial program 85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around inf 3.2%
*-un-lft-identity3.2%
distribute-lft-out3.2%
times-frac11.9%
Applied egg-rr11.9%
associate-*l/11.9%
*-lft-identity11.9%
+-commutative11.9%
associate-+l+11.9%
+-commutative11.9%
Simplified11.9%
Taylor expanded in k around 0 20.2%
Final simplification55.8%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -11500000000.0)
(/ (/ a_m k) k)
(if (<= m 2.95e-15) (/ a_m (+ 1.0 (* k k))) (/ (/ a_m (/ 1.0 k)) 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 2.95e-15) {
tmp = a_m / (1.0 + (k * k));
} else {
tmp = (a_m / (1.0 / k)) / 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 <= (-11500000000.0d0)) then
tmp = (a_m / k) / k
else if (m <= 2.95d-15) then
tmp = a_m / (1.0d0 + (k * k))
else
tmp = (a_m / (1.0d0 / k)) / 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 <= -11500000000.0) {
tmp = (a_m / k) / k;
} else if (m <= 2.95e-15) {
tmp = a_m / (1.0 + (k * k));
} else {
tmp = (a_m / (1.0 / k)) / 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 <= -11500000000.0: tmp = (a_m / k) / k elif m <= 2.95e-15: tmp = a_m / (1.0 + (k * k)) else: tmp = (a_m / (1.0 / k)) / 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 <= -11500000000.0) tmp = Float64(Float64(a_m / k) / k); elseif (m <= 2.95e-15) tmp = Float64(a_m / Float64(1.0 + Float64(k * k))); else tmp = Float64(Float64(a_m / Float64(1.0 / k)) / 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 <= -11500000000.0) tmp = (a_m / k) / k; elseif (m <= 2.95e-15) tmp = a_m / (1.0 + (k * k)); else tmp = (a_m / (1.0 / k)) / 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, -11500000000.0], N[(N[(a$95$m / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 2.95e-15], N[(a$95$m / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m / N[(1.0 / k), $MachinePrecision]), $MachinePrecision] / k), $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 -11500000000:\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{elif}\;m \leq 2.95 \cdot 10^{-15}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a\_m}{\frac{1}{k}}}{k}\\
\end{array}
\end{array}
if m < -1.15e10Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 38.2%
Taylor expanded in k around inf 38.2%
*-un-lft-identity38.2%
distribute-lft-out38.2%
times-frac33.6%
Applied egg-rr33.6%
associate-*l/33.6%
*-lft-identity33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Simplified33.6%
Taylor expanded in k around inf 51.7%
if -1.15e10 < m < 2.94999999999999982e-15Initial program 95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in m around 0 94.0%
Taylor expanded in k around inf 93.9%
Taylor expanded in k around 0 90.7%
if 2.94999999999999982e-15 < m Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in m around 0 4.6%
Taylor expanded in k around inf 4.6%
*-un-lft-identity4.6%
distribute-lft-out4.6%
times-frac13.1%
Applied egg-rr13.1%
associate-*l/13.1%
*-lft-identity13.1%
+-commutative13.1%
associate-+l+13.1%
+-commutative13.1%
Simplified13.1%
Taylor expanded in k around 0 21.2%
Final simplification55.8%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (or (<= k -4e-265) (not (<= k 1.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 <= -4e-265) || !(k <= 1.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 <= (-4d-265)) .or. (.not. (k <= 1.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 <= -4e-265) || !(k <= 1.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 <= -4e-265) or not (k <= 1.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 <= -4e-265) || !(k <= 1.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 <= -4e-265) || ~((k <= 1.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, -4e-265], N[Not[LessEqual[k, 1.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 -4 \cdot 10^{-265} \lor \neg \left(k \leq 1\right):\\
\;\;\;\;\frac{\frac{a\_m}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;a\_m\\
\end{array}
\end{array}
if k < -3.99999999999999994e-265 or 1 < k Initial program 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in m around 0 44.1%
Taylor expanded in k around inf 44.1%
*-un-lft-identity44.1%
distribute-lft-out44.1%
times-frac45.4%
Applied egg-rr45.4%
associate-*l/45.4%
*-lft-identity45.4%
+-commutative45.4%
associate-+l+45.4%
+-commutative45.4%
Simplified45.4%
Taylor expanded in k around inf 45.5%
if -3.99999999999999994e-265 < k < 1Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 52.7%
Taylor expanded in k around 0 51.2%
Final simplification47.7%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 1.5) 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 <= 1.5) {
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 <= 1.5d0) 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 <= 1.5) {
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 <= 1.5: 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 <= 1.5) 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 <= 1.5) 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, 1.5], 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 1.5:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < 1.5Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 68.6%
Taylor expanded in k around 0 31.0%
if 1.5 < m Initial program 85.5%
associate-/l*85.5%
remove-double-neg85.5%
distribute-frac-neg285.5%
distribute-neg-frac285.5%
remove-double-neg85.5%
sqr-neg85.5%
associate-+l+85.5%
sqr-neg85.5%
distribute-rgt-out85.5%
Simplified85.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.8%
Taylor expanded in k around inf 17.4%
Final simplification26.6%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 1.5) a_m (/ (* a_m k) 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 <= 1.5) {
tmp = a_m;
} else {
tmp = (a_m * k) / 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 <= 1.5d0) then
tmp = a_m
else
tmp = (a_m * k) / 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 <= 1.5) {
tmp = a_m;
} else {
tmp = (a_m * k) / 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 <= 1.5: tmp = a_m else: tmp = (a_m * k) / 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 <= 1.5) tmp = a_m; else tmp = Float64(Float64(a_m * k) / 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 <= 1.5) tmp = a_m; else tmp = (a_m * k) / 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, 1.5], a$95$m, N[(N[(a$95$m * k), $MachinePrecision] / k), $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.5:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m \cdot k}{k}\\
\end{array}
\end{array}
if m < 1.5Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 68.6%
Taylor expanded in k around 0 31.0%
if 1.5 < m Initial program 85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around inf 3.2%
*-un-lft-identity3.2%
distribute-lft-out3.2%
times-frac12.0%
Applied egg-rr12.0%
associate-*l/12.0%
*-lft-identity12.0%
+-commutative12.0%
associate-+l+12.0%
+-commutative12.0%
Simplified12.0%
Taylor expanded in k around 0 20.4%
Final simplification27.6%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) 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 93.8%
associate-/l*93.8%
remove-double-neg93.8%
distribute-frac-neg293.8%
distribute-neg-frac293.8%
remove-double-neg93.8%
sqr-neg93.8%
associate-+l+93.8%
sqr-neg93.8%
distribute-rgt-out93.8%
Simplified93.8%
Taylor expanded in m around 0 47.4%
Taylor expanded in k around 0 22.2%
Final simplification22.2%
herbie shell --seed 2024110
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))