
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (hypot k (sqrt (fma k 10.0 1.0)))))
(*
a_s
(if (<= m -3.6e-9)
(* (pow k m) (* (sqrt a_m) (sqrt a_m)))
(if (<= m 3.4) (* (/ (pow k m) t_0) (/ a_m t_0)) (* (pow k m) 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 = hypot(k, sqrt(fma(k, 10.0, 1.0)));
double tmp;
if (m <= -3.6e-9) {
tmp = pow(k, m) * (sqrt(a_m) * sqrt(a_m));
} else if (m <= 3.4) {
tmp = (pow(k, m) / t_0) * (a_m / t_0);
} else {
tmp = pow(k, m) * 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 = hypot(k, sqrt(fma(k, 10.0, 1.0))) tmp = 0.0 if (m <= -3.6e-9) tmp = Float64((k ^ m) * Float64(sqrt(a_m) * sqrt(a_m))); elseif (m <= 3.4) tmp = Float64(Float64((k ^ m) / t_0) * Float64(a_m / t_0)); else tmp = Float64((k ^ m) * 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[Sqrt[k ^ 2 + N[Sqrt[N[(k * 10.0 + 1.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, -3.6e-9], N[(N[Power[k, m], $MachinePrecision] * N[(N[Sqrt[a$95$m], $MachinePrecision] * N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 3.4], N[(N[(N[Power[k, m], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(a$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(k, \sqrt{\mathsf{fma}\left(k, 10, 1\right)}\right)\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;{k}^{m} \cdot \left(\sqrt{a_m} \cdot \sqrt{a_m}\right)\\
\mathbf{elif}\;m \leq 3.4:\\
\;\;\;\;\frac{{k}^{m}}{t_0} \cdot \frac{a_m}{t_0}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a_m\\
\end{array}
\end{array}
\end{array}
if m < -3.6e-9Initial program 100.0%
sqr-neg100.0%
cancel-sign-sub100.0%
distribute-lft-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
associate--l+100.0%
associate--l+100.0%
+-commutative100.0%
associate--l+100.0%
metadata-eval100.0%
+-commutative100.0%
*-commutative100.0%
sqr-neg100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr100.0%
rem-cube-cbrt100.0%
add-sqr-sqrt47.7%
associate-*l*47.7%
Applied egg-rr47.7%
*-commutative47.7%
*-commutative47.7%
associate-*l*47.7%
Simplified47.7%
Taylor expanded in k around 0 47.7%
if -3.6e-9 < m < 3.39999999999999991Initial program 93.8%
sqr-neg93.8%
cancel-sign-sub93.8%
distribute-lft-neg-in93.8%
neg-sub093.8%
associate--r-93.8%
associate--l+93.8%
associate--l+93.8%
+-commutative93.8%
associate--l+93.8%
metadata-eval93.8%
+-commutative93.8%
*-commutative93.8%
sqr-neg93.8%
Simplified93.8%
add-cube-cbrt92.5%
pow392.5%
Applied egg-rr92.5%
rem-cube-cbrt93.8%
*-commutative93.8%
add-sqr-sqrt93.8%
times-frac93.7%
+-commutative93.7%
add-sqr-sqrt93.7%
hypot-def93.7%
+-commutative93.7%
fma-udef93.7%
+-commutative93.7%
add-sqr-sqrt93.7%
hypot-def99.8%
+-commutative99.8%
fma-udef99.8%
Applied egg-rr99.8%
if 3.39999999999999991 < m Initial program 70.0%
associate-*l/64.4%
associate-+l+64.4%
distribute-rgt-out64.4%
Simplified64.4%
Taylor expanded in k around 0 100.0%
Final simplification86.6%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (hypot k (sqrt (fma k 10.0 1.0)))))
(*
a_s
(if (<= m -3.4e-9)
(* (pow k m) (* (sqrt a_m) (sqrt a_m)))
(if (<= m 2.3e-14) (/ (/ a_m t_0) t_0) (* (pow k m) 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 = hypot(k, sqrt(fma(k, 10.0, 1.0)));
double tmp;
if (m <= -3.4e-9) {
tmp = pow(k, m) * (sqrt(a_m) * sqrt(a_m));
} else if (m <= 2.3e-14) {
tmp = (a_m / t_0) / t_0;
} else {
tmp = pow(k, m) * 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 = hypot(k, sqrt(fma(k, 10.0, 1.0))) tmp = 0.0 if (m <= -3.4e-9) tmp = Float64((k ^ m) * Float64(sqrt(a_m) * sqrt(a_m))); elseif (m <= 2.3e-14) tmp = Float64(Float64(a_m / t_0) / t_0); else tmp = Float64((k ^ m) * 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[Sqrt[k ^ 2 + N[Sqrt[N[(k * 10.0 + 1.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, -3.4e-9], N[(N[Power[k, m], $MachinePrecision] * N[(N[Sqrt[a$95$m], $MachinePrecision] * N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.3e-14], N[(N[(a$95$m / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(k, \sqrt{\mathsf{fma}\left(k, 10, 1\right)}\right)\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -3.4 \cdot 10^{-9}:\\
\;\;\;\;{k}^{m} \cdot \left(\sqrt{a_m} \cdot \sqrt{a_m}\right)\\
\mathbf{elif}\;m \leq 2.3 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{a_m}{t_0}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a_m\\
\end{array}
\end{array}
\end{array}
if m < -3.3999999999999998e-9Initial program 100.0%
sqr-neg100.0%
cancel-sign-sub100.0%
distribute-lft-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
associate--l+100.0%
associate--l+100.0%
+-commutative100.0%
associate--l+100.0%
metadata-eval100.0%
+-commutative100.0%
*-commutative100.0%
sqr-neg100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr100.0%
rem-cube-cbrt100.0%
add-sqr-sqrt47.7%
associate-*l*47.7%
Applied egg-rr47.7%
*-commutative47.7%
*-commutative47.7%
associate-*l*47.7%
Simplified47.7%
Taylor expanded in k around 0 47.7%
if -3.3999999999999998e-9 < m < 2.29999999999999998e-14Initial program 93.5%
sqr-neg93.5%
cancel-sign-sub93.5%
distribute-lft-neg-in93.5%
neg-sub093.5%
associate--r-93.5%
associate--l+93.5%
associate--l+93.5%
+-commutative93.5%
associate--l+93.5%
metadata-eval93.5%
+-commutative93.5%
*-commutative93.5%
sqr-neg93.5%
Simplified93.5%
add-cube-cbrt92.3%
pow392.3%
Applied egg-rr92.3%
Taylor expanded in m around 0 93.5%
pow-base-193.5%
*-lft-identity93.5%
Simplified93.5%
*-un-lft-identity93.5%
add-sqr-sqrt93.5%
times-frac93.5%
+-commutative93.5%
add-exp-log93.5%
log1p-udef93.5%
add-sqr-sqrt93.5%
hypot-def93.5%
log1p-udef93.5%
add-exp-log93.5%
+-commutative93.5%
fma-def93.5%
+-commutative93.5%
Applied egg-rr99.8%
associate-*l/99.8%
*-commutative99.8%
associate-/r/99.8%
/-rgt-identity99.8%
Simplified99.8%
if 2.29999999999999998e-14 < m Initial program 71.3%
associate-*l/66.0%
associate-+l+66.0%
distribute-rgt-out66.0%
Simplified66.0%
Taylor expanded in k around 0 99.0%
Final simplification86.3%
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (let* ((t_0 (* (pow k m) a_m))) (* a_s (if (<= m 2.6) (/ t_0 (+ (* k k) (+ 1.0 (* k 10.0)))) t_0))))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = pow(k, m) * a_m;
double tmp;
if (m <= 2.6) {
tmp = t_0 / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = t_0;
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a_m
if (m <= 2.6d0) then
tmp = t_0 / ((k * k) + (1.0d0 + (k * 10.0d0)))
else
tmp = t_0
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = Math.pow(k, m) * a_m;
double tmp;
if (m <= 2.6) {
tmp = t_0 / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = t_0;
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): t_0 = math.pow(k, m) * a_m tmp = 0 if m <= 2.6: tmp = t_0 / ((k * k) + (1.0 + (k * 10.0))) else: tmp = t_0 return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64((k ^ m) * a_m) tmp = 0.0 if (m <= 2.6) tmp = Float64(t_0 / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))); else tmp = t_0; end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) t_0 = (k ^ m) * a_m; tmp = 0.0; if (m <= 2.6) tmp = t_0 / ((k * k) + (1.0 + (k * 10.0))); else tmp = t_0; end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, 2.6], N[(t$95$0 / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a_m\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 2.6:\\
\;\;\;\;\frac{t_0}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
\end{array}
if m < 2.60000000000000009Initial program 96.2%
if 2.60000000000000009 < m Initial program 70.0%
associate-*l/64.4%
associate-+l+64.4%
distribute-rgt-out64.4%
Simplified64.4%
Taylor expanded in k around 0 100.0%
Final simplification97.5%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m 2.95)
(* (pow k m) (/ a_m (+ 1.0 (* k (+ k 10.0)))))
(* (pow k m) 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 <= 2.95) {
tmp = pow(k, m) * (a_m / (1.0 + (k * (k + 10.0))));
} else {
tmp = pow(k, m) * 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 <= 2.95d0) then
tmp = (k ** m) * (a_m / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = (k ** m) * 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 <= 2.95) {
tmp = Math.pow(k, m) * (a_m / (1.0 + (k * (k + 10.0))));
} else {
tmp = Math.pow(k, m) * 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 <= 2.95: tmp = math.pow(k, m) * (a_m / (1.0 + (k * (k + 10.0)))) else: tmp = math.pow(k, m) * 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 <= 2.95) tmp = Float64((k ^ m) * Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64((k ^ m) * 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 <= 2.95) tmp = (k ^ m) * (a_m / (1.0 + (k * (k + 10.0)))); else tmp = (k ^ m) * a_m; end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 2.95], N[(N[Power[k, m], $MachinePrecision] * N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 2.95:\\
\;\;\;\;{k}^{m} \cdot \frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a_m\\
\end{array}
\end{array}
if m < 2.9500000000000002Initial program 96.2%
associate-*l/96.2%
associate-+l+96.2%
distribute-rgt-out96.2%
Simplified96.2%
if 2.9500000000000002 < m Initial program 70.0%
associate-*l/64.4%
associate-+l+64.4%
distribute-rgt-out64.4%
Simplified64.4%
Taylor expanded in k around 0 100.0%
Final simplification97.5%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (+ 1.0 (* k 10.0))))
(*
a_s
(if (<= m -6.2e-25)
(* (pow k m) (/ a_m t_0))
(if (<= m 2.05e-14) (/ a_m (+ (* k k) t_0)) (* (pow k m) 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 = 1.0 + (k * 10.0);
double tmp;
if (m <= -6.2e-25) {
tmp = pow(k, m) * (a_m / t_0);
} else if (m <= 2.05e-14) {
tmp = a_m / ((k * k) + t_0);
} else {
tmp = pow(k, m) * 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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (k * 10.0d0)
if (m <= (-6.2d-25)) then
tmp = (k ** m) * (a_m / t_0)
else if (m <= 2.05d-14) then
tmp = a_m / ((k * k) + t_0)
else
tmp = (k ** m) * 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 t_0 = 1.0 + (k * 10.0);
double tmp;
if (m <= -6.2e-25) {
tmp = Math.pow(k, m) * (a_m / t_0);
} else if (m <= 2.05e-14) {
tmp = a_m / ((k * k) + t_0);
} else {
tmp = Math.pow(k, m) * 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 = 1.0 + (k * 10.0) tmp = 0 if m <= -6.2e-25: tmp = math.pow(k, m) * (a_m / t_0) elif m <= 2.05e-14: tmp = a_m / ((k * k) + t_0) else: tmp = math.pow(k, m) * 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(1.0 + Float64(k * 10.0)) tmp = 0.0 if (m <= -6.2e-25) tmp = Float64((k ^ m) * Float64(a_m / t_0)); elseif (m <= 2.05e-14) tmp = Float64(a_m / Float64(Float64(k * k) + t_0)); else tmp = Float64((k ^ m) * 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 = 1.0 + (k * 10.0); tmp = 0.0; if (m <= -6.2e-25) tmp = (k ^ m) * (a_m / t_0); elseif (m <= 2.05e-14) tmp = a_m / ((k * k) + t_0); else tmp = (k ^ m) * 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[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, -6.2e-25], N[(N[Power[k, m], $MachinePrecision] * N[(a$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.05e-14], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := 1 + k \cdot 10\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -6.2 \cdot 10^{-25}:\\
\;\;\;\;{k}^{m} \cdot \frac{a_m}{t_0}\\
\mathbf{elif}\;m \leq 2.05 \cdot 10^{-14}:\\
\;\;\;\;\frac{a_m}{k \cdot k + t_0}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a_m\\
\end{array}
\end{array}
\end{array}
if m < -6.19999999999999989e-25Initial program 98.5%
associate-*l/98.5%
associate-+l+98.5%
distribute-rgt-out98.5%
Simplified98.5%
Taylor expanded in k around 0 98.6%
*-commutative98.6%
Simplified98.6%
if -6.19999999999999989e-25 < m < 2.0500000000000001e-14Initial program 94.4%
sqr-neg94.4%
cancel-sign-sub94.4%
distribute-lft-neg-in94.4%
neg-sub094.4%
associate--r-94.4%
associate--l+94.4%
associate--l+94.4%
+-commutative94.4%
associate--l+94.4%
metadata-eval94.4%
+-commutative94.4%
*-commutative94.4%
sqr-neg94.4%
Simplified94.4%
add-cube-cbrt93.1%
pow393.1%
Applied egg-rr93.1%
Taylor expanded in m around 0 94.4%
pow-base-194.4%
*-lft-identity94.4%
Simplified94.4%
if 2.0500000000000001e-14 < m Initial program 71.3%
associate-*l/66.0%
associate-+l+66.0%
distribute-rgt-out66.0%
Simplified66.0%
Taylor expanded in k around 0 99.0%
Final simplification97.2%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (or (<= m -3.6e-9) (not (<= m 9e-15)))
(* (pow k m) a_m)
(/ 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 <= -3.6e-9) || !(m <= 9e-15)) {
tmp = pow(k, m) * a_m;
} 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 <= (-3.6d-9)) .or. (.not. (m <= 9d-15))) then
tmp = (k ** m) * a_m
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 <= -3.6e-9) || !(m <= 9e-15)) {
tmp = Math.pow(k, m) * a_m;
} 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 <= -3.6e-9) or not (m <= 9e-15): tmp = math.pow(k, m) * a_m 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 <= -3.6e-9) || !(m <= 9e-15)) tmp = Float64((k ^ m) * a_m); 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 <= -3.6e-9) || ~((m <= 9e-15))) tmp = (k ^ m) * a_m; 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[Or[LessEqual[m, -3.6e-9], N[Not[LessEqual[m, 9e-15]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $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 -3.6 \cdot 10^{-9} \lor \neg \left(m \leq 9 \cdot 10^{-15}\right):\\
\;\;\;\;{k}^{m} \cdot a_m\\
\mathbf{else}:\\
\;\;\;\;\frac{a_m}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\end{array}
\end{array}
if m < -3.6e-9 or 8.9999999999999995e-15 < m Initial program 83.0%
associate-*l/79.9%
associate-+l+79.9%
distribute-rgt-out79.9%
Simplified79.9%
Taylor expanded in k around 0 99.4%
if -3.6e-9 < m < 8.9999999999999995e-15Initial program 93.5%
sqr-neg93.5%
cancel-sign-sub93.5%
distribute-lft-neg-in93.5%
neg-sub093.5%
associate--r-93.5%
associate--l+93.5%
associate--l+93.5%
+-commutative93.5%
associate--l+93.5%
metadata-eval93.5%
+-commutative93.5%
*-commutative93.5%
sqr-neg93.5%
Simplified93.5%
add-cube-cbrt92.3%
pow392.3%
Applied egg-rr92.3%
Taylor expanded in m around 0 93.5%
pow-base-193.5%
*-lft-identity93.5%
Simplified93.5%
Final simplification97.2%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -600.0)
(/ a_m (+ 1.0 (+ (* k (+ k 10.0)) -1.0)))
(if (<= m 0.9)
(/ a_m (+ (* k k) (+ 1.0 (* k 10.0))))
(* -10.0 (* k a_m))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -600.0) {
tmp = a_m / (1.0 + ((k * (k + 10.0)) + -1.0));
} else if (m <= 0.9) {
tmp = a_m / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-600.0d0)) then
tmp = a_m / (1.0d0 + ((k * (k + 10.0d0)) + (-1.0d0)))
else if (m <= 0.9d0) then
tmp = a_m / ((k * k) + (1.0d0 + (k * 10.0d0)))
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -600.0) {
tmp = a_m / (1.0 + ((k * (k + 10.0)) + -1.0));
} else if (m <= 0.9) {
tmp = a_m / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -600.0: tmp = a_m / (1.0 + ((k * (k + 10.0)) + -1.0)) elif m <= 0.9: tmp = a_m / ((k * k) + (1.0 + (k * 10.0))) else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -600.0) tmp = Float64(a_m / Float64(1.0 + Float64(Float64(k * Float64(k + 10.0)) + -1.0))); elseif (m <= 0.9) tmp = Float64(a_m / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))); else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= -600.0) tmp = a_m / (1.0 + ((k * (k + 10.0)) + -1.0)); elseif (m <= 0.9) tmp = a_m / ((k * k) + (1.0 + (k * 10.0))); else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -600.0], N[(a$95$m / N[(1.0 + N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.9], N[(a$95$m / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a$95$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 -600:\\
\;\;\;\;\frac{a_m}{1 + \left(k \cdot \left(k + 10\right) + -1\right)}\\
\mathbf{elif}\;m \leq 0.9:\\
\;\;\;\;\frac{a_m}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
if m < -600Initial program 100.0%
sqr-neg100.0%
cancel-sign-sub100.0%
distribute-lft-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
associate--l+100.0%
associate--l+100.0%
+-commutative100.0%
associate--l+100.0%
metadata-eval100.0%
+-commutative100.0%
*-commutative100.0%
sqr-neg100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in m around 0 31.1%
pow-base-131.1%
*-lft-identity31.1%
Simplified31.1%
Taylor expanded in k around inf 31.1%
unpow231.1%
distribute-rgt-in31.1%
+-commutative31.1%
Simplified31.1%
expm1-log1p-u31.1%
log1p-def68.0%
expm1-udef68.0%
add-exp-log68.0%
associate--l+68.0%
Applied egg-rr68.0%
if -600 < m < 0.900000000000000022Initial program 93.9%
sqr-neg93.9%
cancel-sign-sub93.9%
distribute-lft-neg-in93.9%
neg-sub093.9%
associate--r-93.9%
associate--l+93.9%
associate--l+93.9%
+-commutative93.9%
associate--l+93.9%
metadata-eval93.9%
+-commutative93.9%
*-commutative93.9%
sqr-neg93.9%
Simplified93.9%
add-cube-cbrt92.6%
pow392.6%
Applied egg-rr92.6%
Taylor expanded in m around 0 92.0%
pow-base-192.0%
*-lft-identity92.0%
Simplified92.0%
if 0.900000000000000022 < m Initial program 70.0%
associate-*l/64.4%
associate-+l+64.4%
distribute-rgt-out64.4%
Simplified64.4%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 12.6%
Taylor expanded in k around inf 25.3%
Final simplification62.6%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k -5e-310)
(* a_m (* k -10.0))
(if (<= k 0.075)
(+ a_m (* -10.0 (* k a_m)))
(* (/ 1.0 k) (/ 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 (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.075) {
tmp = a_m + (-10.0 * (k * a_m));
} else {
tmp = (1.0 / k) * (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 (k <= (-5d-310)) then
tmp = a_m * (k * (-10.0d0))
else if (k <= 0.075d0) then
tmp = a_m + ((-10.0d0) * (k * a_m))
else
tmp = (1.0d0 / k) * (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 (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.075) {
tmp = a_m + (-10.0 * (k * a_m));
} else {
tmp = (1.0 / k) * (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 k <= -5e-310: tmp = a_m * (k * -10.0) elif k <= 0.075: tmp = a_m + (-10.0 * (k * a_m)) else: tmp = (1.0 / k) * (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 (k <= -5e-310) tmp = Float64(a_m * Float64(k * -10.0)); elseif (k <= 0.075) tmp = Float64(a_m + Float64(-10.0 * Float64(k * a_m))); else tmp = Float64(Float64(1.0 / k) * 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 (k <= -5e-310) tmp = a_m * (k * -10.0); elseif (k <= 0.075) tmp = a_m + (-10.0 * (k * a_m)); else tmp = (1.0 / k) * (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[k, -5e-310], N[(a$95$m * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.075], N[(a$95$m + N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a$95$m / 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 -5 \cdot 10^{-310}:\\
\;\;\;\;a_m \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 0.075:\\
\;\;\;\;a_m + -10 \cdot \left(k \cdot a_m\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a_m}{k + 10}\\
\end{array}
\end{array}
if k < -4.999999999999985e-310Initial program 86.8%
associate-*l/82.9%
associate-+l+82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in m around 0 13.6%
Taylor expanded in k around 0 15.0%
Taylor expanded in k around inf 23.1%
associate-*r*23.1%
*-commutative23.1%
associate-*l*23.1%
*-commutative23.1%
Simplified23.1%
if -4.999999999999985e-310 < k < 0.0749999999999999972Initial program 100.0%
associate-*l/100.0%
associate-+l+100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 56.4%
Taylor expanded in k around 0 56.4%
if 0.0749999999999999972 < k Initial program 76.2%
sqr-neg76.2%
cancel-sign-sub76.2%
distribute-lft-neg-in76.2%
neg-sub076.2%
associate--r-76.2%
associate--l+76.2%
associate--l+76.2%
+-commutative76.2%
associate--l+76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
sqr-neg76.2%
Simplified76.2%
add-cube-cbrt76.0%
pow376.0%
Applied egg-rr76.0%
Taylor expanded in m around 0 61.7%
pow-base-161.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in k around inf 61.6%
unpow261.6%
distribute-rgt-in61.6%
+-commutative61.6%
Simplified61.6%
*-un-lft-identity61.6%
times-frac65.9%
Applied egg-rr65.9%
Final simplification50.1%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (* k (+ k 10.0))))
(*
a_s
(if (<= m -600.0)
(/ a_m (+ 1.0 (+ t_0 -1.0)))
(if (<= m 1.25) (/ a_m (+ 1.0 t_0)) (* -10.0 (* k a_m)))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = k * (k + 10.0);
double tmp;
if (m <= -600.0) {
tmp = a_m / (1.0 + (t_0 + -1.0));
} else if (m <= 1.25) {
tmp = a_m / (1.0 + t_0);
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = k * (k + 10.0d0)
if (m <= (-600.0d0)) then
tmp = a_m / (1.0d0 + (t_0 + (-1.0d0)))
else if (m <= 1.25d0) then
tmp = a_m / (1.0d0 + t_0)
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = k * (k + 10.0);
double tmp;
if (m <= -600.0) {
tmp = a_m / (1.0 + (t_0 + -1.0));
} else if (m <= 1.25) {
tmp = a_m / (1.0 + t_0);
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): t_0 = k * (k + 10.0) tmp = 0 if m <= -600.0: tmp = a_m / (1.0 + (t_0 + -1.0)) elif m <= 1.25: tmp = a_m / (1.0 + t_0) else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64(k * Float64(k + 10.0)) tmp = 0.0 if (m <= -600.0) tmp = Float64(a_m / Float64(1.0 + Float64(t_0 + -1.0))); elseif (m <= 1.25) tmp = Float64(a_m / Float64(1.0 + t_0)); else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) t_0 = k * (k + 10.0); tmp = 0.0; if (m <= -600.0) tmp = a_m / (1.0 + (t_0 + -1.0)); elseif (m <= 1.25) tmp = a_m / (1.0 + t_0); else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, -600.0], N[(a$95$m / N[(1.0 + N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.25], N[(a$95$m / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := k \cdot \left(k + 10\right)\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -600:\\
\;\;\;\;\frac{a_m}{1 + \left(t_0 + -1\right)}\\
\mathbf{elif}\;m \leq 1.25:\\
\;\;\;\;\frac{a_m}{1 + t_0}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
\end{array}
if m < -600Initial program 100.0%
sqr-neg100.0%
cancel-sign-sub100.0%
distribute-lft-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
associate--l+100.0%
associate--l+100.0%
+-commutative100.0%
associate--l+100.0%
metadata-eval100.0%
+-commutative100.0%
*-commutative100.0%
sqr-neg100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in m around 0 31.1%
pow-base-131.1%
*-lft-identity31.1%
Simplified31.1%
Taylor expanded in k around inf 31.1%
unpow231.1%
distribute-rgt-in31.1%
+-commutative31.1%
Simplified31.1%
expm1-log1p-u31.1%
log1p-def68.0%
expm1-udef68.0%
add-exp-log68.0%
associate--l+68.0%
Applied egg-rr68.0%
if -600 < m < 1.25Initial program 93.9%
associate-*l/93.9%
associate-+l+93.9%
distribute-rgt-out93.9%
Simplified93.9%
Taylor expanded in m around 0 92.0%
if 1.25 < m Initial program 70.0%
associate-*l/64.4%
associate-+l+64.4%
distribute-rgt-out64.4%
Simplified64.4%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 12.6%
Taylor expanded in k around inf 25.3%
Final simplification62.6%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k -5e-310)
(* a_m (* k -10.0))
(if (<= k 0.075) (+ a_m (* -10.0 (* k 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 (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.075) {
tmp = a_m + (-10.0 * (k * 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 (k <= (-5d-310)) then
tmp = a_m * (k * (-10.0d0))
else if (k <= 0.075d0) then
tmp = a_m + ((-10.0d0) * (k * 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 (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.075) {
tmp = a_m + (-10.0 * (k * 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 k <= -5e-310: tmp = a_m * (k * -10.0) elif k <= 0.075: tmp = a_m + (-10.0 * (k * 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 (k <= -5e-310) tmp = Float64(a_m * Float64(k * -10.0)); elseif (k <= 0.075) tmp = Float64(a_m + Float64(-10.0 * Float64(k * 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 (k <= -5e-310) tmp = a_m * (k * -10.0); elseif (k <= 0.075) tmp = a_m + (-10.0 * (k * 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[k, -5e-310], N[(a$95$m * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.075], N[(a$95$m + N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $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}\;k \leq -5 \cdot 10^{-310}:\\
\;\;\;\;a_m \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 0.075:\\
\;\;\;\;a_m + -10 \cdot \left(k \cdot a_m\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a_m}{k \cdot 10}\\
\end{array}
\end{array}
if k < -4.999999999999985e-310Initial program 86.8%
associate-*l/82.9%
associate-+l+82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in m around 0 13.6%
Taylor expanded in k around 0 15.0%
Taylor expanded in k around inf 23.1%
associate-*r*23.1%
*-commutative23.1%
associate-*l*23.1%
*-commutative23.1%
Simplified23.1%
if -4.999999999999985e-310 < k < 0.0749999999999999972Initial program 100.0%
associate-*l/100.0%
associate-+l+100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 56.4%
Taylor expanded in k around 0 56.4%
if 0.0749999999999999972 < k Initial program 76.2%
sqr-neg76.2%
cancel-sign-sub76.2%
distribute-lft-neg-in76.2%
neg-sub076.2%
associate--r-76.2%
associate--l+76.2%
associate--l+76.2%
+-commutative76.2%
associate--l+76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
sqr-neg76.2%
Simplified76.2%
add-cube-cbrt76.0%
pow376.0%
Applied egg-rr76.0%
Taylor expanded in m around 0 61.7%
pow-base-161.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in k around inf 61.6%
unpow261.6%
distribute-rgt-in61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in k around 0 21.2%
*-commutative21.2%
Simplified21.2%
Final simplification33.0%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k -5e-310)
(* a_m (* k -10.0))
(if (<= k 0.075) (+ a_m (* -10.0 (* k a_m))) (/ a_m (* 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 (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.075) {
tmp = a_m + (-10.0 * (k * a_m));
} else {
tmp = a_m / (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 (k <= (-5d-310)) then
tmp = a_m * (k * (-10.0d0))
else if (k <= 0.075d0) then
tmp = a_m + ((-10.0d0) * (k * a_m))
else
tmp = a_m / (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 (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.075) {
tmp = a_m + (-10.0 * (k * a_m));
} else {
tmp = a_m / (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 k <= -5e-310: tmp = a_m * (k * -10.0) elif k <= 0.075: tmp = a_m + (-10.0 * (k * a_m)) else: tmp = a_m / (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 (k <= -5e-310) tmp = Float64(a_m * Float64(k * -10.0)); elseif (k <= 0.075) tmp = Float64(a_m + Float64(-10.0 * Float64(k * a_m))); else tmp = Float64(a_m / 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 (k <= -5e-310) tmp = a_m * (k * -10.0); elseif (k <= 0.075) tmp = a_m + (-10.0 * (k * a_m)); else tmp = a_m / (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[k, -5e-310], N[(a$95$m * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.075], N[(a$95$m + N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(k * 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 -5 \cdot 10^{-310}:\\
\;\;\;\;a_m \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 0.075:\\
\;\;\;\;a_m + -10 \cdot \left(k \cdot a_m\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a_m}{k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if k < -4.999999999999985e-310Initial program 86.8%
associate-*l/82.9%
associate-+l+82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in m around 0 13.6%
Taylor expanded in k around 0 15.0%
Taylor expanded in k around inf 23.1%
associate-*r*23.1%
*-commutative23.1%
associate-*l*23.1%
*-commutative23.1%
Simplified23.1%
if -4.999999999999985e-310 < k < 0.0749999999999999972Initial program 100.0%
associate-*l/100.0%
associate-+l+100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 56.4%
Taylor expanded in k around 0 56.4%
if 0.0749999999999999972 < k Initial program 76.2%
sqr-neg76.2%
cancel-sign-sub76.2%
distribute-lft-neg-in76.2%
neg-sub076.2%
associate--r-76.2%
associate--l+76.2%
associate--l+76.2%
+-commutative76.2%
associate--l+76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
sqr-neg76.2%
Simplified76.2%
add-cube-cbrt76.0%
pow376.0%
Applied egg-rr76.0%
Taylor expanded in m around 0 61.7%
pow-base-161.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in k around inf 61.6%
unpow261.6%
distribute-rgt-in61.6%
+-commutative61.6%
Simplified61.6%
Final simplification48.5%
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 1.4) (/ a_m (+ 1.0 (* k (+ k 10.0)))) (* -10.0 (* k a_m)))))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 1.4) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.4d0) then
tmp = a_m / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 1.4) {
tmp = a_m / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 1.4: tmp = a_m / (1.0 + (k * (k + 10.0))) else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 1.4) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= 1.4) tmp = a_m / (1.0 + (k * (k + 10.0))); else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 1.4], N[(a$95$m / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a$95$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 1.4:\\
\;\;\;\;\frac{a_m}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
if m < 1.3999999999999999Initial program 96.2%
associate-*l/96.2%
associate-+l+96.2%
distribute-rgt-out96.2%
Simplified96.2%
Taylor expanded in m around 0 68.9%
if 1.3999999999999999 < m Initial program 70.0%
associate-*l/64.4%
associate-+l+64.4%
distribute-rgt-out64.4%
Simplified64.4%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 12.6%
Taylor expanded in k around inf 25.3%
Final simplification53.6%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k 3.5e-309)
(* -10.0 (* k a_m))
(if (<= k 0.1) a_m (* 0.1 (/ a_m k))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (k <= 3.5e-309) {
tmp = -10.0 * (k * a_m);
} else if (k <= 0.1) {
tmp = a_m;
} else {
tmp = 0.1 * (a_m / k);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 3.5d-309) then
tmp = (-10.0d0) * (k * a_m)
else if (k <= 0.1d0) then
tmp = a_m
else
tmp = 0.1d0 * (a_m / k)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (k <= 3.5e-309) {
tmp = -10.0 * (k * a_m);
} else if (k <= 0.1) {
tmp = a_m;
} else {
tmp = 0.1 * (a_m / k);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if k <= 3.5e-309: tmp = -10.0 * (k * a_m) elif k <= 0.1: tmp = a_m else: tmp = 0.1 * (a_m / k) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (k <= 3.5e-309) tmp = Float64(-10.0 * Float64(k * a_m)); elseif (k <= 0.1) tmp = a_m; else tmp = Float64(0.1 * Float64(a_m / k)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (k <= 3.5e-309) tmp = -10.0 * (k * a_m); elseif (k <= 0.1) tmp = a_m; else tmp = 0.1 * (a_m / k); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[k, 3.5e-309], N[(-10.0 * N[(k * a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.1], a$95$m, N[(0.1 * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 3.5 \cdot 10^{-309}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
if k < 3.4999999999999992e-309Initial program 86.8%
associate-*l/82.9%
associate-+l+82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in m around 0 13.6%
Taylor expanded in k around 0 15.0%
Taylor expanded in k around inf 23.1%
if 3.4999999999999992e-309 < k < 0.10000000000000001Initial program 100.0%
associate-*l/100.0%
associate-+l+100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 56.4%
Taylor expanded in k around 0 56.3%
if 0.10000000000000001 < k Initial program 76.2%
sqr-neg76.2%
cancel-sign-sub76.2%
distribute-lft-neg-in76.2%
neg-sub076.2%
associate--r-76.2%
associate--l+76.2%
associate--l+76.2%
+-commutative76.2%
associate--l+76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
sqr-neg76.2%
Simplified76.2%
add-cube-cbrt76.0%
pow376.0%
Applied egg-rr76.0%
Taylor expanded in m around 0 61.7%
pow-base-161.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in k around inf 61.6%
unpow261.6%
distribute-rgt-in61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in k around 0 20.2%
Final simplification32.6%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k -5e-310)
(* a_m (* k -10.0))
(if (<= k 0.1) a_m (* 0.1 (/ a_m k))))))a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.1) {
tmp = a_m;
} else {
tmp = 0.1 * (a_m / k);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= (-5d-310)) then
tmp = a_m * (k * (-10.0d0))
else if (k <= 0.1d0) then
tmp = a_m
else
tmp = 0.1d0 * (a_m / k)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (k <= -5e-310) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.1) {
tmp = a_m;
} else {
tmp = 0.1 * (a_m / k);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if k <= -5e-310: tmp = a_m * (k * -10.0) elif k <= 0.1: tmp = a_m else: tmp = 0.1 * (a_m / k) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (k <= -5e-310) tmp = Float64(a_m * Float64(k * -10.0)); elseif (k <= 0.1) tmp = a_m; else tmp = Float64(0.1 * Float64(a_m / k)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (k <= -5e-310) tmp = a_m * (k * -10.0); elseif (k <= 0.1) tmp = a_m; else tmp = 0.1 * (a_m / k); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[k, -5e-310], N[(a$95$m * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.1], a$95$m, N[(0.1 * N[(a$95$m / k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq -5 \cdot 10^{-310}:\\
\;\;\;\;a_m \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a_m}{k}\\
\end{array}
\end{array}
if k < -4.999999999999985e-310Initial program 86.8%
associate-*l/82.9%
associate-+l+82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in m around 0 13.6%
Taylor expanded in k around 0 15.0%
Taylor expanded in k around inf 23.1%
associate-*r*23.1%
*-commutative23.1%
associate-*l*23.1%
*-commutative23.1%
Simplified23.1%
if -4.999999999999985e-310 < k < 0.10000000000000001Initial program 100.0%
associate-*l/100.0%
associate-+l+100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 56.4%
Taylor expanded in k around 0 56.3%
if 0.10000000000000001 < k Initial program 76.2%
sqr-neg76.2%
cancel-sign-sub76.2%
distribute-lft-neg-in76.2%
neg-sub076.2%
associate--r-76.2%
associate--l+76.2%
associate--l+76.2%
+-commutative76.2%
associate--l+76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
sqr-neg76.2%
Simplified76.2%
add-cube-cbrt76.0%
pow376.0%
Applied egg-rr76.0%
Taylor expanded in m around 0 61.7%
pow-base-161.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in k around inf 61.6%
unpow261.6%
distribute-rgt-in61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in k around 0 20.2%
Final simplification32.6%
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= k 2e-309)
(* a_m (* k -10.0))
(if (<= k 0.1) 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 (k <= 2e-309) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.1) {
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 (k <= 2d-309) then
tmp = a_m * (k * (-10.0d0))
else if (k <= 0.1d0) 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 (k <= 2e-309) {
tmp = a_m * (k * -10.0);
} else if (k <= 0.1) {
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 k <= 2e-309: tmp = a_m * (k * -10.0) elif k <= 0.1: 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 (k <= 2e-309) tmp = Float64(a_m * Float64(k * -10.0)); elseif (k <= 0.1) 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 (k <= 2e-309) tmp = a_m * (k * -10.0); elseif (k <= 0.1) 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[k, 2e-309], N[(a$95$m * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.1], 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}\;k \leq 2 \cdot 10^{-309}:\\
\;\;\;\;a_m \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;\frac{a_m}{k \cdot 10}\\
\end{array}
\end{array}
if k < 1.9999999999999988e-309Initial program 86.8%
associate-*l/82.9%
associate-+l+82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in m around 0 13.6%
Taylor expanded in k around 0 15.0%
Taylor expanded in k around inf 23.1%
associate-*r*23.1%
*-commutative23.1%
associate-*l*23.1%
*-commutative23.1%
Simplified23.1%
if 1.9999999999999988e-309 < k < 0.10000000000000001Initial program 100.0%
associate-*l/100.0%
associate-+l+100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 56.4%
Taylor expanded in k around 0 56.3%
if 0.10000000000000001 < k Initial program 76.2%
sqr-neg76.2%
cancel-sign-sub76.2%
distribute-lft-neg-in76.2%
neg-sub076.2%
associate--r-76.2%
associate--l+76.2%
associate--l+76.2%
+-commutative76.2%
associate--l+76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
sqr-neg76.2%
Simplified76.2%
add-cube-cbrt76.0%
pow376.0%
Applied egg-rr76.0%
Taylor expanded in m around 0 61.7%
pow-base-161.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in k around inf 61.6%
unpow261.6%
distribute-rgt-in61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in k around 0 21.2%
*-commutative21.2%
Simplified21.2%
Final simplification33.0%
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (if (<= m 0.195) a_m (* -10.0 (* k a_m)))))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 0.195) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.195d0) then
tmp = a_m
else
tmp = (-10.0d0) * (k * a_m)
end if
code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 0.195) {
tmp = a_m;
} else {
tmp = -10.0 * (k * a_m);
}
return a_s * tmp;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 0.195: tmp = a_m else: tmp = -10.0 * (k * a_m) return a_s * tmp
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 0.195) tmp = a_m; else tmp = Float64(-10.0 * Float64(k * a_m)); end return Float64(a_s * tmp) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= 0.195) tmp = a_m; else tmp = -10.0 * (k * a_m); end tmp_2 = a_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 0.195], a$95$m, N[(-10.0 * N[(k * a$95$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 0.195:\\
\;\;\;\;a_m\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a_m\right)\\
\end{array}
\end{array}
if m < 0.19500000000000001Initial program 96.2%
associate-*l/96.2%
associate-+l+96.2%
distribute-rgt-out96.2%
Simplified96.2%
Taylor expanded in m around 0 68.9%
Taylor expanded in k around 0 29.8%
if 0.19500000000000001 < m Initial program 70.0%
associate-*l/64.4%
associate-+l+64.4%
distribute-rgt-out64.4%
Simplified64.4%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 12.6%
Taylor expanded in k around inf 25.3%
Final simplification28.2%
a_m = (fabs.f64 a) a_s = (copysign.f64 1 a) (FPCore (a_s a_m k m) :precision binary64 (* a_s a_m))
a_m = fabs(a);
a_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a_s * a_m
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a_m = math.fabs(a) a_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * a_m
a_m = abs(a) a_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * a_m) end
a_m = abs(a); a_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * a_m; end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * a$95$m), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
a_s \cdot a_m
\end{array}
Initial program 87.0%
associate-*l/85.0%
associate-+l+85.0%
distribute-rgt-out85.0%
Simplified85.0%
Taylor expanded in m around 0 45.7%
Taylor expanded in k around 0 20.8%
Final simplification20.8%
herbie shell --seed 2023336
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))