
(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 15 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 (* a_s (pow (/ (sqrt (* a_m (pow k m))) (hypot 1.0 k)) 2.0)))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * pow((sqrt((a_m * pow(k, m))) / hypot(1.0, k)), 2.0);
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * Math.pow((Math.sqrt((a_m * Math.pow(k, m))) / Math.hypot(1.0, k)), 2.0);
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * math.pow((math.sqrt((a_m * math.pow(k, m))) / math.hypot(1.0, k)), 2.0)
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * (Float64(sqrt(Float64(a_m * (k ^ m))) / hypot(1.0, k)) ^ 2.0)) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * ((sqrt((a_m * (k ^ m))) / hypot(1.0, k)) ^ 2.0); end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[Power[N[(N[Sqrt[N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot {\left(\frac{\sqrt{a\_m \cdot {k}^{m}}}{\mathsf{hypot}\left(1, k\right)}\right)}^{2}
\end{array}
Initial program 90.3%
associate-/l*90.3%
remove-double-neg90.3%
distribute-frac-neg290.3%
distribute-neg-frac290.3%
remove-double-neg90.3%
sqr-neg90.3%
associate-+l+90.3%
sqr-neg90.3%
distribute-rgt-out90.3%
Simplified90.3%
add-sqr-sqrt90.3%
sqrt-unprod90.3%
pow-sqr90.4%
Applied egg-rr90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in k around inf 89.4%
add-sqr-sqrt73.3%
pow273.3%
associate-*r/73.3%
sqrt-div70.8%
pow1/270.8%
pow-unpow70.8%
pow-pow70.8%
metadata-eval70.8%
pow170.8%
hypot-1-def74.3%
Applied egg-rr74.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 (<= (/ (* a_m (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))) INFINITY)
(* a_m (/ (sqrt (pow k (* m 2.0))) (+ 1.0 (* k (+ k 10.0)))))
(+ a_m (* a_m (* k (- (* k 99.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 (((a_m * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= ((double) INFINITY)) {
tmp = a_m * (sqrt(pow(k, (m * 2.0))) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a_m + (a_m * (k * ((k * 99.0) - 10.0)));
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (((a_m * Math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= Double.POSITIVE_INFINITY) {
tmp = a_m * (Math.sqrt(Math.pow(k, (m * 2.0))) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a_m + (a_m * (k * ((k * 99.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 ((a_m * math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= math.inf: tmp = a_m * (math.sqrt(math.pow(k, (m * 2.0))) / (1.0 + (k * (k + 10.0)))) else: tmp = a_m + (a_m * (k * ((k * 99.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 (Float64(Float64(a_m * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= Inf) tmp = Float64(a_m * Float64(sqrt((k ^ Float64(m * 2.0))) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a_m + Float64(a_m * Float64(k * Float64(Float64(k * 99.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 (((a_m * (k ^ m)) / ((1.0 + (k * 10.0)) + (k * k))) <= Inf) tmp = a_m * (sqrt((k ^ (m * 2.0))) / (1.0 + (k * (k + 10.0)))); else tmp = a_m + (a_m * (k * ((k * 99.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[N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(a$95$m * N[(N[Sqrt[N[Power[k, N[(m * 2.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m + N[(a$95$m * N[(k * N[(N[(k * 99.0), $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}\;\frac{a\_m \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\
\;\;\;\;a\_m \cdot \frac{\sqrt{{k}^{\left(m \cdot 2\right)}}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m + a\_m \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0Initial program 97.2%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
add-sqr-sqrt97.2%
sqrt-unprod97.2%
pow-sqr97.2%
Applied egg-rr97.2%
*-commutative97.2%
Simplified97.2%
if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 0.0%
associate-/l*0.0%
remove-double-neg0.0%
distribute-frac-neg20.0%
distribute-neg-frac20.0%
remove-double-neg0.0%
sqr-neg0.0%
associate-+l+0.0%
sqr-neg0.0%
distribute-rgt-out0.0%
Simplified0.0%
Taylor expanded in m around 0 1.6%
Taylor expanded in k around 0 84.2%
Taylor expanded in a around 0 100.0%
Final simplification97.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 (<= (/ (* a_m (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))) INFINITY)
(* a_m (/ (pow k m) (+ 1.0 (* k (+ k 10.0)))))
(+ a_m (* a_m (* k (- (* k 99.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 (((a_m * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= ((double) INFINITY)) {
tmp = a_m * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a_m + (a_m * (k * ((k * 99.0) - 10.0)));
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (((a_m * Math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= Double.POSITIVE_INFINITY) {
tmp = a_m * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a_m + (a_m * (k * ((k * 99.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 ((a_m * math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= math.inf: tmp = a_m * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = a_m + (a_m * (k * ((k * 99.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 (Float64(Float64(a_m * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= Inf) tmp = Float64(a_m * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a_m + Float64(a_m * Float64(k * Float64(Float64(k * 99.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 (((a_m * (k ^ m)) / ((1.0 + (k * 10.0)) + (k * k))) <= Inf) tmp = a_m * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = a_m + (a_m * (k * ((k * 99.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[N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], 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[(a$95$m * N[(k * N[(N[(k * 99.0), $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}\;\frac{a\_m \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\
\;\;\;\;a\_m \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m + a\_m \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0Initial program 97.2%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 0.0%
associate-/l*0.0%
remove-double-neg0.0%
distribute-frac-neg20.0%
distribute-neg-frac20.0%
remove-double-neg0.0%
sqr-neg0.0%
associate-+l+0.0%
sqr-neg0.0%
distribute-rgt-out0.0%
Simplified0.0%
Taylor expanded in m around 0 1.6%
Taylor expanded in k around 0 84.2%
Taylor expanded in a around 0 100.0%
Final simplification97.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 (or (<= m -5.5e-12) (not (<= m 8.5e-6)))
(* a_m (pow k m))
(* a_m (/ 1.0 (+ 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 <= -5.5e-12) || !(m <= 8.5e-6)) {
tmp = a_m * pow(k, m);
} else {
tmp = a_m * (1.0 / (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 <= (-5.5d-12)) .or. (.not. (m <= 8.5d-6))) then
tmp = a_m * (k ** m)
else
tmp = a_m * (1.0d0 / (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 <= -5.5e-12) || !(m <= 8.5e-6)) {
tmp = a_m * Math.pow(k, m);
} else {
tmp = a_m * (1.0 / (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 <= -5.5e-12) or not (m <= 8.5e-6): tmp = a_m * math.pow(k, m) else: tmp = a_m * (1.0 / (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 <= -5.5e-12) || !(m <= 8.5e-6)) tmp = Float64(a_m * (k ^ m)); else tmp = Float64(a_m * Float64(1.0 / 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 <= -5.5e-12) || ~((m <= 8.5e-6))) tmp = a_m * (k ^ m); else tmp = a_m * (1.0 / (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, -5.5e-12], N[Not[LessEqual[m, 8.5e-6]], $MachinePrecision]], N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $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 -5.5 \cdot 10^{-12} \lor \neg \left(m \leq 8.5 \cdot 10^{-6}\right):\\
\;\;\;\;a\_m \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -5.5000000000000004e-12 or 8.4999999999999999e-6 < m Initial program 90.0%
associate-/l*90.0%
remove-double-neg90.0%
distribute-frac-neg290.0%
distribute-neg-frac290.0%
remove-double-neg90.0%
sqr-neg90.0%
associate-+l+90.0%
sqr-neg90.0%
distribute-rgt-out90.0%
Simplified90.0%
Taylor expanded in k around 0 100.0%
if -5.5000000000000004e-12 < m < 8.4999999999999999e-6Initial program 91.2%
associate-/l*91.2%
remove-double-neg91.2%
distribute-frac-neg291.2%
distribute-neg-frac291.2%
remove-double-neg91.2%
sqr-neg91.2%
associate-+l+91.2%
sqr-neg91.2%
distribute-rgt-out91.2%
Simplified91.2%
Taylor expanded in m around 0 90.8%
Final simplification97.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 -3.8e+30)
(/ a_m (+ (* k k) (* k 10.0)))
(if (<= m 1.9)
(* a_m (/ 1.0 (+ 1.0 (* k (+ k 10.0)))))
(+ a_m (* a_m (* k (- (* k 99.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 <= -3.8e+30) {
tmp = a_m / ((k * k) + (k * 10.0));
} else if (m <= 1.9) {
tmp = a_m * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a_m + (a_m * (k * ((k * 99.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 <= (-3.8d+30)) then
tmp = a_m / ((k * k) + (k * 10.0d0))
else if (m <= 1.9d0) then
tmp = a_m * (1.0d0 / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = a_m + (a_m * (k * ((k * 99.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 <= -3.8e+30) {
tmp = a_m / ((k * k) + (k * 10.0));
} else if (m <= 1.9) {
tmp = a_m * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a_m + (a_m * (k * ((k * 99.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 <= -3.8e+30: tmp = a_m / ((k * k) + (k * 10.0)) elif m <= 1.9: tmp = a_m * (1.0 / (1.0 + (k * (k + 10.0)))) else: tmp = a_m + (a_m * (k * ((k * 99.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 <= -3.8e+30) tmp = Float64(a_m / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 1.9) tmp = Float64(a_m * Float64(1.0 / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a_m + Float64(a_m * Float64(k * Float64(Float64(k * 99.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 <= -3.8e+30) tmp = a_m / ((k * k) + (k * 10.0)); elseif (m <= 1.9) tmp = a_m * (1.0 / (1.0 + (k * (k + 10.0)))); else tmp = a_m + (a_m * (k * ((k * 99.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, -3.8e+30], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.9], N[(a$95$m * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m + N[(a$95$m * N[(k * N[(N[(k * 99.0), $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 -3.8 \cdot 10^{+30}:\\
\;\;\;\;\frac{a\_m}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 1.9:\\
\;\;\;\;a\_m \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m + a\_m \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -3.8000000000000001e30Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 44.5%
Taylor expanded in k around inf 44.5%
Taylor expanded in k around inf 49.5%
if -3.8000000000000001e30 < m < 1.8999999999999999Initial program 92.1%
associate-/l*92.1%
remove-double-neg92.1%
distribute-frac-neg292.1%
distribute-neg-frac292.1%
remove-double-neg92.1%
sqr-neg92.1%
associate-+l+92.1%
sqr-neg92.1%
distribute-rgt-out92.1%
Simplified92.1%
Taylor expanded in m around 0 85.7%
if 1.8999999999999999 < m Initial program 78.0%
associate-/l*78.0%
remove-double-neg78.0%
distribute-frac-neg278.0%
distribute-neg-frac278.0%
remove-double-neg78.0%
sqr-neg78.0%
associate-+l+78.0%
sqr-neg78.0%
distribute-rgt-out78.0%
Simplified78.0%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 26.1%
Taylor expanded in a around 0 29.6%
Final simplification55.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 -6.5e+27)
(/ a_m (+ (* k k) (* k 10.0)))
(if (<= m 8.5e+18)
(* a_m (/ 1.0 (+ 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 <= -6.5e+27) {
tmp = a_m / ((k * k) + (k * 10.0));
} else if (m <= 8.5e+18) {
tmp = a_m * (1.0 / (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 <= (-6.5d+27)) then
tmp = a_m / ((k * k) + (k * 10.0d0))
else if (m <= 8.5d+18) then
tmp = a_m * (1.0d0 / (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 <= -6.5e+27) {
tmp = a_m / ((k * k) + (k * 10.0));
} else if (m <= 8.5e+18) {
tmp = a_m * (1.0 / (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 <= -6.5e+27: tmp = a_m / ((k * k) + (k * 10.0)) elif m <= 8.5e+18: tmp = a_m * (1.0 / (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 <= -6.5e+27) tmp = Float64(a_m / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 8.5e+18) tmp = Float64(a_m * Float64(1.0 / 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 <= -6.5e+27) tmp = a_m / ((k * k) + (k * 10.0)); elseif (m <= 8.5e+18) tmp = a_m * (1.0 / (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, -6.5e+27], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.5e+18], N[(a$95$m * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $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 -6.5 \cdot 10^{+27}:\\
\;\;\;\;\frac{a\_m}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;a\_m \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < -6.5000000000000005e27Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 44.5%
Taylor expanded in k around inf 44.5%
Taylor expanded in k around inf 49.5%
if -6.5000000000000005e27 < m < 8.5e18Initial program 90.1%
associate-/l*90.1%
remove-double-neg90.1%
distribute-frac-neg290.1%
distribute-neg-frac290.1%
remove-double-neg90.1%
sqr-neg90.1%
associate-+l+90.1%
sqr-neg90.1%
distribute-rgt-out90.1%
Simplified90.1%
Taylor expanded in m around 0 82.9%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.5%
Final simplification51.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 -3.7e+27)
(/ a_m (+ (* k k) (* k 10.0)))
(if (<= m 8.5e+18) (/ 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 <= -3.7e+27) {
tmp = a_m / ((k * k) + (k * 10.0));
} else if (m <= 8.5e+18) {
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 <= (-3.7d+27)) then
tmp = a_m / ((k * k) + (k * 10.0d0))
else if (m <= 8.5d+18) 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 <= -3.7e+27) {
tmp = a_m / ((k * k) + (k * 10.0));
} else if (m <= 8.5e+18) {
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 <= -3.7e+27: tmp = a_m / ((k * k) + (k * 10.0)) elif m <= 8.5e+18: 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 <= -3.7e+27) tmp = Float64(a_m / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 8.5e+18) 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 <= -3.7e+27) tmp = a_m / ((k * k) + (k * 10.0)); elseif (m <= 8.5e+18) 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, -3.7e+27], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.5e+18], 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 -3.7 \cdot 10^{+27}:\\
\;\;\;\;\frac{a\_m}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;\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 < -3.70000000000000002e27Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 44.5%
Taylor expanded in k around inf 44.5%
Taylor expanded in k around inf 49.5%
if -3.70000000000000002e27 < m < 8.5e18Initial program 90.1%
associate-/l*90.1%
remove-double-neg90.1%
distribute-frac-neg290.1%
distribute-neg-frac290.1%
remove-double-neg90.1%
sqr-neg90.1%
associate-+l+90.1%
sqr-neg90.1%
distribute-rgt-out90.1%
Simplified90.1%
Taylor expanded in m around 0 82.8%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.5%
Final simplification51.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 -1.85e+31)
(* 0.1 (/ a_m k))
(if (<= m 8.5e+18) (/ a_m (+ 1.0 (* 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 <= -1.85e+31) {
tmp = 0.1 * (a_m / k);
} else if (m <= 8.5e+18) {
tmp = a_m / (1.0 + (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 <= (-1.85d+31)) then
tmp = 0.1d0 * (a_m / k)
else if (m <= 8.5d+18) then
tmp = a_m / (1.0d0 + (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 <= -1.85e+31) {
tmp = 0.1 * (a_m / k);
} else if (m <= 8.5e+18) {
tmp = a_m / (1.0 + (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 <= -1.85e+31: tmp = 0.1 * (a_m / k) elif m <= 8.5e+18: tmp = a_m / (1.0 + (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 <= -1.85e+31) tmp = Float64(0.1 * Float64(a_m / k)); elseif (m <= 8.5e+18) tmp = Float64(a_m / Float64(1.0 + 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 <= -1.85e+31) tmp = 0.1 * (a_m / k); elseif (m <= 8.5e+18) tmp = a_m / (1.0 + (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, -1.85e+31], N[(0.1 * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.5e+18], N[(a$95$m / N[(1.0 + N[(k * 10.0), $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 -1.85 \cdot 10^{+31}:\\
\;\;\;\;0.1 \cdot \frac{a\_m}{k}\\
\mathbf{elif}\;m \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < -1.8499999999999999e31Initial 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 k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 15.2%
+-commutative15.2%
*-commutative15.2%
fma-define15.2%
Simplified15.2%
Taylor expanded in k around inf 20.2%
if -1.8499999999999999e31 < m < 8.5e18Initial program 90.2%
associate-/l*90.2%
remove-double-neg90.2%
distribute-frac-neg290.2%
distribute-neg-frac290.2%
remove-double-neg90.2%
sqr-neg90.2%
associate-+l+90.2%
sqr-neg90.2%
distribute-rgt-out90.2%
Simplified90.2%
Taylor expanded in m around 0 81.9%
Taylor expanded in k around 0 56.0%
*-commutative68.6%
Simplified56.0%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.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 (<= m -4.2e-122)
(/ a_m (* k 10.0))
(if (<= m 8.5e+18) 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 <= -4.2e-122) {
tmp = a_m / (k * 10.0);
} else if (m <= 8.5e+18) {
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 <= (-4.2d-122)) then
tmp = a_m / (k * 10.0d0)
else if (m <= 8.5d+18) 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 <= -4.2e-122) {
tmp = a_m / (k * 10.0);
} else if (m <= 8.5e+18) {
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 <= -4.2e-122: tmp = a_m / (k * 10.0) elif m <= 8.5e+18: 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 <= -4.2e-122) tmp = Float64(a_m / Float64(k * 10.0)); elseif (m <= 8.5e+18) 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 <= -4.2e-122) tmp = a_m / (k * 10.0); elseif (m <= 8.5e+18) 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, -4.2e-122], N[(a$95$m / N[(k * 10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.5e+18], 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 -4.2 \cdot 10^{-122}:\\
\;\;\;\;\frac{a\_m}{k \cdot 10}\\
\mathbf{elif}\;m \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < -4.19999999999999985e-122Initial program 97.3%
associate-/l*97.3%
remove-double-neg97.3%
distribute-frac-neg297.3%
distribute-neg-frac297.3%
remove-double-neg97.3%
sqr-neg97.3%
associate-+l+97.3%
sqr-neg97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in k around 0 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in m around 0 18.5%
+-commutative18.5%
*-commutative18.5%
fma-define18.5%
Simplified18.5%
Taylor expanded in k around inf 21.2%
*-commutative21.2%
Simplified21.2%
if -4.19999999999999985e-122 < m < 8.5e18Initial program 91.7%
associate-/l*91.7%
remove-double-neg91.7%
distribute-frac-neg291.7%
distribute-neg-frac291.7%
remove-double-neg91.7%
sqr-neg91.7%
associate-+l+91.7%
sqr-neg91.7%
distribute-rgt-out91.7%
Simplified91.7%
Taylor expanded in m around 0 89.9%
Taylor expanded in k around 0 53.0%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.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 (<= m -4.3e-122)
(* 0.1 (/ a_m k))
(if (<= m 8.5e+18) 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 <= -4.3e-122) {
tmp = 0.1 * (a_m / k);
} else if (m <= 8.5e+18) {
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 <= (-4.3d-122)) then
tmp = 0.1d0 * (a_m / k)
else if (m <= 8.5d+18) 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 <= -4.3e-122) {
tmp = 0.1 * (a_m / k);
} else if (m <= 8.5e+18) {
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 <= -4.3e-122: tmp = 0.1 * (a_m / k) elif m <= 8.5e+18: 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 <= -4.3e-122) tmp = Float64(0.1 * Float64(a_m / k)); elseif (m <= 8.5e+18) 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 <= -4.3e-122) tmp = 0.1 * (a_m / k); elseif (m <= 8.5e+18) 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, -4.3e-122], N[(0.1 * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.5e+18], 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 -4.3 \cdot 10^{-122}:\\
\;\;\;\;0.1 \cdot \frac{a\_m}{k}\\
\mathbf{elif}\;m \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < -4.30000000000000019e-122Initial program 97.3%
associate-/l*97.3%
remove-double-neg97.3%
distribute-frac-neg297.3%
distribute-neg-frac297.3%
remove-double-neg97.3%
sqr-neg97.3%
associate-+l+97.3%
sqr-neg97.3%
distribute-rgt-out97.3%
Simplified97.3%
Taylor expanded in k around 0 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in m around 0 18.5%
+-commutative18.5%
*-commutative18.5%
fma-define18.5%
Simplified18.5%
Taylor expanded in k around inf 20.2%
if -4.30000000000000019e-122 < m < 8.5e18Initial program 91.7%
associate-/l*91.7%
remove-double-neg91.7%
distribute-frac-neg291.7%
distribute-neg-frac291.7%
remove-double-neg91.7%
sqr-neg91.7%
associate-+l+91.7%
sqr-neg91.7%
distribute-rgt-out91.7%
Simplified91.7%
Taylor expanded in m around 0 89.9%
Taylor expanded in k around 0 53.0%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.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 (<= m 8.5e+18) (/ 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 <= 8.5e+18) {
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 <= 8.5d+18) 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 <= 8.5e+18) {
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 <= 8.5e+18: 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 <= 8.5e+18) 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 <= 8.5e+18) 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, 8.5e+18], 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 8.5 \cdot 10^{+18}:\\
\;\;\;\;\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 < 8.5e18Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 63.6%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.5%
Final simplification49.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 8.5e+18) (* a_m (/ 1.0 (+ 1.0 (* k k)))) (* -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 <= 8.5e+18) {
tmp = a_m * (1.0 / (1.0 + (k * k)));
} 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 <= 8.5d+18) then
tmp = a_m * (1.0d0 / (1.0d0 + (k * k)))
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 <= 8.5e+18) {
tmp = a_m * (1.0 / (1.0 + (k * k)));
} 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 <= 8.5e+18: tmp = a_m * (1.0 / (1.0 + (k * k))) 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 <= 8.5e+18) tmp = Float64(a_m * Float64(1.0 / Float64(1.0 + Float64(k * k)))); 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 <= 8.5e+18) tmp = a_m * (1.0 / (1.0 + (k * k))); 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, 8.5e+18], N[(a$95$m * N[(1.0 / N[(1.0 + N[(k * k), $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 8.5 \cdot 10^{+18}:\\
\;\;\;\;a\_m \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < 8.5e18Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
add-sqr-sqrt95.1%
sqrt-unprod95.1%
pow-sqr95.1%
Applied egg-rr95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in k around inf 93.7%
Taylor expanded in m around 0 62.4%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.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 (<= m 8.5e+18) (/ a_m (+ 1.0 (* k k))) (* -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 <= 8.5e+18) {
tmp = a_m / (1.0 + (k * k));
} 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 <= 8.5d+18) then
tmp = a_m / (1.0d0 + (k * k))
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 <= 8.5e+18) {
tmp = a_m / (1.0 + (k * k));
} 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 <= 8.5e+18: tmp = a_m / (1.0 + (k * k)) 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 <= 8.5e+18) tmp = Float64(a_m / Float64(1.0 + Float64(k * k))); 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 <= 8.5e+18) tmp = a_m / (1.0 + (k * k)); 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, 8.5e+18], N[(a$95$m / N[(1.0 + N[(k * k), $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 8.5 \cdot 10^{+18}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < 8.5e18Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 63.6%
Taylor expanded in k around inf 62.4%
if 8.5e18 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.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 (<= m 2.6e+19) 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.6e+19) {
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.6d+19) 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.6e+19) {
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.6e+19: 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.6e+19) 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.6e+19) 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.6e+19], 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.6 \cdot 10^{+19}:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < 2.6e19Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 63.6%
Taylor expanded in k around 0 24.4%
if 2.6e19 < m Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in k around inf 18.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 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 90.3%
associate-/l*90.3%
remove-double-neg90.3%
distribute-frac-neg290.3%
distribute-neg-frac290.3%
remove-double-neg90.3%
sqr-neg90.3%
associate-+l+90.3%
sqr-neg90.3%
distribute-rgt-out90.3%
Simplified90.3%
Taylor expanded in m around 0 44.9%
Taylor expanded in k around 0 18.0%
herbie shell --seed 2024177
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))