
(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
(let* ((t_0 (* a_m (pow k m))))
(*
a_s
(if (<= (/ t_0 (+ (+ (* k 10.0) 1.0) (* k k))) 1e+212)
(/ t_0 (fma k (+ k 10.0) 1.0))
(* a_m (pow (pow k (* m 0.5)) 2.0))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = a_m * pow(k, m);
double tmp;
if ((t_0 / (((k * 10.0) + 1.0) + (k * k))) <= 1e+212) {
tmp = t_0 / fma(k, (k + 10.0), 1.0);
} else {
tmp = a_m * pow(pow(k, (m * 0.5)), 2.0);
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64(a_m * (k ^ m)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(Float64(k * 10.0) + 1.0) + Float64(k * k))) <= 1e+212) tmp = Float64(t_0 / fma(k, Float64(k + 10.0), 1.0)); else tmp = Float64(a_m * ((k ^ Float64(m * 0.5)) ^ 2.0)); end return Float64(a_s * tmp) end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(t$95$0 / N[(N[(N[(k * 10.0), $MachinePrecision] + 1.0), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+212], N[(t$95$0 / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[Power[N[Power[k, N[(m * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := a\_m \cdot {k}^{m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_0}{\left(k \cdot 10 + 1\right) + k \cdot k} \leq 10^{+212}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot {\left({k}^{\left(m \cdot 0.5\right)}\right)}^{2}\\
\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))) < 9.9999999999999991e211Initial program 98.1%
sqr-neg98.1%
associate-+l+98.1%
+-commutative98.1%
sqr-neg98.1%
distribute-rgt-out98.1%
fma-define98.1%
+-commutative98.1%
Simplified98.1%
if 9.9999999999999991e211 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 71.4%
associate-/l*71.4%
remove-double-neg71.4%
distribute-frac-neg271.4%
distribute-neg-frac271.4%
remove-double-neg71.4%
sqr-neg71.4%
associate-+l+71.4%
sqr-neg71.4%
distribute-rgt-out71.4%
Simplified71.4%
add-sqr-sqrt71.4%
pow271.4%
+-commutative71.4%
+-commutative71.4%
fma-undefine71.4%
Applied egg-rr71.4%
Taylor expanded in k around 0 100.0%
pow1/2100.0%
pow-pow100.0%
Applied egg-rr100.0%
Final simplification98.4%
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 10.0) 1.0) (* k k))))) (* a_s (if (<= t_0 1e+212) t_0 (* a_m (pow (pow k (* m 0.5)) 2.0))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = (a_m * pow(k, m)) / (((k * 10.0) + 1.0) + (k * k));
double tmp;
if (t_0 <= 1e+212) {
tmp = t_0;
} else {
tmp = a_m * pow(pow(k, (m * 0.5)), 2.0);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (a_m * (k ** m)) / (((k * 10.0d0) + 1.0d0) + (k * k))
if (t_0 <= 1d+212) then
tmp = t_0
else
tmp = a_m * ((k ** (m * 0.5d0)) ** 2.0d0)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = (a_m * Math.pow(k, m)) / (((k * 10.0) + 1.0) + (k * k));
double tmp;
if (t_0 <= 1e+212) {
tmp = t_0;
} else {
tmp = a_m * Math.pow(Math.pow(k, (m * 0.5)), 2.0);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): t_0 = (a_m * math.pow(k, m)) / (((k * 10.0) + 1.0) + (k * k)) tmp = 0 if t_0 <= 1e+212: tmp = t_0 else: tmp = a_m * math.pow(math.pow(k, (m * 0.5)), 2.0) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64(Float64(a_m * (k ^ m)) / Float64(Float64(Float64(k * 10.0) + 1.0) + Float64(k * k))) tmp = 0.0 if (t_0 <= 1e+212) tmp = t_0; else tmp = Float64(a_m * ((k ^ Float64(m * 0.5)) ^ 2.0)); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) t_0 = (a_m * (k ^ m)) / (((k * 10.0) + 1.0) + (k * k)); tmp = 0.0; if (t_0 <= 1e+212) tmp = t_0; else tmp = a_m * ((k ^ (m * 0.5)) ^ 2.0); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k * 10.0), $MachinePrecision] + 1.0), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$0, 1e+212], t$95$0, N[(a$95$m * N[Power[N[Power[k, N[(m * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \frac{a\_m \cdot {k}^{m}}{\left(k \cdot 10 + 1\right) + k \cdot k}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{+212}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot {\left({k}^{\left(m \cdot 0.5\right)}\right)}^{2}\\
\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))) < 9.9999999999999991e211Initial program 98.1%
if 9.9999999999999991e211 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 71.4%
associate-/l*71.4%
remove-double-neg71.4%
distribute-frac-neg271.4%
distribute-neg-frac271.4%
remove-double-neg71.4%
sqr-neg71.4%
associate-+l+71.4%
sqr-neg71.4%
distribute-rgt-out71.4%
Simplified71.4%
add-sqr-sqrt71.4%
pow271.4%
+-commutative71.4%
+-commutative71.4%
fma-undefine71.4%
Applied egg-rr71.4%
Taylor expanded in k around 0 100.0%
pow1/2100.0%
pow-pow100.0%
Applied egg-rr100.0%
Final simplification98.4%
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 10.0) 1.0) (* k k))))) (* a_s (if (<= t_0 INFINITY) t_0 (* a_m (+ (* k (* k 99.0)) 1.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 * 10.0) + 1.0) + (k * k));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.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 * 10.0) + 1.0) + (k * k));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.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 * 10.0) + 1.0) + (k * k)) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = a_m * ((k * (k * 99.0)) + 1.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(Float64(k * 10.0) + 1.0) + Float64(k * k))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(a_m * Float64(Float64(k * Float64(k * 99.0)) + 1.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 * 10.0) + 1.0) + (k * k)); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = a_m * ((k * (k * 99.0)) + 1.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[(N[(k * 10.0), $MachinePrecision] + 1.0), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$0, Infinity], t$95$0, N[(a$95$m * N[(N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \frac{a\_m \cdot {k}^{m}}{\left(k \cdot 10 + 1\right) + k \cdot k}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot \left(k \cdot 99\right) + 1\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 98.3%
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 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.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 4e-5)
(* a_m (/ (pow k m) (+ (* k (+ k 10.0)) 1.0)))
(* a_m (pow k m)))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 4e-5) {
tmp = a_m * (pow(k, m) / ((k * (k + 10.0)) + 1.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 <= 4d-5) then
tmp = a_m * ((k ** m) / ((k * (k + 10.0d0)) + 1.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 <= 4e-5) {
tmp = a_m * (Math.pow(k, m) / ((k * (k + 10.0)) + 1.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 <= 4e-5: tmp = a_m * (math.pow(k, m) / ((k * (k + 10.0)) + 1.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 <= 4e-5) tmp = Float64(a_m * Float64((k ^ m) / Float64(Float64(k * Float64(k + 10.0)) + 1.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 <= 4e-5) tmp = a_m * ((k ^ m) / ((k * (k + 10.0)) + 1.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, 4e-5], N[(a$95$m * N[(N[Power[k, m], $MachinePrecision] / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 4 \cdot 10^{-5}:\\
\;\;\;\;a\_m \cdot \frac{{k}^{m}}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 4.00000000000000033e-5Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.5%
Simplified97.5%
if 4.00000000000000033e-5 < m Initial program 84.6%
associate-/l*84.6%
remove-double-neg84.6%
distribute-frac-neg284.6%
distribute-neg-frac284.6%
remove-double-neg84.6%
sqr-neg84.6%
associate-+l+84.6%
sqr-neg84.6%
distribute-rgt-out84.6%
Simplified84.6%
Taylor expanded in k around 0 100.0%
Final simplification98.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 -9.5e-12) (not (<= m 5.8e-11)))
(* a_m (pow k m))
(/ a_m (+ (* k (+ k 10.0)) 1.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 <= -9.5e-12) || !(m <= 5.8e-11)) {
tmp = a_m * pow(k, m);
} else {
tmp = a_m / ((k * (k + 10.0)) + 1.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 <= (-9.5d-12)) .or. (.not. (m <= 5.8d-11))) then
tmp = a_m * (k ** m)
else
tmp = a_m / ((k * (k + 10.0d0)) + 1.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 <= -9.5e-12) || !(m <= 5.8e-11)) {
tmp = a_m * Math.pow(k, m);
} else {
tmp = a_m / ((k * (k + 10.0)) + 1.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 <= -9.5e-12) or not (m <= 5.8e-11): tmp = a_m * math.pow(k, m) else: tmp = a_m / ((k * (k + 10.0)) + 1.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 <= -9.5e-12) || !(m <= 5.8e-11)) tmp = Float64(a_m * (k ^ m)); else tmp = Float64(a_m / Float64(Float64(k * Float64(k + 10.0)) + 1.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 <= -9.5e-12) || ~((m <= 5.8e-11))) tmp = a_m * (k ^ m); else tmp = a_m / ((k * (k + 10.0)) + 1.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, -9.5e-12], N[Not[LessEqual[m, 5.8e-11]], $MachinePrecision]], N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $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 -9.5 \cdot 10^{-12} \lor \neg \left(m \leq 5.8 \cdot 10^{-11}\right):\\
\;\;\;\;a\_m \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{k \cdot \left(k + 10\right) + 1}\\
\end{array}
\end{array}
if m < -9.4999999999999995e-12 or 5.8e-11 < m Initial 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 k around 0 100.0%
if -9.4999999999999995e-12 < m < 5.8e-11Initial program 95.4%
associate-/l*95.4%
remove-double-neg95.4%
distribute-frac-neg295.4%
distribute-neg-frac295.4%
remove-double-neg95.4%
sqr-neg95.4%
associate-+l+95.4%
sqr-neg95.4%
distribute-rgt-out95.4%
Simplified95.4%
Taylor expanded in m around 0 95.1%
Final simplification98.3%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -1.02e+123)
(/ (- (/ (- (* 0.001 (/ a_m k)) (* a_m 0.01)) k) (* a_m -0.1)) k)
(if (<= m 4e-5)
(/ a_m (+ (* k (+ k 10.0)) 1.0))
(* a_m (+ (* k (* k 99.0)) 1.0))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -1.02e+123) {
tmp = ((((0.001 * (a_m / k)) - (a_m * 0.01)) / k) - (a_m * -0.1)) / k;
} else if (m <= 4e-5) {
tmp = a_m / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.0);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-1.02d+123)) then
tmp = ((((0.001d0 * (a_m / k)) - (a_m * 0.01d0)) / k) - (a_m * (-0.1d0))) / k
else if (m <= 4d-5) then
tmp = a_m / ((k * (k + 10.0d0)) + 1.0d0)
else
tmp = a_m * ((k * (k * 99.0d0)) + 1.0d0)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -1.02e+123) {
tmp = ((((0.001 * (a_m / k)) - (a_m * 0.01)) / k) - (a_m * -0.1)) / k;
} else if (m <= 4e-5) {
tmp = a_m / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.0);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -1.02e+123: tmp = ((((0.001 * (a_m / k)) - (a_m * 0.01)) / k) - (a_m * -0.1)) / k elif m <= 4e-5: tmp = a_m / ((k * (k + 10.0)) + 1.0) else: tmp = a_m * ((k * (k * 99.0)) + 1.0) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -1.02e+123) tmp = Float64(Float64(Float64(Float64(Float64(0.001 * Float64(a_m / k)) - Float64(a_m * 0.01)) / k) - Float64(a_m * -0.1)) / k); elseif (m <= 4e-5) tmp = Float64(a_m / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); else tmp = Float64(a_m * Float64(Float64(k * Float64(k * 99.0)) + 1.0)); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= -1.02e+123) tmp = ((((0.001 * (a_m / k)) - (a_m * 0.01)) / k) - (a_m * -0.1)) / k; elseif (m <= 4e-5) tmp = a_m / ((k * (k + 10.0)) + 1.0); else tmp = a_m * ((k * (k * 99.0)) + 1.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, -1.02e+123], N[(N[(N[(N[(N[(0.001 * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision] - N[(a$95$m * 0.01), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] - N[(a$95$m * -0.1), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 4e-5], N[(a$95$m / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision] + 1.0), $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.02 \cdot 10^{+123}:\\
\;\;\;\;\frac{\frac{0.001 \cdot \frac{a\_m}{k} - a\_m \cdot 0.01}{k} - a\_m \cdot -0.1}{k}\\
\mathbf{elif}\;m \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{a\_m}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot \left(k \cdot 99\right) + 1\right)\\
\end{array}
\end{array}
if m < -1.02e123Initial 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 32.1%
Taylor expanded in k around 0 22.4%
*-commutative22.4%
Simplified22.4%
Taylor expanded in k around -inf 43.2%
if -1.02e123 < m < 4.00000000000000033e-5Initial program 96.8%
associate-/l*96.8%
remove-double-neg96.8%
distribute-frac-neg296.8%
distribute-neg-frac296.8%
remove-double-neg96.8%
sqr-neg96.8%
associate-+l+96.8%
sqr-neg96.8%
distribute-rgt-out96.7%
Simplified96.7%
Taylor expanded in m around 0 74.5%
if 4.00000000000000033e-5 < m Initial program 84.6%
associate-/l*84.6%
remove-double-neg84.6%
distribute-frac-neg284.6%
distribute-neg-frac284.6%
remove-double-neg84.6%
sqr-neg84.6%
associate-+l+84.6%
sqr-neg84.6%
distribute-rgt-out84.6%
Simplified84.6%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 28.1%
Taylor expanded in k around inf 28.1%
*-commutative28.1%
Simplified28.1%
Final simplification53.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 -2.45e+45)
(* k (/ a_m k))
(if (<= m 1.6) (/ a_m (+ (* k 10.0) 1.0)) (* a_m (* 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 <= -2.45e+45) {
tmp = k * (a_m / k);
} else if (m <= 1.6) {
tmp = a_m / ((k * 10.0) + 1.0);
} else {
tmp = a_m * (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 <= (-2.45d+45)) then
tmp = k * (a_m / k)
else if (m <= 1.6d0) then
tmp = a_m / ((k * 10.0d0) + 1.0d0)
else
tmp = a_m * (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 <= -2.45e+45) {
tmp = k * (a_m / k);
} else if (m <= 1.6) {
tmp = a_m / ((k * 10.0) + 1.0);
} else {
tmp = a_m * (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 <= -2.45e+45: tmp = k * (a_m / k) elif m <= 1.6: tmp = a_m / ((k * 10.0) + 1.0) else: tmp = a_m * (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 <= -2.45e+45) tmp = Float64(k * Float64(a_m / k)); elseif (m <= 1.6) tmp = Float64(a_m / Float64(Float64(k * 10.0) + 1.0)); else tmp = Float64(a_m * 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 <= -2.45e+45) tmp = k * (a_m / k); elseif (m <= 1.6) tmp = a_m / ((k * 10.0) + 1.0); else tmp = a_m * (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, -2.45e+45], N[(k * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.6], N[(a$95$m / N[(N[(k * 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(k * -10.0), $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.45 \cdot 10^{+45}:\\
\;\;\;\;k \cdot \frac{a\_m}{k}\\
\mathbf{elif}\;m \leq 1.6:\\
\;\;\;\;\frac{a\_m}{k \cdot 10 + 1}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -2.4500000000000001e45Initial 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 26.3%
Taylor expanded in k around 0 3.2%
Taylor expanded in k around inf 15.5%
Taylor expanded in k around 0 25.5%
if -2.4500000000000001e45 < m < 1.6000000000000001Initial program 95.9%
associate-/l*95.9%
remove-double-neg95.9%
distribute-frac-neg295.9%
distribute-neg-frac295.9%
remove-double-neg95.9%
sqr-neg95.9%
associate-+l+95.9%
sqr-neg95.9%
distribute-rgt-out95.9%
Simplified95.9%
Taylor expanded in m around 0 89.6%
Taylor expanded in k around 0 55.4%
*-commutative55.4%
Simplified55.4%
if 1.6000000000000001 < m Initial program 84.3%
associate-/l*84.3%
remove-double-neg84.3%
distribute-frac-neg284.3%
distribute-neg-frac284.3%
remove-double-neg84.3%
sqr-neg84.3%
associate-+l+84.3%
sqr-neg84.3%
distribute-rgt-out84.3%
Simplified84.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.4%
Taylor expanded in k around inf 23.7%
*-commutative23.7%
associate-*r*24.8%
Simplified24.8%
Final simplification36.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 -8e-30) (* k (/ a_m k)) (if (<= m 0.15) a_m (* a_m (* 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 <= -8e-30) {
tmp = k * (a_m / k);
} else if (m <= 0.15) {
tmp = a_m;
} else {
tmp = a_m * (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 <= (-8d-30)) then
tmp = k * (a_m / k)
else if (m <= 0.15d0) then
tmp = a_m
else
tmp = a_m * (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 <= -8e-30) {
tmp = k * (a_m / k);
} else if (m <= 0.15) {
tmp = a_m;
} else {
tmp = a_m * (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 <= -8e-30: tmp = k * (a_m / k) elif m <= 0.15: tmp = a_m else: tmp = a_m * (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 <= -8e-30) tmp = Float64(k * Float64(a_m / k)); elseif (m <= 0.15) tmp = a_m; else tmp = Float64(a_m * 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 <= -8e-30) tmp = k * (a_m / k); elseif (m <= 0.15) tmp = a_m; else tmp = a_m * (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, -8e-30], N[(k * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.15], a$95$m, N[(a$95$m * N[(k * -10.0), $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 \cdot 10^{-30}:\\
\;\;\;\;k \cdot \frac{a\_m}{k}\\
\mathbf{elif}\;m \leq 0.15:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -8.000000000000001e-30Initial 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 34.8%
Taylor expanded in k around 0 6.4%
Taylor expanded in k around inf 15.5%
Taylor expanded in k around 0 25.9%
if -8.000000000000001e-30 < m < 0.149999999999999994Initial 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.0%
Simplified95.0%
Taylor expanded in m around 0 93.1%
Taylor expanded in k around 0 50.9%
if 0.149999999999999994 < m Initial program 84.3%
associate-/l*84.3%
remove-double-neg84.3%
distribute-frac-neg284.3%
distribute-neg-frac284.3%
remove-double-neg84.3%
sqr-neg84.3%
associate-+l+84.3%
sqr-neg84.3%
distribute-rgt-out84.3%
Simplified84.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.4%
Taylor expanded in k around inf 23.7%
*-commutative23.7%
associate-*r*24.8%
Simplified24.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 -0.0009)
(* (/ a_m k) 0.1)
(if (<= m 46000.0) a_m (* a_m (* 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 <= -0.0009) {
tmp = (a_m / k) * 0.1;
} else if (m <= 46000.0) {
tmp = a_m;
} else {
tmp = a_m * (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 <= (-0.0009d0)) then
tmp = (a_m / k) * 0.1d0
else if (m <= 46000.0d0) then
tmp = a_m
else
tmp = a_m * (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 <= -0.0009) {
tmp = (a_m / k) * 0.1;
} else if (m <= 46000.0) {
tmp = a_m;
} else {
tmp = a_m * (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 <= -0.0009: tmp = (a_m / k) * 0.1 elif m <= 46000.0: tmp = a_m else: tmp = a_m * (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 <= -0.0009) tmp = Float64(Float64(a_m / k) * 0.1); elseif (m <= 46000.0) tmp = a_m; else tmp = Float64(a_m * 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 <= -0.0009) tmp = (a_m / k) * 0.1; elseif (m <= 46000.0) tmp = a_m; else tmp = a_m * (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, -0.0009], N[(N[(a$95$m / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 46000.0], a$95$m, N[(a$95$m * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -0.0009:\\
\;\;\;\;\frac{a\_m}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 46000:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -8.9999999999999998e-4Initial 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 28.5%
Taylor expanded in k around 0 13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in k around inf 19.6%
if -8.9999999999999998e-4 < m < 46000Initial program 95.6%
associate-/l*95.6%
remove-double-neg95.6%
distribute-frac-neg295.6%
distribute-neg-frac295.6%
remove-double-neg95.6%
sqr-neg95.6%
associate-+l+95.6%
sqr-neg95.6%
distribute-rgt-out95.5%
Simplified95.5%
Taylor expanded in m around 0 92.6%
Taylor expanded in k around 0 49.3%
if 46000 < m Initial program 84.3%
associate-/l*84.3%
remove-double-neg84.3%
distribute-frac-neg284.3%
distribute-neg-frac284.3%
remove-double-neg84.3%
sqr-neg84.3%
associate-+l+84.3%
sqr-neg84.3%
distribute-rgt-out84.3%
Simplified84.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.4%
Taylor expanded in k around inf 23.7%
*-commutative23.7%
associate-*r*24.8%
Simplified24.8%
Final simplification31.9%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -0.0025)
(* (/ a_m k) 0.1)
(if (<= m 0.42) 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 <= -0.0025) {
tmp = (a_m / k) * 0.1;
} else if (m <= 0.42) {
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 <= (-0.0025d0)) then
tmp = (a_m / k) * 0.1d0
else if (m <= 0.42d0) 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 <= -0.0025) {
tmp = (a_m / k) * 0.1;
} else if (m <= 0.42) {
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 <= -0.0025: tmp = (a_m / k) * 0.1 elif m <= 0.42: 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 <= -0.0025) tmp = Float64(Float64(a_m / k) * 0.1); elseif (m <= 0.42) 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 <= -0.0025) tmp = (a_m / k) * 0.1; elseif (m <= 0.42) 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, -0.0025], N[(N[(a$95$m / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 0.42], 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 -0.0025:\\
\;\;\;\;\frac{a\_m}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 0.42:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < -0.00250000000000000005Initial 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 28.5%
Taylor expanded in k around 0 13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in k around inf 19.6%
if -0.00250000000000000005 < m < 0.419999999999999984Initial program 95.6%
associate-/l*95.6%
remove-double-neg95.6%
distribute-frac-neg295.6%
distribute-neg-frac295.6%
remove-double-neg95.6%
sqr-neg95.6%
associate-+l+95.6%
sqr-neg95.6%
distribute-rgt-out95.5%
Simplified95.5%
Taylor expanded in m around 0 92.6%
Taylor expanded in k around 0 49.3%
if 0.419999999999999984 < m Initial program 84.3%
associate-/l*84.3%
remove-double-neg84.3%
distribute-frac-neg284.3%
distribute-neg-frac284.3%
remove-double-neg84.3%
sqr-neg84.3%
associate-+l+84.3%
sqr-neg84.3%
distribute-rgt-out84.3%
Simplified84.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.4%
Taylor expanded in k around inf 23.7%
Final simplification31.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 4e-5)
(/ a_m (+ (* k (+ k 10.0)) 1.0))
(* a_m (+ (* k (* k 99.0)) 1.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 <= 4e-5) {
tmp = a_m / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.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 <= 4d-5) then
tmp = a_m / ((k * (k + 10.0d0)) + 1.0d0)
else
tmp = a_m * ((k * (k * 99.0d0)) + 1.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 <= 4e-5) {
tmp = a_m / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.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 <= 4e-5: tmp = a_m / ((k * (k + 10.0)) + 1.0) else: tmp = a_m * ((k * (k * 99.0)) + 1.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 <= 4e-5) tmp = Float64(a_m / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); else tmp = Float64(a_m * Float64(Float64(k * Float64(k * 99.0)) + 1.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 <= 4e-5) tmp = a_m / ((k * (k + 10.0)) + 1.0); else tmp = a_m * ((k * (k * 99.0)) + 1.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, 4e-5], N[(a$95$m / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision] + 1.0), $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 \cdot 10^{-5}:\\
\;\;\;\;\frac{a\_m}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot \left(k \cdot 99\right) + 1\right)\\
\end{array}
\end{array}
if m < 4.00000000000000033e-5Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 63.9%
if 4.00000000000000033e-5 < m Initial program 84.6%
associate-/l*84.6%
remove-double-neg84.6%
distribute-frac-neg284.6%
distribute-neg-frac284.6%
remove-double-neg84.6%
sqr-neg84.6%
associate-+l+84.6%
sqr-neg84.6%
distribute-rgt-out84.6%
Simplified84.6%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 28.1%
Taylor expanded in k around inf 28.1%
*-commutative28.1%
Simplified28.1%
Final simplification51.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 4e-5) (/ a_m (+ (* k k) 1.0)) (* a_m (+ (* k (* k 99.0)) 1.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 <= 4e-5) {
tmp = a_m / ((k * k) + 1.0);
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.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 <= 4d-5) then
tmp = a_m / ((k * k) + 1.0d0)
else
tmp = a_m * ((k * (k * 99.0d0)) + 1.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 <= 4e-5) {
tmp = a_m / ((k * k) + 1.0);
} else {
tmp = a_m * ((k * (k * 99.0)) + 1.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 <= 4e-5: tmp = a_m / ((k * k) + 1.0) else: tmp = a_m * ((k * (k * 99.0)) + 1.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 <= 4e-5) tmp = Float64(a_m / Float64(Float64(k * k) + 1.0)); else tmp = Float64(a_m * Float64(Float64(k * Float64(k * 99.0)) + 1.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 <= 4e-5) tmp = a_m / ((k * k) + 1.0); else tmp = a_m * ((k * (k * 99.0)) + 1.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, 4e-5], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision] + 1.0), $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 \cdot 10^{-5}:\\
\;\;\;\;\frac{a\_m}{k \cdot k + 1}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot \left(k \cdot 99\right) + 1\right)\\
\end{array}
\end{array}
if m < 4.00000000000000033e-5Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 63.9%
Taylor expanded in k around inf 63.0%
if 4.00000000000000033e-5 < m Initial program 84.6%
associate-/l*84.6%
remove-double-neg84.6%
distribute-frac-neg284.6%
distribute-neg-frac284.6%
remove-double-neg84.6%
sqr-neg84.6%
associate-+l+84.6%
sqr-neg84.6%
distribute-rgt-out84.6%
Simplified84.6%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 28.1%
Taylor expanded in k around inf 28.1%
*-commutative28.1%
Simplified28.1%
Final simplification50.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 0.75) (/ a_m (+ (* k k) 1.0)) (* a_m (* 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 <= 0.75) {
tmp = a_m / ((k * k) + 1.0);
} else {
tmp = a_m * (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 <= 0.75d0) then
tmp = a_m / ((k * k) + 1.0d0)
else
tmp = a_m * (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 <= 0.75) {
tmp = a_m / ((k * k) + 1.0);
} else {
tmp = a_m * (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 <= 0.75: tmp = a_m / ((k * k) + 1.0) else: tmp = a_m * (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 <= 0.75) tmp = Float64(a_m / Float64(Float64(k * k) + 1.0)); else tmp = Float64(a_m * 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 <= 0.75) tmp = a_m / ((k * k) + 1.0); else tmp = a_m * (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, 0.75], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 0.75:\\
\;\;\;\;\frac{a\_m}{k \cdot k + 1}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.75Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.6%
Simplified97.6%
Taylor expanded in m around 0 63.4%
Taylor expanded in k around inf 62.5%
if 0.75 < m Initial program 84.3%
associate-/l*84.3%
remove-double-neg84.3%
distribute-frac-neg284.3%
distribute-neg-frac284.3%
remove-double-neg84.3%
sqr-neg84.3%
associate-+l+84.3%
sqr-neg84.3%
distribute-rgt-out84.3%
Simplified84.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.4%
Taylor expanded in k around inf 23.7%
*-commutative23.7%
associate-*r*24.8%
Simplified24.8%
Final simplification49.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 0.45) 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 <= 0.45) {
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 <= 0.45d0) 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 <= 0.45) {
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 <= 0.45: 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 <= 0.45) 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 <= 0.45) 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, 0.45], 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 0.45:\\
\;\;\;\;a\_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a\_m \cdot k\right)\\
\end{array}
\end{array}
if m < 0.450000000000000011Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.6%
Simplified97.6%
Taylor expanded in m around 0 63.4%
Taylor expanded in k around 0 28.6%
if 0.450000000000000011 < m Initial program 84.3%
associate-/l*84.3%
remove-double-neg84.3%
distribute-frac-neg284.3%
distribute-neg-frac284.3%
remove-double-neg84.3%
sqr-neg84.3%
associate-+l+84.3%
sqr-neg84.3%
distribute-rgt-out84.3%
Simplified84.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.4%
Taylor expanded in k around inf 23.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 a_m))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a_s * a_m
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * a_m
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * a_m) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * a_m; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * a$95$m), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot a\_m
\end{array}
Initial program 93.0%
associate-/l*93.0%
remove-double-neg93.0%
distribute-frac-neg293.0%
distribute-neg-frac293.0%
remove-double-neg93.0%
sqr-neg93.0%
associate-+l+93.0%
sqr-neg93.0%
distribute-rgt-out92.9%
Simplified92.9%
Taylor expanded in m around 0 42.3%
Taylor expanded in k around 0 19.8%
herbie shell --seed 2024166
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))