
(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)) (+ (* k k) (+ 1.0 (* k 10.0))))))
(*
a_s
(if (<= t_0 INFINITY)
t_0
(+ a_m (* (pow k 2.0) (- (* a_m (pow k 2.0)) 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 t_0 = (a_m * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = a_m + (pow(k, 2.0) * ((a_m * pow(k, 2.0)) - a_m));
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = (a_m * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = a_m + (Math.pow(k, 2.0) * ((a_m * Math.pow(k, 2.0)) - 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): t_0 = (a_m * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = a_m + (math.pow(k, 2.0) * ((a_m * math.pow(k, 2.0)) - a_m)) 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(Float64(a_m * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(a_m + Float64((k ^ 2.0) * Float64(Float64(a_m * (k ^ 2.0)) - 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) t_0 = (a_m * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = a_m + ((k ^ 2.0) * ((a_m * (k ^ 2.0)) - 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_] := Block[{t$95$0 = N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$0, Infinity], t$95$0, N[(a$95$m + N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[(a$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \frac{a\_m \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;a\_m + {k}^{2} \cdot \left(a\_m \cdot {k}^{2} - a\_m\right)\\
\end{array}
\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 99.4%
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%
distribute-lft-in0.0%
associate-+l+0.0%
associate-*r/0.0%
clear-num0.0%
associate-+l+0.0%
distribute-lft-in0.0%
+-commutative0.0%
fma-define0.0%
+-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in m around 0 1.8%
Taylor expanded in k around inf 1.8%
Taylor expanded in k around 0 20.4%
Final simplification73.2%
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)) (+ (* k k) (+ 1.0 (* k 10.0)))))) (* a_s (if (<= t_0 INFINITY) t_0 (log1p (expm1 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 t_0 = (a_m * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = log1p(expm1(a_m));
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = (a_m * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = Math.log1p(Math.expm1(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): t_0 = (a_m * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = math.log1p(math.expm1(a_m)) 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(Float64(a_m * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = log1p(expm1(a_m)); end return Float64(a_s * tmp) end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$0, Infinity], t$95$0, N[Log[1 + N[(Exp[a$95$m] - 1), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \frac{a\_m \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(a\_m\right)\right)\\
\end{array}
\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 99.4%
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%
distribute-lft-in0.0%
associate-+l+0.0%
associate-*r/0.0%
clear-num0.0%
associate-+l+0.0%
distribute-lft-in0.0%
+-commutative0.0%
fma-define0.0%
+-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in m around 0 1.8%
Taylor expanded in k around 0 2.4%
remove-double-div2.4%
log1p-expm1-u14.1%
Applied egg-rr14.1%
Final simplification71.0%
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)) (+ (* k k) (+ 1.0 (* k 10.0))))))
(*
a_s
(if (<= t_0 INFINITY)
t_0
(+ a_m (* k (+ (* k (* a_m 99.0)) (* a_m -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 t_0 = (a_m * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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 t_0 = (a_m * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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): t_0 = (a_m * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -10.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(Float64(a_m * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(a_m + Float64(k * Float64(Float64(k * Float64(a_m * 99.0)) + Float64(a_m * -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) t_0 = (a_m * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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_] := Block[{t$95$0 = N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$0, Infinity], t$95$0, N[(a$95$m + N[(k * N[(N[(k * N[(a$95$m * 99.0), $MachinePrecision]), $MachinePrecision] + N[(a$95$m * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \frac{a\_m \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;a\_m + k \cdot \left(k \cdot \left(a\_m \cdot 99\right) + a\_m \cdot -10\right)\\
\end{array}
\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 99.4%
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.8%
Taylor expanded in k around 0 15.4%
cancel-sign-sub-inv15.4%
mul-1-neg15.4%
distribute-rgt-neg-in15.4%
distribute-rgt1-in15.4%
metadata-eval15.4%
distribute-lft-neg-in15.4%
metadata-eval15.4%
metadata-eval15.4%
*-commutative15.4%
Simplified15.4%
Final simplification71.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.9)
(* 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.9) {
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.9d0) 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.9) {
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.9: 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.9) 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.9) 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.9], 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.9:\\
\;\;\;\;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.89999999999999991Initial program 62.6%
associate-/l*62.6%
remove-double-neg62.6%
distribute-frac-neg262.6%
distribute-neg-frac262.6%
remove-double-neg62.6%
sqr-neg62.6%
associate-+l+62.6%
sqr-neg62.6%
distribute-rgt-out62.6%
Simplified62.6%
if 2.89999999999999991 < m Initial program 77.8%
associate-/l*77.8%
remove-double-neg77.8%
distribute-frac-neg277.8%
distribute-neg-frac277.8%
remove-double-neg77.8%
sqr-neg77.8%
associate-+l+77.8%
sqr-neg77.8%
distribute-rgt-out77.8%
Simplified77.8%
Taylor expanded in k around 0 100.0%
Final simplification71.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 (<= m -1850000000.0) (not (<= m 0.47)))
(* a_m (pow k m))
(/ 1.0 (+ (/ 1.0 a_m) (* k (+ (* 10.0 (/ 1.0 a_m)) (/ k a_m))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if ((m <= -1850000000.0) || !(m <= 0.47)) {
tmp = a_m * pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m))));
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-1850000000.0d0)) .or. (.not. (m <= 0.47d0))) then
tmp = a_m * (k ** m)
else
tmp = 1.0d0 / ((1.0d0 / a_m) + (k * ((10.0d0 * (1.0d0 / a_m)) + (k / a_m))))
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if ((m <= -1850000000.0) || !(m <= 0.47)) {
tmp = a_m * Math.pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m))));
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if (m <= -1850000000.0) or not (m <= 0.47): tmp = a_m * math.pow(k, m) else: tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m)))) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if ((m <= -1850000000.0) || !(m <= 0.47)) tmp = Float64(a_m * (k ^ m)); else tmp = Float64(1.0 / Float64(Float64(1.0 / a_m) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a_m)) + Float64(k / a_m))))); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if ((m <= -1850000000.0) || ~((m <= 0.47))) tmp = a_m * (k ^ m); else tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m)))); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[Or[LessEqual[m, -1850000000.0], N[Not[LessEqual[m, 0.47]], $MachinePrecision]], N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a$95$m), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a$95$m), $MachinePrecision]), $MachinePrecision] + N[(k / a$95$m), $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 -1850000000 \lor \neg \left(m \leq 0.47\right):\\
\;\;\;\;a\_m \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a\_m} + k \cdot \left(10 \cdot \frac{1}{a\_m} + \frac{k}{a\_m}\right)}\\
\end{array}
\end{array}
if m < -1.85e9 or 0.46999999999999997 < m Initial program 88.2%
associate-/l*88.2%
remove-double-neg88.2%
distribute-frac-neg288.2%
distribute-neg-frac288.2%
remove-double-neg88.2%
sqr-neg88.2%
associate-+l+88.2%
sqr-neg88.2%
distribute-rgt-out88.2%
Simplified88.2%
Taylor expanded in k around 0 100.0%
if -1.85e9 < m < 0.46999999999999997Initial program 47.4%
associate-/l*47.4%
remove-double-neg47.4%
distribute-frac-neg247.4%
distribute-neg-frac247.4%
remove-double-neg47.4%
sqr-neg47.4%
associate-+l+47.4%
sqr-neg47.4%
distribute-rgt-out47.4%
Simplified47.4%
distribute-lft-in47.4%
associate-+l+47.4%
associate-*r/47.4%
clear-num47.3%
associate-+l+47.3%
distribute-lft-in47.3%
+-commutative47.3%
fma-define47.3%
+-commutative47.3%
*-commutative47.3%
Applied egg-rr47.3%
Taylor expanded in m around 0 47.7%
Taylor expanded in k around 0 48.4%
Final simplification72.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 -1e-25)
(/ a_m (* k k))
(if (<= m 0.98)
(/ 1.0 (+ (/ 1.0 a_m) (* k (+ (* 10.0 (/ 1.0 a_m)) (/ k a_m)))))
(+ a_m (* k (+ (* k (* a_m 99.0)) (* a_m -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 <= -1e-25) {
tmp = a_m / (k * k);
} else if (m <= 0.98) {
tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m))));
} else {
tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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 <= (-1d-25)) then
tmp = a_m / (k * k)
else if (m <= 0.98d0) then
tmp = 1.0d0 / ((1.0d0 / a_m) + (k * ((10.0d0 * (1.0d0 / a_m)) + (k / a_m))))
else
tmp = a_m + (k * ((k * (a_m * 99.0d0)) + (a_m * (-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 <= -1e-25) {
tmp = a_m / (k * k);
} else if (m <= 0.98) {
tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m))));
} else {
tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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 <= -1e-25: tmp = a_m / (k * k) elif m <= 0.98: tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m)))) else: tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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 <= -1e-25) tmp = Float64(a_m / Float64(k * k)); elseif (m <= 0.98) tmp = Float64(1.0 / Float64(Float64(1.0 / a_m) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a_m)) + Float64(k / a_m))))); else tmp = Float64(a_m + Float64(k * Float64(Float64(k * Float64(a_m * 99.0)) + Float64(a_m * -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 <= -1e-25) tmp = a_m / (k * k); elseif (m <= 0.98) tmp = 1.0 / ((1.0 / a_m) + (k * ((10.0 * (1.0 / a_m)) + (k / a_m)))); else tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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, -1e-25], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.98], N[(1.0 / N[(N[(1.0 / a$95$m), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a$95$m), $MachinePrecision]), $MachinePrecision] + N[(k / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m + N[(k * N[(N[(k * N[(a$95$m * 99.0), $MachinePrecision]), $MachinePrecision] + N[(a$95$m * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -1 \cdot 10^{-25}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.98:\\
\;\;\;\;\frac{1}{\frac{1}{a\_m} + k \cdot \left(10 \cdot \frac{1}{a\_m} + \frac{k}{a\_m}\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m + k \cdot \left(k \cdot \left(a\_m \cdot 99\right) + a\_m \cdot -10\right)\\
\end{array}
\end{array}
if m < -1.00000000000000004e-25Initial program 93.4%
associate-/l*93.4%
remove-double-neg93.4%
distribute-frac-neg293.4%
distribute-neg-frac293.4%
remove-double-neg93.4%
sqr-neg93.4%
associate-+l+93.4%
sqr-neg93.4%
distribute-rgt-out93.4%
Simplified93.4%
Taylor expanded in m around 0 37.0%
Taylor expanded in k around inf 57.5%
unpow257.5%
Applied egg-rr57.5%
if -1.00000000000000004e-25 < m < 0.97999999999999998Initial program 48.4%
associate-/l*48.4%
remove-double-neg48.4%
distribute-frac-neg248.4%
distribute-neg-frac248.4%
remove-double-neg48.4%
sqr-neg48.4%
associate-+l+48.4%
sqr-neg48.4%
distribute-rgt-out48.4%
Simplified48.4%
distribute-lft-in48.4%
associate-+l+48.4%
associate-*r/48.4%
clear-num48.3%
associate-+l+48.3%
distribute-lft-in48.3%
+-commutative48.3%
fma-define48.3%
+-commutative48.3%
*-commutative48.3%
Applied egg-rr48.3%
Taylor expanded in m around 0 48.8%
Taylor expanded in k around 0 49.5%
if 0.97999999999999998 < m Initial program 77.8%
associate-/l*77.8%
remove-double-neg77.8%
distribute-frac-neg277.8%
distribute-neg-frac277.8%
remove-double-neg77.8%
sqr-neg77.8%
associate-+l+77.8%
sqr-neg77.8%
distribute-rgt-out77.8%
Simplified77.8%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 19.4%
cancel-sign-sub-inv19.4%
mul-1-neg19.4%
distribute-rgt-neg-in19.4%
distribute-rgt1-in19.4%
metadata-eval19.4%
distribute-lft-neg-in19.4%
metadata-eval19.4%
metadata-eval19.4%
*-commutative19.4%
Simplified19.4%
Final simplification44.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 (<= m -1e-25)
(/ a_m (* k k))
(if (<= m 0.14)
(/ a_m (+ (* k k) (+ 1.0 (* k 10.0))))
(+ a_m (* k (+ (* k (* a_m 99.0)) (* a_m -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 <= -1e-25) {
tmp = a_m / (k * k);
} else if (m <= 0.14) {
tmp = a_m / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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 <= (-1d-25)) then
tmp = a_m / (k * k)
else if (m <= 0.14d0) then
tmp = a_m / ((k * k) + (1.0d0 + (k * 10.0d0)))
else
tmp = a_m + (k * ((k * (a_m * 99.0d0)) + (a_m * (-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 <= -1e-25) {
tmp = a_m / (k * k);
} else if (m <= 0.14) {
tmp = a_m / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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 <= -1e-25: tmp = a_m / (k * k) elif m <= 0.14: tmp = a_m / ((k * k) + (1.0 + (k * 10.0))) else: tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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 <= -1e-25) tmp = Float64(a_m / Float64(k * k)); elseif (m <= 0.14) tmp = Float64(a_m / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))); else tmp = Float64(a_m + Float64(k * Float64(Float64(k * Float64(a_m * 99.0)) + Float64(a_m * -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 <= -1e-25) tmp = a_m / (k * k); elseif (m <= 0.14) tmp = a_m / ((k * k) + (1.0 + (k * 10.0))); else tmp = a_m + (k * ((k * (a_m * 99.0)) + (a_m * -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, -1e-25], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.14], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m + N[(k * N[(N[(k * N[(a$95$m * 99.0), $MachinePrecision]), $MachinePrecision] + N[(a$95$m * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -1 \cdot 10^{-25}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.14:\\
\;\;\;\;\frac{a\_m}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m + k \cdot \left(k \cdot \left(a\_m \cdot 99\right) + a\_m \cdot -10\right)\\
\end{array}
\end{array}
if m < -1.00000000000000004e-25Initial program 93.4%
associate-/l*93.4%
remove-double-neg93.4%
distribute-frac-neg293.4%
distribute-neg-frac293.4%
remove-double-neg93.4%
sqr-neg93.4%
associate-+l+93.4%
sqr-neg93.4%
distribute-rgt-out93.4%
Simplified93.4%
Taylor expanded in m around 0 37.0%
Taylor expanded in k around inf 57.5%
unpow257.5%
Applied egg-rr57.5%
if -1.00000000000000004e-25 < m < 0.14000000000000001Initial program 48.4%
*-commutative48.4%
Simplified48.4%
Taylor expanded in m around 0 48.9%
if 0.14000000000000001 < m Initial program 77.8%
associate-/l*77.8%
remove-double-neg77.8%
distribute-frac-neg277.8%
distribute-neg-frac277.8%
remove-double-neg77.8%
sqr-neg77.8%
associate-+l+77.8%
sqr-neg77.8%
distribute-rgt-out77.8%
Simplified77.8%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 19.4%
cancel-sign-sub-inv19.4%
mul-1-neg19.4%
distribute-rgt-neg-in19.4%
distribute-rgt1-in19.4%
metadata-eval19.4%
distribute-lft-neg-in19.4%
metadata-eval19.4%
metadata-eval19.4%
*-commutative19.4%
Simplified19.4%
Final simplification43.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 (or (<= k 1.5e-298) (not (<= k 0.1)))
(/ 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 <= 1.5e-298) || !(k <= 0.1)) {
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 <= 1.5d-298) .or. (.not. (k <= 0.1d0))) 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 <= 1.5e-298) || !(k <= 0.1)) {
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 <= 1.5e-298) or not (k <= 0.1): 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 <= 1.5e-298) || !(k <= 0.1)) tmp = Float64(a_m / Float64(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 <= 1.5e-298) || ~((k <= 0.1))) 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, 1.5e-298], N[Not[LessEqual[k, 0.1]], $MachinePrecision]], N[(a$95$m / N[(k * k), $MachinePrecision]), $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 1.5 \cdot 10^{-298} \lor \neg \left(k \leq 0.1\right):\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if k < 1.5e-298 or 0.10000000000000001 < k Initial program 54.9%
associate-/l*54.9%
remove-double-neg54.9%
distribute-frac-neg254.9%
distribute-neg-frac254.9%
remove-double-neg54.9%
sqr-neg54.9%
associate-+l+54.9%
sqr-neg54.9%
distribute-rgt-out54.9%
Simplified54.9%
Taylor expanded in m around 0 27.1%
Taylor expanded in k around inf 29.0%
unpow229.0%
Applied egg-rr29.0%
if 1.5e-298 < 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 k around 0 75.7%
associate-*r*75.7%
*-lft-identity75.7%
distribute-rgt-out98.8%
*-commutative98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in m around 0 55.9%
Final simplification35.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 (<= k 2.5e-298)
(* a_m (/ (/ 1.0 k) k))
(if (<= k 10.2) (/ a_m (+ 1.0 (* k 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 (k <= 2.5e-298) {
tmp = a_m * ((1.0 / k) / k);
} else if (k <= 10.2) {
tmp = a_m / (1.0 + (k * 10.0));
} 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 (k <= 2.5d-298) then
tmp = a_m * ((1.0d0 / k) / k)
else if (k <= 10.2d0) then
tmp = a_m / (1.0d0 + (k * 10.0d0))
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 (k <= 2.5e-298) {
tmp = a_m * ((1.0 / k) / k);
} else if (k <= 10.2) {
tmp = a_m / (1.0 + (k * 10.0));
} 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 k <= 2.5e-298: tmp = a_m * ((1.0 / k) / k) elif k <= 10.2: tmp = a_m / (1.0 + (k * 10.0)) 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 (k <= 2.5e-298) tmp = Float64(a_m * Float64(Float64(1.0 / k) / k)); elseif (k <= 10.2) tmp = Float64(a_m / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a_m / Float64(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 (k <= 2.5e-298) tmp = a_m * ((1.0 / k) / k); elseif (k <= 10.2) tmp = a_m / (1.0 + (k * 10.0)); 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[k, 2.5e-298], N[(a$95$m * N[(N[(1.0 / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 10.2], N[(a$95$m / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 2.5 \cdot 10^{-298}:\\
\;\;\;\;a\_m \cdot \frac{\frac{1}{k}}{k}\\
\mathbf{elif}\;k \leq 10.2:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\end{array}
\end{array}
if k < 2.5000000000000001e-298Initial program 39.8%
associate-/l*39.8%
remove-double-neg39.8%
distribute-frac-neg239.8%
distribute-neg-frac239.8%
remove-double-neg39.8%
sqr-neg39.8%
associate-+l+39.8%
sqr-neg39.8%
distribute-rgt-out39.8%
Simplified39.8%
Taylor expanded in m around 0 11.6%
Taylor expanded in k around inf 15.3%
*-un-lft-identity15.3%
div-inv15.3%
pow-flip15.3%
metadata-eval15.3%
Applied egg-rr15.3%
*-lft-identity15.3%
Simplified15.3%
metadata-eval15.3%
pow-prod-up15.3%
unpow-115.3%
unpow-115.3%
Applied egg-rr15.3%
associate-*l/15.3%
*-lft-identity15.3%
Simplified15.3%
if 2.5000000000000001e-298 < k < 10.199999999999999Initial 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 57.0%
Taylor expanded in k around 0 56.3%
*-commutative56.3%
Simplified56.3%
if 10.199999999999999 < k Initial program 85.6%
associate-/l*85.6%
remove-double-neg85.6%
distribute-frac-neg285.6%
distribute-neg-frac285.6%
remove-double-neg85.6%
sqr-neg85.6%
associate-+l+85.6%
sqr-neg85.6%
distribute-rgt-out85.5%
Simplified85.5%
Taylor expanded in m around 0 58.6%
Taylor expanded in k around inf 56.6%
unpow256.6%
Applied egg-rr56.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 (<= k 1.5e-298)
(* a_m (/ (/ 1.0 k) k))
(if (<= k 0.1) (+ a_m (* -10.0 (* a_m 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 (k <= 1.5e-298) {
tmp = a_m * ((1.0 / k) / k);
} else if (k <= 0.1) {
tmp = a_m + (-10.0 * (a_m * 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 (k <= 1.5d-298) then
tmp = a_m * ((1.0d0 / k) / k)
else if (k <= 0.1d0) then
tmp = a_m + ((-10.0d0) * (a_m * 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 (k <= 1.5e-298) {
tmp = a_m * ((1.0 / k) / k);
} else if (k <= 0.1) {
tmp = a_m + (-10.0 * (a_m * 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 k <= 1.5e-298: tmp = a_m * ((1.0 / k) / k) elif k <= 0.1: tmp = a_m + (-10.0 * (a_m * 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 (k <= 1.5e-298) tmp = Float64(a_m * Float64(Float64(1.0 / k) / k)); elseif (k <= 0.1) tmp = Float64(a_m + Float64(-10.0 * Float64(a_m * k))); else tmp = Float64(a_m / Float64(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 (k <= 1.5e-298) tmp = a_m * ((1.0 / k) / k); elseif (k <= 0.1) tmp = a_m + (-10.0 * (a_m * 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[k, 1.5e-298], N[(a$95$m * N[(N[(1.0 / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.1], N[(a$95$m + N[(-10.0 * N[(a$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{-298}:\\
\;\;\;\;a\_m \cdot \frac{\frac{1}{k}}{k}\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a\_m + -10 \cdot \left(a\_m \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\end{array}
\end{array}
if k < 1.5e-298Initial program 39.8%
associate-/l*39.8%
remove-double-neg39.8%
distribute-frac-neg239.8%
distribute-neg-frac239.8%
remove-double-neg39.8%
sqr-neg39.8%
associate-+l+39.8%
sqr-neg39.8%
distribute-rgt-out39.8%
Simplified39.8%
Taylor expanded in m around 0 11.6%
Taylor expanded in k around inf 15.3%
*-un-lft-identity15.3%
div-inv15.3%
pow-flip15.3%
metadata-eval15.3%
Applied egg-rr15.3%
*-lft-identity15.3%
Simplified15.3%
metadata-eval15.3%
pow-prod-up15.3%
unpow-115.3%
unpow-115.3%
Applied egg-rr15.3%
associate-*l/15.3%
*-lft-identity15.3%
Simplified15.3%
if 1.5e-298 < 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 57.0%
Taylor expanded in k around 0 55.9%
if 0.10000000000000001 < k Initial program 85.6%
associate-/l*85.6%
remove-double-neg85.6%
distribute-frac-neg285.6%
distribute-neg-frac285.6%
remove-double-neg85.6%
sqr-neg85.6%
associate-+l+85.6%
sqr-neg85.6%
distribute-rgt-out85.5%
Simplified85.5%
Taylor expanded in m around 0 58.6%
Taylor expanded in k around inf 56.6%
unpow256.6%
Applied egg-rr56.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 (<= k 8.5e-297)
(* a_m (/ (/ 1.0 k) k))
(if (<= k 0.098) (* a_m (+ 1.0 (* k -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 (k <= 8.5e-297) {
tmp = a_m * ((1.0 / k) / k);
} else if (k <= 0.098) {
tmp = a_m * (1.0 + (k * -10.0));
} 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 (k <= 8.5d-297) then
tmp = a_m * ((1.0d0 / k) / k)
else if (k <= 0.098d0) then
tmp = a_m * (1.0d0 + (k * (-10.0d0)))
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 (k <= 8.5e-297) {
tmp = a_m * ((1.0 / k) / k);
} else if (k <= 0.098) {
tmp = a_m * (1.0 + (k * -10.0));
} 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 k <= 8.5e-297: tmp = a_m * ((1.0 / k) / k) elif k <= 0.098: tmp = a_m * (1.0 + (k * -10.0)) 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 (k <= 8.5e-297) tmp = Float64(a_m * Float64(Float64(1.0 / k) / k)); elseif (k <= 0.098) tmp = Float64(a_m * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(a_m / Float64(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 (k <= 8.5e-297) tmp = a_m * ((1.0 / k) / k); elseif (k <= 0.098) tmp = a_m * (1.0 + (k * -10.0)); 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[k, 8.5e-297], N[(a$95$m * N[(N[(1.0 / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.098], N[(a$95$m * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 8.5 \cdot 10^{-297}:\\
\;\;\;\;a\_m \cdot \frac{\frac{1}{k}}{k}\\
\mathbf{elif}\;k \leq 0.098:\\
\;\;\;\;a\_m \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\end{array}
\end{array}
if k < 8.49999999999999991e-297Initial program 39.8%
associate-/l*39.8%
remove-double-neg39.8%
distribute-frac-neg239.8%
distribute-neg-frac239.8%
remove-double-neg39.8%
sqr-neg39.8%
associate-+l+39.8%
sqr-neg39.8%
distribute-rgt-out39.8%
Simplified39.8%
Taylor expanded in m around 0 11.6%
Taylor expanded in k around inf 15.3%
*-un-lft-identity15.3%
div-inv15.3%
pow-flip15.3%
metadata-eval15.3%
Applied egg-rr15.3%
*-lft-identity15.3%
Simplified15.3%
metadata-eval15.3%
pow-prod-up15.3%
unpow-115.3%
unpow-115.3%
Applied egg-rr15.3%
associate-*l/15.3%
*-lft-identity15.3%
Simplified15.3%
if 8.49999999999999991e-297 < k < 0.098000000000000004Initial 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 75.7%
associate-*r*75.7%
*-lft-identity75.7%
distribute-rgt-out98.8%
*-commutative98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in m around 0 55.9%
if 0.098000000000000004 < k Initial program 85.6%
associate-/l*85.6%
remove-double-neg85.6%
distribute-frac-neg285.6%
distribute-neg-frac285.6%
remove-double-neg85.6%
sqr-neg85.6%
associate-+l+85.6%
sqr-neg85.6%
distribute-rgt-out85.5%
Simplified85.5%
Taylor expanded in m around 0 58.6%
Taylor expanded in k around inf 56.6%
unpow256.6%
Applied egg-rr56.6%
Final simplification35.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 -1e-25) (/ a_m (* k k)) (/ a_m (+ (* k k) (+ 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 (m <= -1e-25) {
tmp = a_m / (k * k);
} else {
tmp = a_m / ((k * k) + (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 (m <= (-1d-25)) then
tmp = a_m / (k * k)
else
tmp = a_m / ((k * k) + (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 (m <= -1e-25) {
tmp = a_m / (k * k);
} else {
tmp = a_m / ((k * k) + (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 m <= -1e-25: tmp = a_m / (k * k) else: tmp = a_m / ((k * k) + (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 (m <= -1e-25) tmp = Float64(a_m / Float64(k * k)); else tmp = Float64(a_m / Float64(Float64(k * k) + 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 (m <= -1e-25) tmp = a_m / (k * k); else tmp = a_m / ((k * k) + (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[LessEqual[m, -1e-25], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -1 \cdot 10^{-25}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\end{array}
\end{array}
if m < -1.00000000000000004e-25Initial program 93.4%
associate-/l*93.4%
remove-double-neg93.4%
distribute-frac-neg293.4%
distribute-neg-frac293.4%
remove-double-neg93.4%
sqr-neg93.4%
associate-+l+93.4%
sqr-neg93.4%
distribute-rgt-out93.4%
Simplified93.4%
Taylor expanded in m around 0 37.0%
Taylor expanded in k around inf 57.5%
unpow257.5%
Applied egg-rr57.5%
if -1.00000000000000004e-25 < m Initial program 57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in m around 0 34.0%
Final simplification39.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 (or (<= k 8.6e-290) (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 <= 8.6e-290) || !(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 <= 8.6d-290) .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 <= 8.6e-290) || !(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 <= 8.6e-290) 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 <= 8.6e-290) || !(k <= 1.0)) tmp = Float64(a_m / Float64(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 <= 8.6e-290) || ~((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, 8.6e-290], N[Not[LessEqual[k, 1.0]], $MachinePrecision]], N[(a$95$m / N[(k * k), $MachinePrecision]), $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 8.6 \cdot 10^{-290} \lor \neg \left(k \leq 1\right):\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\_m\\
\end{array}
\end{array}
if k < 8.6000000000000004e-290 or 1 < k Initial program 54.9%
associate-/l*54.9%
remove-double-neg54.9%
distribute-frac-neg254.9%
distribute-neg-frac254.9%
remove-double-neg54.9%
sqr-neg54.9%
associate-+l+54.9%
sqr-neg54.9%
distribute-rgt-out54.9%
Simplified54.9%
Taylor expanded in m around 0 27.1%
Taylor expanded in k around inf 29.0%
unpow229.0%
Applied egg-rr29.0%
if 8.6000000000000004e-290 < 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 57.0%
Taylor expanded in k around 0 54.0%
Final simplification35.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 -1e-25) (/ a_m (* k k)) (/ 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 <= -1e-25) {
tmp = a_m / (k * k);
} 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 <= (-1d-25)) then
tmp = a_m / (k * k)
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 <= -1e-25) {
tmp = a_m / (k * k);
} 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 <= -1e-25: tmp = a_m / (k * k) 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 <= -1e-25) tmp = Float64(a_m / Float64(k * k)); 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 <= -1e-25) tmp = a_m / (k * k); 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[LessEqual[m, -1e-25], N[(a$95$m / N[(k * k), $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 -1 \cdot 10^{-25}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -1.00000000000000004e-25Initial program 93.4%
associate-/l*93.4%
remove-double-neg93.4%
distribute-frac-neg293.4%
distribute-neg-frac293.4%
remove-double-neg93.4%
sqr-neg93.4%
associate-+l+93.4%
sqr-neg93.4%
distribute-rgt-out93.4%
Simplified93.4%
Taylor expanded in m around 0 37.0%
Taylor expanded in k around inf 57.5%
unpow257.5%
Applied egg-rr57.5%
if -1.00000000000000004e-25 < m Initial program 57.9%
associate-/l*57.9%
remove-double-neg57.9%
distribute-frac-neg257.9%
distribute-neg-frac257.9%
remove-double-neg57.9%
sqr-neg57.9%
associate-+l+57.9%
sqr-neg57.9%
distribute-rgt-out57.9%
Simplified57.9%
Taylor expanded in m around 0 34.0%
Final simplification39.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 -1e-25) (/ a_m (* 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 <= -1e-25) {
tmp = a_m / (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 <= (-1d-25)) then
tmp = a_m / (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 <= -1e-25) {
tmp = a_m / (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 <= -1e-25: tmp = a_m / (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 <= -1e-25) tmp = Float64(a_m / Float64(k * k)); else tmp = Float64(a_m / Float64(1.0 + Float64(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 <= -1e-25) tmp = a_m / (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, -1e-25], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(1.0 + N[(k * 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}\;m \leq -1 \cdot 10^{-25}:\\
\;\;\;\;\frac{a\_m}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot k}\\
\end{array}
\end{array}
if m < -1.00000000000000004e-25Initial program 93.4%
associate-/l*93.4%
remove-double-neg93.4%
distribute-frac-neg293.4%
distribute-neg-frac293.4%
remove-double-neg93.4%
sqr-neg93.4%
associate-+l+93.4%
sqr-neg93.4%
distribute-rgt-out93.4%
Simplified93.4%
Taylor expanded in m around 0 37.0%
Taylor expanded in k around inf 57.5%
unpow257.5%
Applied egg-rr57.5%
if -1.00000000000000004e-25 < m Initial program 57.9%
associate-/l*57.9%
remove-double-neg57.9%
distribute-frac-neg257.9%
distribute-neg-frac257.9%
remove-double-neg57.9%
sqr-neg57.9%
associate-+l+57.9%
sqr-neg57.9%
distribute-rgt-out57.9%
Simplified57.9%
Taylor expanded in m around 0 34.0%
Taylor expanded in k around inf 32.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 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 66.4%
associate-/l*66.4%
remove-double-neg66.4%
distribute-frac-neg266.4%
distribute-neg-frac266.4%
remove-double-neg66.4%
sqr-neg66.4%
associate-+l+66.4%
sqr-neg66.4%
distribute-rgt-out66.4%
Simplified66.4%
Taylor expanded in m around 0 34.7%
Taylor expanded in k around 0 16.6%
herbie shell --seed 2024169
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))