
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(*
a_s
(if (<= m -8.3e-41)
(* a_m (/ (pow k m) (+ 1.0 (* k (+ 10.0 k)))))
(if (<= m 2.25e-5)
(pow (/ (sqrt a_m) (hypot 1.0 k)) 2.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 <= -8.3e-41) {
tmp = a_m * (pow(k, m) / (1.0 + (k * (10.0 + k))));
} else if (m <= 2.25e-5) {
tmp = pow((sqrt(a_m) / hypot(1.0, k)), 2.0);
} else {
tmp = a_m / pow(k, -m);
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -8.3e-41) {
tmp = a_m * (Math.pow(k, m) / (1.0 + (k * (10.0 + k))));
} else if (m <= 2.25e-5) {
tmp = Math.pow((Math.sqrt(a_m) / Math.hypot(1.0, k)), 2.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 <= -8.3e-41: tmp = a_m * (math.pow(k, m) / (1.0 + (k * (10.0 + k)))) elif m <= 2.25e-5: tmp = math.pow((math.sqrt(a_m) / math.hypot(1.0, k)), 2.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 <= -8.3e-41) tmp = Float64(a_m * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(10.0 + k))))); elseif (m <= 2.25e-5) tmp = Float64(sqrt(a_m) / hypot(1.0, k)) ^ 2.0; else tmp = Float64(a_m / (k ^ Float64(-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 <= -8.3e-41) tmp = a_m * ((k ^ m) / (1.0 + (k * (10.0 + k)))); elseif (m <= 2.25e-5) tmp = (sqrt(a_m) / hypot(1.0, k)) ^ 2.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, -8.3e-41], N[(a$95$m * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.25e-5], N[Power[N[(N[Sqrt[a$95$m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $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 -8.3 \cdot 10^{-41}:\\
\;\;\;\;a\_m \cdot \frac{{k}^{m}}{1 + k \cdot \left(10 + k\right)}\\
\mathbf{elif}\;m \leq 2.25 \cdot 10^{-5}:\\
\;\;\;\;{\left(\frac{\sqrt{a\_m}}{\mathsf{hypot}\left(1, k\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{{k}^{\left(-m\right)}}\\
\end{array}
\end{array}
if m < -8.3000000000000004e-41Initial 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%
if -8.3000000000000004e-41 < m < 2.25000000000000014e-5Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in k around 0 87.9%
add-sqr-sqrt56.0%
pow256.0%
sqrt-div43.0%
hypot-1-def47.2%
Applied egg-rr47.2%
Taylor expanded in m around 0 47.2%
if 2.25000000000000014e-5 < m Initial program 67.1%
associate-/l*67.1%
remove-double-neg67.1%
distribute-frac-neg267.1%
distribute-neg-frac267.1%
remove-double-neg67.1%
sqr-neg67.1%
associate-+l+67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
Simplified67.1%
flip-+59.7%
associate-/r/59.7%
metadata-eval59.7%
pow259.7%
+-commutative59.7%
+-commutative59.7%
Applied egg-rr59.7%
associate-/r/59.7%
metadata-eval59.7%
unpow259.7%
flip-+67.1%
+-commutative67.1%
fma-undefine67.1%
clear-num67.1%
div-inv67.2%
div-inv67.2%
associate-/r*59.7%
pow-flip59.7%
Applied egg-rr59.7%
Taylor expanded in k around 0 100.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 (pow (* (/ 1.0 (hypot 1.0 k)) (sqrt (* a_m (pow k m)))) 2.0)))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * pow(((1.0 / hypot(1.0, k)) * sqrt((a_m * pow(k, m)))), 2.0);
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * Math.pow(((1.0 / Math.hypot(1.0, k)) * Math.sqrt((a_m * Math.pow(k, m)))), 2.0);
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * math.pow(((1.0 / math.hypot(1.0, k)) * math.sqrt((a_m * math.pow(k, m)))), 2.0)
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * (Float64(Float64(1.0 / hypot(1.0, k)) * sqrt(Float64(a_m * (k ^ m)))) ^ 2.0)) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * (((1.0 / hypot(1.0, k)) * sqrt((a_m * (k ^ m)))) ^ 2.0); end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[Power[N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot {\left(\frac{1}{\mathsf{hypot}\left(1, k\right)} \cdot \sqrt{a\_m \cdot {k}^{m}}\right)}^{2}
\end{array}
Initial program 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in k around 0 86.3%
add-sqr-sqrt63.1%
pow263.1%
sqrt-div57.9%
hypot-1-def62.3%
Applied egg-rr62.3%
clear-num62.3%
associate-/r/62.3%
Applied egg-rr62.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 (pow (/ (sqrt (* a_m (pow k m))) (hypot 1.0 k)) 2.0)))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * pow((sqrt((a_m * pow(k, m))) / hypot(1.0, k)), 2.0);
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * Math.pow((Math.sqrt((a_m * Math.pow(k, m))) / Math.hypot(1.0, k)), 2.0);
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * math.pow((math.sqrt((a_m * math.pow(k, m))) / math.hypot(1.0, k)), 2.0)
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * (Float64(sqrt(Float64(a_m * (k ^ m))) / hypot(1.0, k)) ^ 2.0)) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * ((sqrt((a_m * (k ^ m))) / hypot(1.0, k)) ^ 2.0); end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[Power[N[(N[Sqrt[N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot {\left(\frac{\sqrt{a\_m \cdot {k}^{m}}}{\mathsf{hypot}\left(1, k\right)}\right)}^{2}
\end{array}
Initial program 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in k around 0 86.3%
add-sqr-sqrt63.1%
pow263.1%
sqrt-div57.9%
hypot-1-def62.3%
Applied egg-rr62.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 2.65e-5)
(/ (* a_m (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))
(/ a_m (pow k (- m))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 2.65e-5) {
tmp = (a_m * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
} else {
tmp = a_m / pow(k, -m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.65d-5) then
tmp = (a_m * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
else
tmp = a_m / (k ** -m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 2.65e-5) {
tmp = (a_m * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
} else {
tmp = a_m / Math.pow(k, -m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 2.65e-5: tmp = (a_m * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k)) else: tmp = a_m / math.pow(k, -m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 2.65e-5) tmp = Float64(Float64(a_m * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))); else tmp = Float64(a_m / (k ^ Float64(-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.65e-5) tmp = (a_m * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); else tmp = a_m / (k ^ -m); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 2.65e-5], N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 2.65 \cdot 10^{-5}:\\
\;\;\;\;\frac{a\_m \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{{k}^{\left(-m\right)}}\\
\end{array}
\end{array}
if m < 2.65e-5Initial program 94.6%
if 2.65e-5 < m Initial program 67.1%
associate-/l*67.1%
remove-double-neg67.1%
distribute-frac-neg267.1%
distribute-neg-frac267.1%
remove-double-neg67.1%
sqr-neg67.1%
associate-+l+67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
Simplified67.1%
flip-+59.7%
associate-/r/59.7%
metadata-eval59.7%
pow259.7%
+-commutative59.7%
+-commutative59.7%
Applied egg-rr59.7%
associate-/r/59.7%
metadata-eval59.7%
unpow259.7%
flip-+67.1%
+-commutative67.1%
fma-undefine67.1%
clear-num67.1%
div-inv67.2%
div-inv67.2%
associate-/r*59.7%
pow-flip59.7%
Applied egg-rr59.7%
Taylor expanded in k around 0 100.0%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (pow k (- m))))
(*
a_s
(if (<= m 2.65e-5) (/ (/ a_m (+ (* k (+ k 10.0)) 1.0)) t_0) (/ a_m 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);
double tmp;
if (m <= 2.65e-5) {
tmp = (a_m / ((k * (k + 10.0)) + 1.0)) / t_0;
} else {
tmp = a_m / 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
if (m <= 2.65d-5) then
tmp = (a_m / ((k * (k + 10.0d0)) + 1.0d0)) / t_0
else
tmp = a_m / 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);
double tmp;
if (m <= 2.65e-5) {
tmp = (a_m / ((k * (k + 10.0)) + 1.0)) / t_0;
} else {
tmp = a_m / 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) tmp = 0 if m <= 2.65e-5: tmp = (a_m / ((k * (k + 10.0)) + 1.0)) / t_0 else: tmp = a_m / 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 = k ^ Float64(-m) tmp = 0.0 if (m <= 2.65e-5) tmp = Float64(Float64(a_m / Float64(Float64(k * Float64(k + 10.0)) + 1.0)) / t_0); else tmp = Float64(a_m / 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; tmp = 0.0; if (m <= 2.65e-5) tmp = (a_m / ((k * (k + 10.0)) + 1.0)) / t_0; else tmp = a_m / 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[Power[k, (-m)], $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, 2.65e-5], N[(N[(a$95$m / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(a$95$m / t$95$0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := {k}^{\left(-m\right)}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 2.65 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{a\_m}{k \cdot \left(k + 10\right) + 1}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{t\_0}\\
\end{array}
\end{array}
\end{array}
if m < 2.65e-5Initial program 94.6%
associate-/l*94.6%
remove-double-neg94.6%
distribute-frac-neg294.6%
distribute-neg-frac294.6%
remove-double-neg94.6%
sqr-neg94.6%
associate-+l+94.6%
sqr-neg94.6%
distribute-rgt-out94.6%
Simplified94.6%
flip-+62.4%
associate-/r/62.4%
metadata-eval62.4%
pow262.4%
+-commutative62.4%
+-commutative62.4%
Applied egg-rr62.4%
associate-/r/62.4%
metadata-eval62.4%
unpow262.4%
flip-+94.6%
+-commutative94.6%
fma-undefine94.6%
clear-num94.6%
div-inv94.6%
div-inv94.6%
associate-/r*94.6%
pow-flip94.6%
Applied egg-rr94.6%
fma-undefine94.6%
Applied egg-rr94.6%
if 2.65e-5 < m Initial program 67.1%
associate-/l*67.1%
remove-double-neg67.1%
distribute-frac-neg267.1%
distribute-neg-frac267.1%
remove-double-neg67.1%
sqr-neg67.1%
associate-+l+67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
Simplified67.1%
flip-+59.7%
associate-/r/59.7%
metadata-eval59.7%
pow259.7%
+-commutative59.7%
+-commutative59.7%
Applied egg-rr59.7%
associate-/r/59.7%
metadata-eval59.7%
unpow259.7%
flip-+67.1%
+-commutative67.1%
fma-undefine67.1%
clear-num67.1%
div-inv67.2%
div-inv67.2%
associate-/r*59.7%
pow-flip59.7%
Applied egg-rr59.7%
Taylor expanded in k around 0 100.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.65e-5)
(* a_m (/ (pow k m) (+ 1.0 (* k (+ 10.0 k)))))
(/ a_m (pow k (- m))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 2.65e-5) {
tmp = a_m * (pow(k, m) / (1.0 + (k * (10.0 + k))));
} else {
tmp = a_m / pow(k, -m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.65d-5) then
tmp = a_m * ((k ** m) / (1.0d0 + (k * (10.0d0 + k))))
else
tmp = a_m / (k ** -m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 2.65e-5) {
tmp = a_m * (Math.pow(k, m) / (1.0 + (k * (10.0 + k))));
} else {
tmp = a_m / Math.pow(k, -m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 2.65e-5: tmp = a_m * (math.pow(k, m) / (1.0 + (k * (10.0 + k)))) else: tmp = a_m / math.pow(k, -m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 2.65e-5) tmp = Float64(a_m * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(10.0 + k))))); else tmp = Float64(a_m / (k ^ Float64(-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.65e-5) tmp = a_m * ((k ^ m) / (1.0 + (k * (10.0 + k)))); else tmp = a_m / (k ^ -m); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 2.65e-5], N[(a$95$m * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 2.65 \cdot 10^{-5}:\\
\;\;\;\;a\_m \cdot \frac{{k}^{m}}{1 + k \cdot \left(10 + k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{{k}^{\left(-m\right)}}\\
\end{array}
\end{array}
if m < 2.65e-5Initial program 94.6%
associate-/l*94.6%
remove-double-neg94.6%
distribute-frac-neg294.6%
distribute-neg-frac294.6%
remove-double-neg94.6%
sqr-neg94.6%
associate-+l+94.6%
sqr-neg94.6%
distribute-rgt-out94.6%
Simplified94.6%
if 2.65e-5 < m Initial program 67.1%
associate-/l*67.1%
remove-double-neg67.1%
distribute-frac-neg267.1%
distribute-neg-frac267.1%
remove-double-neg67.1%
sqr-neg67.1%
associate-+l+67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
Simplified67.1%
flip-+59.7%
associate-/r/59.7%
metadata-eval59.7%
pow259.7%
+-commutative59.7%
+-commutative59.7%
Applied egg-rr59.7%
associate-/r/59.7%
metadata-eval59.7%
unpow259.7%
flip-+67.1%
+-commutative67.1%
fma-undefine67.1%
clear-num67.1%
div-inv67.2%
div-inv67.2%
associate-/r*59.7%
pow-flip59.7%
Applied egg-rr59.7%
Taylor expanded in k around 0 100.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.7e-5)
(* a_m (pow k m))
(if (<= m 3.7e-6)
(/ a_m (+ (+ 1.0 (* k 10.0)) (* k k)))
(/ a_m (pow k (- m)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -2.7e-5) {
tmp = a_m * pow(k, m);
} else if (m <= 3.7e-6) {
tmp = a_m / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = a_m / pow(k, -m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-2.7d-5)) then
tmp = a_m * (k ** m)
else if (m <= 3.7d-6) then
tmp = a_m / ((1.0d0 + (k * 10.0d0)) + (k * k))
else
tmp = a_m / (k ** -m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -2.7e-5) {
tmp = a_m * Math.pow(k, m);
} else if (m <= 3.7e-6) {
tmp = a_m / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = a_m / Math.pow(k, -m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -2.7e-5: tmp = a_m * math.pow(k, m) elif m <= 3.7e-6: tmp = a_m / ((1.0 + (k * 10.0)) + (k * k)) else: tmp = a_m / math.pow(k, -m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -2.7e-5) tmp = Float64(a_m * (k ^ m)); elseif (m <= 3.7e-6) tmp = Float64(a_m / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))); else tmp = Float64(a_m / (k ^ Float64(-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.7e-5) tmp = a_m * (k ^ m); elseif (m <= 3.7e-6) tmp = a_m / ((1.0 + (k * 10.0)) + (k * k)); else tmp = a_m / (k ^ -m); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -2.7e-5], N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 3.7e-6], N[(a$95$m / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -2.7 \cdot 10^{-5}:\\
\;\;\;\;a\_m \cdot {k}^{m}\\
\mathbf{elif}\;m \leq 3.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{a\_m}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{{k}^{\left(-m\right)}}\\
\end{array}
\end{array}
if m < -2.6999999999999999e-5Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in k around 0 100.0%
if -2.6999999999999999e-5 < m < 3.7000000000000002e-6Initial program 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in m around 0 89.7%
if 3.7000000000000002e-6 < m Initial program 67.1%
associate-/l*67.1%
remove-double-neg67.1%
distribute-frac-neg267.1%
distribute-neg-frac267.1%
remove-double-neg67.1%
sqr-neg67.1%
associate-+l+67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
Simplified67.1%
flip-+59.7%
associate-/r/59.7%
metadata-eval59.7%
pow259.7%
+-commutative59.7%
+-commutative59.7%
Applied egg-rr59.7%
associate-/r/59.7%
metadata-eval59.7%
unpow259.7%
flip-+67.1%
+-commutative67.1%
fma-undefine67.1%
clear-num67.1%
div-inv67.2%
div-inv67.2%
associate-/r*59.7%
pow-flip59.7%
Applied egg-rr59.7%
Taylor expanded in k around 0 100.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.65e-5)
(/ (* a_m (pow k m)) (+ 1.0 (* k k)))
(/ a_m (pow k (- m))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 2.65e-5) {
tmp = (a_m * pow(k, m)) / (1.0 + (k * k));
} else {
tmp = a_m / pow(k, -m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.65d-5) then
tmp = (a_m * (k ** m)) / (1.0d0 + (k * k))
else
tmp = a_m / (k ** -m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= 2.65e-5) {
tmp = (a_m * Math.pow(k, m)) / (1.0 + (k * k));
} else {
tmp = a_m / Math.pow(k, -m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= 2.65e-5: tmp = (a_m * math.pow(k, m)) / (1.0 + (k * k)) else: tmp = a_m / math.pow(k, -m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= 2.65e-5) tmp = Float64(Float64(a_m * (k ^ m)) / Float64(1.0 + Float64(k * k))); else tmp = Float64(a_m / (k ^ Float64(-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.65e-5) tmp = (a_m * (k ^ m)) / (1.0 + (k * k)); else tmp = a_m / (k ^ -m); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, 2.65e-5], N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq 2.65 \cdot 10^{-5}:\\
\;\;\;\;\frac{a\_m \cdot {k}^{m}}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{{k}^{\left(-m\right)}}\\
\end{array}
\end{array}
if m < 2.65e-5Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in k around 0 93.1%
if 2.65e-5 < m Initial program 67.1%
associate-/l*67.1%
remove-double-neg67.1%
distribute-frac-neg267.1%
distribute-neg-frac267.1%
remove-double-neg67.1%
sqr-neg67.1%
associate-+l+67.1%
sqr-neg67.1%
distribute-rgt-out67.1%
Simplified67.1%
flip-+59.7%
associate-/r/59.7%
metadata-eval59.7%
pow259.7%
+-commutative59.7%
+-commutative59.7%
Applied egg-rr59.7%
associate-/r/59.7%
metadata-eval59.7%
unpow259.7%
flip-+67.1%
+-commutative67.1%
fma-undefine67.1%
clear-num67.1%
div-inv67.2%
div-inv67.2%
associate-/r*59.7%
pow-flip59.7%
Applied egg-rr59.7%
Taylor expanded in k around 0 100.0%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
:precision binary64
(let* ((t_0 (* a_m (pow k m))))
(*
a_s
(if (<= m -0.9)
t_0
(if (<= m 2.55e-6) (/ a_m (+ (+ 1.0 (* k 10.0)) (* k k))) t_0)))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double t_0 = a_m * pow(k, m);
double tmp;
if (m <= -0.9) {
tmp = t_0;
} else if (m <= 2.55e-6) {
tmp = a_m / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = t_0;
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a_m * (k ** m)
if (m <= (-0.9d0)) then
tmp = t_0
else if (m <= 2.55d-6) then
tmp = a_m / ((1.0d0 + (k * 10.0d0)) + (k * k))
else
tmp = t_0
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double t_0 = a_m * Math.pow(k, m);
double tmp;
if (m <= -0.9) {
tmp = t_0;
} else if (m <= 2.55e-6) {
tmp = a_m / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = t_0;
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): t_0 = a_m * math.pow(k, m) tmp = 0 if m <= -0.9: tmp = t_0 elif m <= 2.55e-6: tmp = a_m / ((1.0 + (k * 10.0)) + (k * k)) else: tmp = t_0 return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) t_0 = Float64(a_m * (k ^ m)) tmp = 0.0 if (m <= -0.9) tmp = t_0; elseif (m <= 2.55e-6) tmp = Float64(a_m / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))); else tmp = t_0; end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) t_0 = a_m * (k ^ m); tmp = 0.0; if (m <= -0.9) tmp = t_0; elseif (m <= 2.55e-6) tmp = a_m / ((1.0 + (k * 10.0)) + (k * k)); else tmp = t_0; end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, -0.9], t$95$0, If[LessEqual[m, 2.55e-6], N[(a$95$m / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_0 := a\_m \cdot {k}^{m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -0.9:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq 2.55 \cdot 10^{-6}:\\
\;\;\;\;\frac{a\_m}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if m < -0.900000000000000022 or 2.5500000000000001e-6 < m Initial program 85.0%
associate-/l*85.0%
remove-double-neg85.0%
distribute-frac-neg285.0%
distribute-neg-frac285.0%
remove-double-neg85.0%
sqr-neg85.0%
associate-+l+85.0%
sqr-neg85.0%
distribute-rgt-out85.0%
Simplified85.0%
Taylor expanded in k around 0 100.0%
if -0.900000000000000022 < m < 2.5500000000000001e-6Initial program 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in m around 0 89.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 -3.7e+76)
(/ a_m (+ (* 10.0 k) (* k k)))
(if (<= m 1.75)
(/ a_m (+ 1.0 (* k (+ 10.0 k))))
(* a_m (+ 1.0 (* k (- (* 99.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.7e+76) {
tmp = a_m / ((10.0 * k) + (k * k));
} else if (m <= 1.75) {
tmp = a_m / (1.0 + (k * (10.0 + k)));
} else {
tmp = a_m * (1.0 + (k * ((99.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.7d+76)) then
tmp = a_m / ((10.0d0 * k) + (k * k))
else if (m <= 1.75d0) then
tmp = a_m / (1.0d0 + (k * (10.0d0 + k)))
else
tmp = a_m * (1.0d0 + (k * ((99.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.7e+76) {
tmp = a_m / ((10.0 * k) + (k * k));
} else if (m <= 1.75) {
tmp = a_m / (1.0 + (k * (10.0 + k)));
} else {
tmp = a_m * (1.0 + (k * ((99.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.7e+76: tmp = a_m / ((10.0 * k) + (k * k)) elif m <= 1.75: tmp = a_m / (1.0 + (k * (10.0 + k))) else: tmp = a_m * (1.0 + (k * ((99.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.7e+76) tmp = Float64(a_m / Float64(Float64(10.0 * k) + Float64(k * k))); elseif (m <= 1.75) tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(10.0 + k)))); else tmp = Float64(a_m * Float64(1.0 + Float64(k * Float64(Float64(99.0 * 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.7e+76) tmp = a_m / ((10.0 * k) + (k * k)); elseif (m <= 1.75) tmp = a_m / (1.0 + (k * (10.0 + k))); else tmp = a_m * (1.0 + (k * ((99.0 * k) - 10.0))); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -3.7e+76], N[(a$95$m / N[(N[(10.0 * k), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.75], N[(a$95$m / N[(1.0 + N[(k * N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(1.0 + N[(k * N[(N[(99.0 * k), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -3.7 \cdot 10^{+76}:\\
\;\;\;\;\frac{a\_m}{10 \cdot k + k \cdot k}\\
\mathbf{elif}\;m \leq 1.75:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(10 + k\right)}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(1 + k \cdot \left(99 \cdot k - 10\right)\right)\\
\end{array}
\end{array}
if m < -3.6999999999999999e76Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 46.8%
Taylor expanded in k around inf 55.4%
if -3.6999999999999999e76 < m < 1.75Initial program 91.9%
associate-/l*91.8%
remove-double-neg91.8%
distribute-frac-neg291.8%
distribute-neg-frac291.8%
remove-double-neg91.8%
sqr-neg91.8%
associate-+l+91.8%
sqr-neg91.8%
distribute-rgt-out91.8%
Simplified91.8%
Taylor expanded in m around 0 84.2%
if 1.75 < m Initial program 66.7%
associate-/l*66.7%
remove-double-neg66.7%
distribute-frac-neg266.7%
distribute-neg-frac266.7%
remove-double-neg66.7%
sqr-neg66.7%
associate-+l+66.7%
sqr-neg66.7%
distribute-rgt-out66.7%
Simplified66.7%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 37.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 -4e+76)
(/ a_m (+ (* 10.0 k) (* k k)))
(if (<= m 2.1)
(/ a_m (+ (+ 1.0 (* k 10.0)) (* k k)))
(* a_m (+ 1.0 (* k (- (* 99.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 <= -4e+76) {
tmp = a_m / ((10.0 * k) + (k * k));
} else if (m <= 2.1) {
tmp = a_m / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = a_m * (1.0 + (k * ((99.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 <= (-4d+76)) then
tmp = a_m / ((10.0d0 * k) + (k * k))
else if (m <= 2.1d0) then
tmp = a_m / ((1.0d0 + (k * 10.0d0)) + (k * k))
else
tmp = a_m * (1.0d0 + (k * ((99.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 <= -4e+76) {
tmp = a_m / ((10.0 * k) + (k * k));
} else if (m <= 2.1) {
tmp = a_m / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = a_m * (1.0 + (k * ((99.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 <= -4e+76: tmp = a_m / ((10.0 * k) + (k * k)) elif m <= 2.1: tmp = a_m / ((1.0 + (k * 10.0)) + (k * k)) else: tmp = a_m * (1.0 + (k * ((99.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 <= -4e+76) tmp = Float64(a_m / Float64(Float64(10.0 * k) + Float64(k * k))); elseif (m <= 2.1) tmp = Float64(a_m / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))); else tmp = Float64(a_m * Float64(1.0 + Float64(k * Float64(Float64(99.0 * 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 <= -4e+76) tmp = a_m / ((10.0 * k) + (k * k)); elseif (m <= 2.1) tmp = a_m / ((1.0 + (k * 10.0)) + (k * k)); else tmp = a_m * (1.0 + (k * ((99.0 * k) - 10.0))); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -4e+76], N[(a$95$m / N[(N[(10.0 * k), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.1], N[(a$95$m / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m * N[(1.0 + N[(k * N[(N[(99.0 * k), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;m \leq -4 \cdot 10^{+76}:\\
\;\;\;\;\frac{a\_m}{10 \cdot k + k \cdot k}\\
\mathbf{elif}\;m \leq 2.1:\\
\;\;\;\;\frac{a\_m}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\_m \cdot \left(1 + k \cdot \left(99 \cdot k - 10\right)\right)\\
\end{array}
\end{array}
if m < -4.0000000000000002e76Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 46.8%
Taylor expanded in k around inf 55.4%
if -4.0000000000000002e76 < m < 2.10000000000000009Initial program 91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in m around 0 84.2%
if 2.10000000000000009 < m Initial program 66.7%
associate-/l*66.7%
remove-double-neg66.7%
distribute-frac-neg266.7%
distribute-neg-frac266.7%
remove-double-neg66.7%
sqr-neg66.7%
associate-+l+66.7%
sqr-neg66.7%
distribute-rgt-out66.7%
Simplified66.7%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 37.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 -6e+77)
(/ a_m (+ (* 10.0 k) (* k k)))
(/ a_m (+ 1.0 (* k (+ 10.0 k)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -6e+77) {
tmp = a_m / ((10.0 * k) + (k * k));
} else {
tmp = a_m / (1.0 + (k * (10.0 + k)));
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-6d+77)) then
tmp = a_m / ((10.0d0 * k) + (k * k))
else
tmp = a_m / (1.0d0 + (k * (10.0d0 + k)))
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
double tmp;
if (m <= -6e+77) {
tmp = a_m / ((10.0 * k) + (k * k));
} else {
tmp = a_m / (1.0 + (k * (10.0 + k)));
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): tmp = 0 if m <= -6e+77: tmp = a_m / ((10.0 * k) + (k * k)) else: tmp = a_m / (1.0 + (k * (10.0 + k))) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) tmp = 0.0 if (m <= -6e+77) tmp = Float64(a_m / Float64(Float64(10.0 * k) + Float64(k * k))); else tmp = Float64(a_m / Float64(1.0 + Float64(k * Float64(10.0 + k)))); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, a_m, k, m) tmp = 0.0; if (m <= -6e+77) tmp = a_m / ((10.0 * k) + (k * k)); else tmp = a_m / (1.0 + (k * (10.0 + k))); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -6e+77], N[(a$95$m / N[(N[(10.0 * k), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a$95$m / N[(1.0 + N[(k * N[(10.0 + k), $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 -6 \cdot 10^{+77}:\\
\;\;\;\;\frac{a\_m}{10 \cdot k + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a\_m}{1 + k \cdot \left(10 + k\right)}\\
\end{array}
\end{array}
if m < -5.9999999999999996e77Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 46.8%
Taylor expanded in k around inf 55.4%
if -5.9999999999999996e77 < m Initial program 83.2%
associate-/l*83.1%
remove-double-neg83.1%
distribute-frac-neg283.1%
distribute-neg-frac283.1%
remove-double-neg83.1%
sqr-neg83.1%
associate-+l+83.1%
sqr-neg83.1%
distribute-rgt-out83.1%
Simplified83.1%
Taylor expanded in m around 0 56.1%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s a_m k m) :precision binary64 (* a_s (/ a_m (+ 1.0 (* k (+ 10.0 k))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * (a_m / (1.0 + (k * (10.0 + k))));
}
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 / (1.0d0 + (k * (10.0d0 + k))))
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 / (1.0 + (k * (10.0 + k))));
}
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 / (1.0 + (k * (10.0 + k))))
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * Float64(a_m / Float64(1.0 + Float64(k * Float64(10.0 + k))))) 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 / (1.0 + (k * (10.0 + k)))); end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[(a$95$m / N[(1.0 + N[(k * N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \frac{a\_m}{1 + k \cdot \left(10 + k\right)}
\end{array}
Initial program 87.4%
associate-/l*87.4%
remove-double-neg87.4%
distribute-frac-neg287.4%
distribute-neg-frac287.4%
remove-double-neg87.4%
sqr-neg87.4%
associate-+l+87.4%
sqr-neg87.4%
distribute-rgt-out87.4%
Simplified87.4%
Taylor expanded in m around 0 53.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 (+ 1.0 (* 10.0 k)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * (a_m / (1.0 + (10.0 * k)));
}
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 / (1.0d0 + (10.0d0 * k)))
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 / (1.0 + (10.0 * k)));
}
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 / (1.0 + (10.0 * k)))
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * Float64(a_m / Float64(1.0 + Float64(10.0 * k)))) 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 / (1.0 + (10.0 * k))); end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[(a$95$m / N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \frac{a\_m}{1 + 10 \cdot k}
\end{array}
Initial program 87.4%
associate-/l*87.4%
remove-double-neg87.4%
distribute-frac-neg287.4%
distribute-neg-frac287.4%
remove-double-neg87.4%
sqr-neg87.4%
associate-+l+87.4%
sqr-neg87.4%
distribute-rgt-out87.4%
Simplified87.4%
Taylor expanded in m around 0 53.7%
Taylor expanded in k around 0 32.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 (/ a_m (+ 1.0 (* k k)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * (a_m / (1.0 + (k * k)));
}
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 / (1.0d0 + (k * k)))
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 / (1.0 + (k * k)));
}
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 / (1.0 + (k * k)))
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * Float64(a_m / Float64(1.0 + Float64(k * k)))) 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 / (1.0 + (k * k))); end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[(a$95$m / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \frac{a\_m}{1 + k \cdot k}
\end{array}
Initial program 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in k around 0 86.3%
Taylor expanded in m around 0 52.6%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s a_m k m) :precision binary64 (* a_s a_m))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, a_m, k, m)
real(8), intent (in) :: a_s
real(8), intent (in) :: a_m
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a_s * a_m
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double a_m, double k, double m) {
return a_s * a_m;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, a_m, k, m): return a_s * a_m
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, a_m, k, m) return Float64(a_s * a_m) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp = code(a_s, a_m, k, m) tmp = a_s * a_m; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * a$95$m), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot a\_m
\end{array}
Initial program 87.4%
associate-/l*87.4%
remove-double-neg87.4%
distribute-frac-neg287.4%
distribute-neg-frac287.4%
remove-double-neg87.4%
sqr-neg87.4%
associate-+l+87.4%
sqr-neg87.4%
distribute-rgt-out87.4%
Simplified87.4%
Taylor expanded in m around 0 53.7%
Taylor expanded in k around 0 21.9%
herbie shell --seed 2024076 -o generate:simplify
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))