
(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 18 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}
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a)) (t_1 (hypot k (sqrt (fma k 10.0 1.0))))) (if (<= k -2.0) t_0 (/ (/ t_0 t_1) t_1))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double t_1 = hypot(k, sqrt(fma(k, 10.0, 1.0)));
double tmp;
if (k <= -2.0) {
tmp = t_0;
} else {
tmp = (t_0 / t_1) / t_1;
}
return tmp;
}
function code(a, k, m) t_0 = Float64((k ^ m) * a) t_1 = hypot(k, sqrt(fma(k, 10.0, 1.0))) tmp = 0.0 if (k <= -2.0) tmp = t_0; else tmp = Float64(Float64(t_0 / t_1) / t_1); end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[k ^ 2 + N[Sqrt[N[(k * 10.0 + 1.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[k, -2.0], t$95$0, N[(N[(t$95$0 / t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
t_1 := \mathsf{hypot}\left(k, \sqrt{\mathsf{fma}\left(k, 10, 1\right)}\right)\\
\mathbf{if}\;k \leq -2:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_0}{t_1}}{t_1}\\
\end{array}
\end{array}
if k < -2Initial program 95.1%
associate-*r/95.1%
*-commutative95.1%
associate-+l+95.1%
+-commutative95.1%
distribute-rgt-out95.1%
fma-def95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in k around 0 100.0%
if -2 < k Initial program 88.0%
associate-*r/88.0%
*-commutative88.0%
associate-+l+88.0%
+-commutative88.0%
distribute-rgt-out88.0%
fma-def88.0%
+-commutative88.0%
Simplified88.0%
associate-*l/88.0%
*-commutative88.0%
fma-udef88.0%
+-commutative88.0%
+-commutative88.0%
add-sqr-sqrt88.0%
associate-/r*88.0%
*-commutative88.0%
distribute-rgt-in88.0%
associate-+l+88.0%
+-commutative88.0%
add-sqr-sqrt88.0%
hypot-def88.0%
+-commutative88.0%
*-commutative88.0%
fma-def88.0%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 1e+187)
(* (/ (pow k m) (hypot 1.0 k)) (/ a (hypot 1.0 k)))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+187) {
tmp = (pow(k, m) / hypot(1.0, k)) * (a / hypot(1.0, k));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+187) {
tmp = (Math.pow(k, m) / Math.hypot(1.0, k)) * (a / Math.hypot(1.0, k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+187: tmp = (math.pow(k, m) / math.hypot(1.0, k)) * (a / math.hypot(1.0, k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 1e+187) tmp = Float64(Float64((k ^ m) / hypot(1.0, k)) * Float64(a / hypot(1.0, k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+187) tmp = ((k ^ m) / hypot(1.0, k)) * (a / hypot(1.0, k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+187], N[(N[(N[Power[k, m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+187}:\\
\;\;\;\;\frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right)} \cdot \frac{a}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) < 9.99999999999999907e186Initial program 97.0%
Taylor expanded in k around 0 96.0%
*-commutative96.0%
add-sqr-sqrt96.0%
times-frac96.0%
hypot-1-def96.0%
hypot-1-def98.9%
Applied egg-rr98.9%
if 9.99999999999999907e186 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 62.7%
associate-*r/62.7%
*-commutative62.7%
associate-+l+62.7%
+-commutative62.7%
distribute-rgt-out62.7%
fma-def62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in k around 0 99.4%
Final simplification99.0%
(FPCore (a k m) :precision binary64 (if (<= m 4.6) (* (pow k m) (/ (- a) (- -1.0 (* k (+ k 10.0))))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.6) {
tmp = pow(k, m) * (-a / (-1.0 - (k * (k + 10.0))));
} else {
tmp = pow(k, m) * a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 4.6d0) then
tmp = (k ** m) * (-a / ((-1.0d0) - (k * (k + 10.0d0))))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 4.6) {
tmp = Math.pow(k, m) * (-a / (-1.0 - (k * (k + 10.0))));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4.6: tmp = math.pow(k, m) * (-a / (-1.0 - (k * (k + 10.0)))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4.6) tmp = Float64((k ^ m) * Float64(Float64(-a) / Float64(-1.0 - Float64(k * Float64(k + 10.0))))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 4.6) tmp = (k ^ m) * (-a / (-1.0 - (k * (k + 10.0)))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4.6], N[(N[Power[k, m], $MachinePrecision] * N[((-a) / N[(-1.0 - N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.6:\\
\;\;\;\;{k}^{m} \cdot \frac{-a}{-1 - k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 4.5999999999999996Initial program 96.6%
associate-*r/96.6%
*-commutative96.6%
associate-+l+96.6%
+-commutative96.6%
distribute-rgt-out96.6%
fma-def96.6%
+-commutative96.6%
Simplified96.6%
associate-*l/96.6%
*-commutative96.6%
fma-udef96.6%
+-commutative96.6%
+-commutative96.6%
frac-2neg96.6%
*-commutative96.6%
distribute-rgt-neg-in96.6%
neg-sub096.6%
+-commutative96.6%
associate--r+96.6%
metadata-eval96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-*l/96.7%
*-commutative96.7%
Simplified96.7%
if 4.5999999999999996 < m Initial program 73.5%
associate-*r/73.5%
*-commutative73.5%
associate-+l+73.5%
+-commutative73.5%
distribute-rgt-out73.5%
fma-def73.5%
+-commutative73.5%
Simplified73.5%
Taylor expanded in k around 0 100.0%
Final simplification97.7%
(FPCore (a k m) :precision binary64 (if (<= m 2.9) (/ a (/ (+ 1.0 (* k (+ k 10.0))) (pow k m))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.9) {
tmp = a / ((1.0 + (k * (k + 10.0))) / pow(k, m));
} else {
tmp = pow(k, m) * a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.9d0) then
tmp = a / ((1.0d0 + (k * (k + 10.0d0))) / (k ** m))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.9) {
tmp = a / ((1.0 + (k * (k + 10.0))) / Math.pow(k, m));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.9: tmp = a / ((1.0 + (k * (k + 10.0))) / math.pow(k, m)) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.9) tmp = Float64(a / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / (k ^ m))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.9) tmp = a / ((1.0 + (k * (k + 10.0))) / (k ^ m)); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.9], N[(a / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.9:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 2.89999999999999991Initial program 96.6%
associate-/l*96.6%
associate-+l+96.6%
distribute-rgt-out96.6%
Simplified96.6%
if 2.89999999999999991 < m Initial program 73.5%
associate-*r/73.5%
*-commutative73.5%
associate-+l+73.5%
+-commutative73.5%
distribute-rgt-out73.5%
fma-def73.5%
+-commutative73.5%
Simplified73.5%
Taylor expanded in k around 0 100.0%
Final simplification97.7%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a))) (if (<= m 2.5) (/ t_0 (+ 1.0 (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 2.5) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (m <= 2.5d0) then
tmp = t_0 / (1.0d0 + (k * k))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if (m <= 2.5) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 2.5: tmp = t_0 / (1.0 + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 2.5) tmp = Float64(t_0 / Float64(1.0 + Float64(k * k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (m <= 2.5) tmp = t_0 / (1.0 + (k * k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, 2.5], N[(t$95$0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 2.5:\\
\;\;\;\;\frac{t_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if m < 2.5Initial program 96.6%
Taylor expanded in k around 0 95.3%
if 2.5 < m Initial program 73.5%
associate-*r/73.5%
*-commutative73.5%
associate-+l+73.5%
+-commutative73.5%
distribute-rgt-out73.5%
fma-def73.5%
+-commutative73.5%
Simplified73.5%
Taylor expanded in k around 0 100.0%
Final simplification96.8%
(FPCore (a k m) :precision binary64 (if (or (<= m -3.2e-7) (not (<= m 8.2e-8))) (* (pow k m) a) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -3.2e-7) || !(m <= 8.2e-8)) {
tmp = pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-3.2d-7)) .or. (.not. (m <= 8.2d-8))) then
tmp = (k ** m) * a
else
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -3.2e-7) || !(m <= 8.2e-8)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -3.2e-7) or not (m <= 8.2e-8): tmp = math.pow(k, m) * a else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -3.2e-7) || !(m <= 8.2e-8)) tmp = Float64((k ^ m) * a); else tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -3.2e-7) || ~((m <= 8.2e-8))) tmp = (k ^ m) * a; else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -3.2e-7], N[Not[LessEqual[m, 8.2e-8]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.2 \cdot 10^{-7} \lor \neg \left(m \leq 8.2 \cdot 10^{-8}\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -3.2000000000000001e-7 or 8.20000000000000063e-8 < m Initial program 86.4%
associate-*r/86.4%
*-commutative86.4%
associate-+l+86.4%
+-commutative86.4%
distribute-rgt-out86.4%
fma-def86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in k around 0 100.0%
if -3.2000000000000001e-7 < m < 8.20000000000000063e-8Initial program 93.8%
associate-*r/93.8%
*-commutative93.8%
associate-+l+93.8%
+-commutative93.8%
distribute-rgt-out93.8%
fma-def93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in m around 0 91.9%
Final simplification97.0%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (/ 1.0 k) (/ a k))))
(if (<= k -1.18e+111)
t_0
(if (<= k -9e-132)
(* a (* k -10.0))
(if (or (<= k 7e-309) (not (<= k 0.0042))) t_0 a)))))
double code(double a, double k, double m) {
double t_0 = (1.0 / k) * (a / k);
double tmp;
if (k <= -1.18e+111) {
tmp = t_0;
} else if (k <= -9e-132) {
tmp = a * (k * -10.0);
} else if ((k <= 7e-309) || !(k <= 0.0042)) {
tmp = t_0;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 / k) * (a / k)
if (k <= (-1.18d+111)) then
tmp = t_0
else if (k <= (-9d-132)) then
tmp = a * (k * (-10.0d0))
else if ((k <= 7d-309) .or. (.not. (k <= 0.0042d0))) then
tmp = t_0
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = (1.0 / k) * (a / k);
double tmp;
if (k <= -1.18e+111) {
tmp = t_0;
} else if (k <= -9e-132) {
tmp = a * (k * -10.0);
} else if ((k <= 7e-309) || !(k <= 0.0042)) {
tmp = t_0;
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): t_0 = (1.0 / k) * (a / k) tmp = 0 if k <= -1.18e+111: tmp = t_0 elif k <= -9e-132: tmp = a * (k * -10.0) elif (k <= 7e-309) or not (k <= 0.0042): tmp = t_0 else: tmp = a return tmp
function code(a, k, m) t_0 = Float64(Float64(1.0 / k) * Float64(a / k)) tmp = 0.0 if (k <= -1.18e+111) tmp = t_0; elseif (k <= -9e-132) tmp = Float64(a * Float64(k * -10.0)); elseif ((k <= 7e-309) || !(k <= 0.0042)) tmp = t_0; else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (1.0 / k) * (a / k); tmp = 0.0; if (k <= -1.18e+111) tmp = t_0; elseif (k <= -9e-132) tmp = a * (k * -10.0); elseif ((k <= 7e-309) || ~((k <= 0.0042))) tmp = t_0; else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.18e+111], t$95$0, If[LessEqual[k, -9e-132], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[k, 7e-309], N[Not[LessEqual[k, 0.0042]], $MachinePrecision]], t$95$0, a]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{k} \cdot \frac{a}{k}\\
\mathbf{if}\;k \leq -1.18 \cdot 10^{+111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq -9 \cdot 10^{-132}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 7 \cdot 10^{-309} \lor \neg \left(k \leq 0.0042\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -1.1799999999999999e111 or -8.9999999999999999e-132 < k < 6.9999999999999984e-309 or 0.00419999999999999974 < k Initial program 79.7%
associate-*r/79.7%
*-commutative79.7%
associate-+l+79.7%
+-commutative79.7%
distribute-rgt-out79.7%
fma-def79.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in m around 0 51.4%
Taylor expanded in k around inf 56.9%
*-un-lft-identity56.9%
unpow256.9%
times-frac57.0%
Applied egg-rr57.0%
if -1.1799999999999999e111 < k < -8.9999999999999999e-132Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 9.7%
Taylor expanded in k around inf 15.3%
*-commutative15.3%
*-commutative15.3%
*-commutative15.3%
associate-*r*15.4%
Simplified15.4%
if 6.9999999999999984e-309 < k < 0.00419999999999999974Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 56.8%
Taylor expanded in k around 0 55.4%
Final simplification51.1%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (/ 1.0 k) (/ a k))))
(if (<= k -1.2e+111)
t_0
(if (<= k -2.85e-139)
(* a (* k -10.0))
(if (or (<= k -1e-310) (not (<= k 0.0036)))
t_0
(+ a (* -10.0 (* k a))))))))
double code(double a, double k, double m) {
double t_0 = (1.0 / k) * (a / k);
double tmp;
if (k <= -1.2e+111) {
tmp = t_0;
} else if (k <= -2.85e-139) {
tmp = a * (k * -10.0);
} else if ((k <= -1e-310) || !(k <= 0.0036)) {
tmp = t_0;
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 / k) * (a / k)
if (k <= (-1.2d+111)) then
tmp = t_0
else if (k <= (-2.85d-139)) then
tmp = a * (k * (-10.0d0))
else if ((k <= (-1d-310)) .or. (.not. (k <= 0.0036d0))) then
tmp = t_0
else
tmp = a + ((-10.0d0) * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = (1.0 / k) * (a / k);
double tmp;
if (k <= -1.2e+111) {
tmp = t_0;
} else if (k <= -2.85e-139) {
tmp = a * (k * -10.0);
} else if ((k <= -1e-310) || !(k <= 0.0036)) {
tmp = t_0;
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
def code(a, k, m): t_0 = (1.0 / k) * (a / k) tmp = 0 if k <= -1.2e+111: tmp = t_0 elif k <= -2.85e-139: tmp = a * (k * -10.0) elif (k <= -1e-310) or not (k <= 0.0036): tmp = t_0 else: tmp = a + (-10.0 * (k * a)) return tmp
function code(a, k, m) t_0 = Float64(Float64(1.0 / k) * Float64(a / k)) tmp = 0.0 if (k <= -1.2e+111) tmp = t_0; elseif (k <= -2.85e-139) tmp = Float64(a * Float64(k * -10.0)); elseif ((k <= -1e-310) || !(k <= 0.0036)) tmp = t_0; else tmp = Float64(a + Float64(-10.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (1.0 / k) * (a / k); tmp = 0.0; if (k <= -1.2e+111) tmp = t_0; elseif (k <= -2.85e-139) tmp = a * (k * -10.0); elseif ((k <= -1e-310) || ~((k <= 0.0036))) tmp = t_0; else tmp = a + (-10.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.2e+111], t$95$0, If[LessEqual[k, -2.85e-139], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[k, -1e-310], N[Not[LessEqual[k, 0.0036]], $MachinePrecision]], t$95$0, N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{k} \cdot \frac{a}{k}\\
\mathbf{if}\;k \leq -1.2 \cdot 10^{+111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq -2.85 \cdot 10^{-139}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq -1 \cdot 10^{-310} \lor \neg \left(k \leq 0.0036\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if k < -1.20000000000000003e111 or -2.8499999999999999e-139 < k < -9.999999999999969e-311 or 0.0035999999999999999 < k Initial program 79.7%
associate-*r/79.7%
*-commutative79.7%
associate-+l+79.7%
+-commutative79.7%
distribute-rgt-out79.7%
fma-def79.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in m around 0 51.4%
Taylor expanded in k around inf 56.9%
*-un-lft-identity56.9%
unpow256.9%
times-frac57.0%
Applied egg-rr57.0%
if -1.20000000000000003e111 < k < -2.8499999999999999e-139Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 9.7%
Taylor expanded in k around inf 15.3%
*-commutative15.3%
*-commutative15.3%
*-commutative15.3%
associate-*r*15.4%
Simplified15.4%
if -9.999999999999969e-311 < k < 0.0035999999999999999Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 56.8%
Taylor expanded in k around 0 56.4%
Final simplification51.4%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (/ 1.0 k) (/ a k))))
(if (<= k -1.35e+111)
t_0
(if (<= k -8.2e-132)
(* a (* k -10.0))
(if (<= k -1e-310)
t_0
(if (<= k 0.0042) (+ a (* -10.0 (* k a))) (/ 1.0 (* k (/ k a)))))))))
double code(double a, double k, double m) {
double t_0 = (1.0 / k) * (a / k);
double tmp;
if (k <= -1.35e+111) {
tmp = t_0;
} else if (k <= -8.2e-132) {
tmp = a * (k * -10.0);
} else if (k <= -1e-310) {
tmp = t_0;
} else if (k <= 0.0042) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 / k) * (a / k)
if (k <= (-1.35d+111)) then
tmp = t_0
else if (k <= (-8.2d-132)) then
tmp = a * (k * (-10.0d0))
else if (k <= (-1d-310)) then
tmp = t_0
else if (k <= 0.0042d0) then
tmp = a + ((-10.0d0) * (k * a))
else
tmp = 1.0d0 / (k * (k / a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = (1.0 / k) * (a / k);
double tmp;
if (k <= -1.35e+111) {
tmp = t_0;
} else if (k <= -8.2e-132) {
tmp = a * (k * -10.0);
} else if (k <= -1e-310) {
tmp = t_0;
} else if (k <= 0.0042) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
def code(a, k, m): t_0 = (1.0 / k) * (a / k) tmp = 0 if k <= -1.35e+111: tmp = t_0 elif k <= -8.2e-132: tmp = a * (k * -10.0) elif k <= -1e-310: tmp = t_0 elif k <= 0.0042: tmp = a + (-10.0 * (k * a)) else: tmp = 1.0 / (k * (k / a)) return tmp
function code(a, k, m) t_0 = Float64(Float64(1.0 / k) * Float64(a / k)) tmp = 0.0 if (k <= -1.35e+111) tmp = t_0; elseif (k <= -8.2e-132) tmp = Float64(a * Float64(k * -10.0)); elseif (k <= -1e-310) tmp = t_0; elseif (k <= 0.0042) tmp = Float64(a + Float64(-10.0 * Float64(k * a))); else tmp = Float64(1.0 / Float64(k * Float64(k / a))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (1.0 / k) * (a / k); tmp = 0.0; if (k <= -1.35e+111) tmp = t_0; elseif (k <= -8.2e-132) tmp = a * (k * -10.0); elseif (k <= -1e-310) tmp = t_0; elseif (k <= 0.0042) tmp = a + (-10.0 * (k * a)); else tmp = 1.0 / (k * (k / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.35e+111], t$95$0, If[LessEqual[k, -8.2e-132], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -1e-310], t$95$0, If[LessEqual[k, 0.0042], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{k} \cdot \frac{a}{k}\\
\mathbf{if}\;k \leq -1.35 \cdot 10^{+111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq -8.2 \cdot 10^{-132}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 0.0042:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a}}\\
\end{array}
\end{array}
if k < -1.3499999999999999e111 or -8.20000000000000013e-132 < k < -9.999999999999969e-311Initial program 94.9%
associate-*r/94.9%
*-commutative94.9%
associate-+l+94.9%
+-commutative94.9%
distribute-rgt-out94.9%
fma-def94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in m around 0 43.8%
Taylor expanded in k around inf 65.2%
*-un-lft-identity65.2%
unpow265.2%
times-frac58.1%
Applied egg-rr58.1%
if -1.3499999999999999e111 < k < -8.20000000000000013e-132Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 9.7%
Taylor expanded in k around inf 15.3%
*-commutative15.3%
*-commutative15.3%
*-commutative15.3%
associate-*r*15.4%
Simplified15.4%
if -9.999999999999969e-311 < k < 0.00419999999999999974Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 56.8%
Taylor expanded in k around 0 56.4%
if 0.00419999999999999974 < k Initial program 73.7%
associate-*r/73.6%
*-commutative73.6%
associate-+l+73.6%
+-commutative73.6%
distribute-rgt-out73.6%
fma-def73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in m around 0 54.4%
Taylor expanded in k around inf 53.6%
*-un-lft-identity53.6%
unpow253.6%
times-frac56.6%
Applied egg-rr56.6%
associate-*l/56.6%
associate-/l*56.6%
associate-/l*53.6%
unpow253.6%
Simplified53.6%
div-inv53.6%
unpow253.6%
associate-*l*56.5%
div-inv56.6%
Applied egg-rr56.6%
Final simplification51.4%
(FPCore (a k m)
:precision binary64
(if (<= k -1.35e+111)
(/ a (* k (+ k 10.0)))
(if (<= k -4.4e-132)
(* a (* k -10.0))
(if (<= k -1e-310)
(* (/ 1.0 k) (/ a k))
(if (<= k 0.0042) (+ a (* -10.0 (* k a))) (/ 1.0 (* k (/ k a))))))))
double code(double a, double k, double m) {
double tmp;
if (k <= -1.35e+111) {
tmp = a / (k * (k + 10.0));
} else if (k <= -4.4e-132) {
tmp = a * (k * -10.0);
} else if (k <= -1e-310) {
tmp = (1.0 / k) * (a / k);
} else if (k <= 0.0042) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= (-1.35d+111)) then
tmp = a / (k * (k + 10.0d0))
else if (k <= (-4.4d-132)) then
tmp = a * (k * (-10.0d0))
else if (k <= (-1d-310)) then
tmp = (1.0d0 / k) * (a / k)
else if (k <= 0.0042d0) then
tmp = a + ((-10.0d0) * (k * a))
else
tmp = 1.0d0 / (k * (k / a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -1.35e+111) {
tmp = a / (k * (k + 10.0));
} else if (k <= -4.4e-132) {
tmp = a * (k * -10.0);
} else if (k <= -1e-310) {
tmp = (1.0 / k) * (a / k);
} else if (k <= 0.0042) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -1.35e+111: tmp = a / (k * (k + 10.0)) elif k <= -4.4e-132: tmp = a * (k * -10.0) elif k <= -1e-310: tmp = (1.0 / k) * (a / k) elif k <= 0.0042: tmp = a + (-10.0 * (k * a)) else: tmp = 1.0 / (k * (k / a)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -1.35e+111) tmp = Float64(a / Float64(k * Float64(k + 10.0))); elseif (k <= -4.4e-132) tmp = Float64(a * Float64(k * -10.0)); elseif (k <= -1e-310) tmp = Float64(Float64(1.0 / k) * Float64(a / k)); elseif (k <= 0.0042) tmp = Float64(a + Float64(-10.0 * Float64(k * a))); else tmp = Float64(1.0 / Float64(k * Float64(k / a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -1.35e+111) tmp = a / (k * (k + 10.0)); elseif (k <= -4.4e-132) tmp = a * (k * -10.0); elseif (k <= -1e-310) tmp = (1.0 / k) * (a / k); elseif (k <= 0.0042) tmp = a + (-10.0 * (k * a)); else tmp = 1.0 / (k * (k / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -1.35e+111], N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -4.4e-132], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -1e-310], N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.0042], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -1.35 \cdot 10^{+111}:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;k \leq -4.4 \cdot 10^{-132}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a}{k}\\
\mathbf{elif}\;k \leq 0.0042:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a}}\\
\end{array}
\end{array}
if k < -1.3499999999999999e111Initial program 92.0%
associate-*r/92.0%
*-commutative92.0%
associate-+l+92.0%
+-commutative92.0%
distribute-rgt-out92.0%
fma-def92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in m around 0 65.4%
Taylor expanded in k around inf 65.4%
+-commutative65.4%
unpow265.4%
distribute-rgt-in65.4%
Simplified65.4%
if -1.3499999999999999e111 < k < -4.39999999999999981e-132Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 9.7%
Taylor expanded in k around inf 15.3%
*-commutative15.3%
*-commutative15.3%
*-commutative15.3%
associate-*r*15.4%
Simplified15.4%
if -4.39999999999999981e-132 < k < -9.999999999999969e-311Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 5.4%
Taylor expanded in k around inf 64.8%
*-un-lft-identity64.8%
unpow264.8%
times-frac64.9%
Applied egg-rr64.9%
if -9.999999999999969e-311 < k < 0.00419999999999999974Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 56.8%
Taylor expanded in k around 0 56.4%
if 0.00419999999999999974 < k Initial program 73.7%
associate-*r/73.6%
*-commutative73.6%
associate-+l+73.6%
+-commutative73.6%
distribute-rgt-out73.6%
fma-def73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in m around 0 54.4%
Taylor expanded in k around inf 53.6%
*-un-lft-identity53.6%
unpow253.6%
times-frac56.6%
Applied egg-rr56.6%
associate-*l/56.6%
associate-/l*56.6%
associate-/l*53.6%
unpow253.6%
Simplified53.6%
div-inv53.6%
unpow253.6%
associate-*l*56.5%
div-inv56.6%
Applied egg-rr56.6%
Final simplification52.5%
(FPCore (a k m)
:precision binary64
(if (<= k -1.12e+111)
(/ a (* k (+ k 10.0)))
(if (<= k -3.6e-132)
(* a (* k -10.0))
(if (<= k 2e-309)
(* (/ 1.0 k) (/ a k))
(if (<= k 0.0042) (/ a (+ 1.0 (* k 10.0))) (/ 1.0 (* k (/ k a))))))))
double code(double a, double k, double m) {
double tmp;
if (k <= -1.12e+111) {
tmp = a / (k * (k + 10.0));
} else if (k <= -3.6e-132) {
tmp = a * (k * -10.0);
} else if (k <= 2e-309) {
tmp = (1.0 / k) * (a / k);
} else if (k <= 0.0042) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= (-1.12d+111)) then
tmp = a / (k * (k + 10.0d0))
else if (k <= (-3.6d-132)) then
tmp = a * (k * (-10.0d0))
else if (k <= 2d-309) then
tmp = (1.0d0 / k) * (a / k)
else if (k <= 0.0042d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = 1.0d0 / (k * (k / a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -1.12e+111) {
tmp = a / (k * (k + 10.0));
} else if (k <= -3.6e-132) {
tmp = a * (k * -10.0);
} else if (k <= 2e-309) {
tmp = (1.0 / k) * (a / k);
} else if (k <= 0.0042) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -1.12e+111: tmp = a / (k * (k + 10.0)) elif k <= -3.6e-132: tmp = a * (k * -10.0) elif k <= 2e-309: tmp = (1.0 / k) * (a / k) elif k <= 0.0042: tmp = a / (1.0 + (k * 10.0)) else: tmp = 1.0 / (k * (k / a)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -1.12e+111) tmp = Float64(a / Float64(k * Float64(k + 10.0))); elseif (k <= -3.6e-132) tmp = Float64(a * Float64(k * -10.0)); elseif (k <= 2e-309) tmp = Float64(Float64(1.0 / k) * Float64(a / k)); elseif (k <= 0.0042) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(1.0 / Float64(k * Float64(k / a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -1.12e+111) tmp = a / (k * (k + 10.0)); elseif (k <= -3.6e-132) tmp = a * (k * -10.0); elseif (k <= 2e-309) tmp = (1.0 / k) * (a / k); elseif (k <= 0.0042) tmp = a / (1.0 + (k * 10.0)); else tmp = 1.0 / (k * (k / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -1.12e+111], N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -3.6e-132], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2e-309], N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.0042], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -1.12 \cdot 10^{+111}:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;k \leq -3.6 \cdot 10^{-132}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 2 \cdot 10^{-309}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a}{k}\\
\mathbf{elif}\;k \leq 0.0042:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a}}\\
\end{array}
\end{array}
if k < -1.11999999999999995e111Initial program 92.0%
associate-*r/92.0%
*-commutative92.0%
associate-+l+92.0%
+-commutative92.0%
distribute-rgt-out92.0%
fma-def92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in m around 0 65.4%
Taylor expanded in k around inf 65.4%
+-commutative65.4%
unpow265.4%
distribute-rgt-in65.4%
Simplified65.4%
if -1.11999999999999995e111 < k < -3.60000000000000007e-132Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 9.7%
Taylor expanded in k around inf 15.3%
*-commutative15.3%
*-commutative15.3%
*-commutative15.3%
associate-*r*15.4%
Simplified15.4%
if -3.60000000000000007e-132 < k < 1.9999999999999988e-309Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 5.4%
Taylor expanded in k around inf 64.8%
*-un-lft-identity64.8%
unpow264.8%
times-frac64.9%
Applied egg-rr64.9%
if 1.9999999999999988e-309 < k < 0.00419999999999999974Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 56.8%
Taylor expanded in k around 0 56.5%
*-commutative56.5%
Simplified56.5%
if 0.00419999999999999974 < k Initial program 73.7%
associate-*r/73.6%
*-commutative73.6%
associate-+l+73.6%
+-commutative73.6%
distribute-rgt-out73.6%
fma-def73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in m around 0 54.4%
Taylor expanded in k around inf 53.6%
*-un-lft-identity53.6%
unpow253.6%
times-frac56.6%
Applied egg-rr56.6%
associate-*l/56.6%
associate-/l*56.6%
associate-/l*53.6%
unpow253.6%
Simplified53.6%
div-inv53.6%
unpow253.6%
associate-*l*56.5%
div-inv56.6%
Applied egg-rr56.6%
Final simplification52.6%
(FPCore (a k m)
:precision binary64
(if (<= k -1.85e+111)
(/ a (* k (+ k 10.0)))
(if (<= k -3.2e-134)
(* a (* k -10.0))
(if (<= k 4e-309)
(* (/ 1.0 k) (/ a k))
(if (<= k 0.0042) (/ a (+ 1.0 (* k 10.0))) (/ (/ a k) (+ k 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (k <= -1.85e+111) {
tmp = a / (k * (k + 10.0));
} else if (k <= -3.2e-134) {
tmp = a * (k * -10.0);
} else if (k <= 4e-309) {
tmp = (1.0 / k) * (a / k);
} else if (k <= 0.0042) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = (a / k) / (k + 10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= (-1.85d+111)) then
tmp = a / (k * (k + 10.0d0))
else if (k <= (-3.2d-134)) then
tmp = a * (k * (-10.0d0))
else if (k <= 4d-309) then
tmp = (1.0d0 / k) * (a / k)
else if (k <= 0.0042d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = (a / k) / (k + 10.0d0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -1.85e+111) {
tmp = a / (k * (k + 10.0));
} else if (k <= -3.2e-134) {
tmp = a * (k * -10.0);
} else if (k <= 4e-309) {
tmp = (1.0 / k) * (a / k);
} else if (k <= 0.0042) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = (a / k) / (k + 10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -1.85e+111: tmp = a / (k * (k + 10.0)) elif k <= -3.2e-134: tmp = a * (k * -10.0) elif k <= 4e-309: tmp = (1.0 / k) * (a / k) elif k <= 0.0042: tmp = a / (1.0 + (k * 10.0)) else: tmp = (a / k) / (k + 10.0) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -1.85e+111) tmp = Float64(a / Float64(k * Float64(k + 10.0))); elseif (k <= -3.2e-134) tmp = Float64(a * Float64(k * -10.0)); elseif (k <= 4e-309) tmp = Float64(Float64(1.0 / k) * Float64(a / k)); elseif (k <= 0.0042) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(Float64(a / k) / Float64(k + 10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -1.85e+111) tmp = a / (k * (k + 10.0)); elseif (k <= -3.2e-134) tmp = a * (k * -10.0); elseif (k <= 4e-309) tmp = (1.0 / k) * (a / k); elseif (k <= 0.0042) tmp = a / (1.0 + (k * 10.0)); else tmp = (a / k) / (k + 10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -1.85e+111], N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -3.2e-134], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4e-309], N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.0042], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] / N[(k + 10.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -1.85 \cdot 10^{+111}:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;k \leq -3.2 \cdot 10^{-134}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 4 \cdot 10^{-309}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a}{k}\\
\mathbf{elif}\;k \leq 0.0042:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k + 10}\\
\end{array}
\end{array}
if k < -1.8500000000000001e111Initial program 92.0%
associate-*r/92.0%
*-commutative92.0%
associate-+l+92.0%
+-commutative92.0%
distribute-rgt-out92.0%
fma-def92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in m around 0 65.4%
Taylor expanded in k around inf 65.4%
+-commutative65.4%
unpow265.4%
distribute-rgt-in65.4%
Simplified65.4%
if -1.8500000000000001e111 < k < -3.2000000000000001e-134Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around 0 9.7%
Taylor expanded in k around inf 15.3%
*-commutative15.3%
*-commutative15.3%
*-commutative15.3%
associate-*r*15.4%
Simplified15.4%
if -3.2000000000000001e-134 < k < 3.9999999999999977e-309Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 5.4%
Taylor expanded in k around inf 64.8%
*-un-lft-identity64.8%
unpow264.8%
times-frac64.9%
Applied egg-rr64.9%
if 3.9999999999999977e-309 < k < 0.00419999999999999974Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 56.8%
Taylor expanded in k around 0 56.5%
*-commutative56.5%
Simplified56.5%
if 0.00419999999999999974 < k Initial program 73.7%
associate-*r/73.6%
*-commutative73.6%
associate-+l+73.6%
+-commutative73.6%
distribute-rgt-out73.6%
fma-def73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in m around 0 54.4%
Taylor expanded in k around inf 54.3%
+-commutative54.3%
unpow254.3%
distribute-rgt-in54.3%
Simplified54.3%
Taylor expanded in a around 0 54.3%
+-commutative54.3%
associate-/r*57.4%
Simplified57.4%
Final simplification52.9%
(FPCore (a k m) :precision binary64 (if (<= m -1.2e+28) (* (/ 1.0 k) (/ a k)) (if (<= m 2.6e+24) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.2e+28) {
tmp = (1.0 / k) * (a / k);
} else if (m <= 2.6e+24) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-1.2d+28)) then
tmp = (1.0d0 / k) * (a / k)
else if (m <= 2.6d+24) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.2e+28) {
tmp = (1.0 / k) * (a / k);
} else if (m <= 2.6e+24) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.2e+28: tmp = (1.0 / k) * (a / k) elif m <= 2.6e+24: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.2e+28) tmp = Float64(Float64(1.0 / k) * Float64(a / k)); elseif (m <= 2.6e+24) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.2e+28) tmp = (1.0 / k) * (a / k); elseif (m <= 2.6e+24) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.2e+28], N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.6e+24], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.2 \cdot 10^{+28}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a}{k}\\
\mathbf{elif}\;m \leq 2.6 \cdot 10^{+24}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -1.19999999999999991e28Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 39.4%
Taylor expanded in k around inf 65.0%
*-un-lft-identity65.0%
unpow265.0%
times-frac57.4%
Applied egg-rr57.4%
if -1.19999999999999991e28 < m < 2.5999999999999998e24Initial program 93.6%
associate-*r/93.5%
*-commutative93.5%
associate-+l+93.5%
+-commutative93.5%
distribute-rgt-out93.5%
fma-def93.5%
+-commutative93.5%
Simplified93.5%
Taylor expanded in m around 0 84.9%
if 2.5999999999999998e24 < m Initial program 73.4%
associate-*r/73.4%
*-commutative73.4%
associate-+l+73.4%
+-commutative73.4%
distribute-rgt-out73.4%
fma-def73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 5.4%
Taylor expanded in k around inf 12.6%
*-commutative12.6%
*-commutative12.6%
*-commutative12.6%
associate-*r*12.6%
Simplified12.6%
Final simplification55.0%
(FPCore (a k m) :precision binary64 (if (<= m -0.19) (* a (/ 0.1 k)) (if (<= m 8.8e+27) a (* a (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.19) {
tmp = a * (0.1 / k);
} else if (m <= 8.8e+27) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.19d0)) then
tmp = a * (0.1d0 / k)
else if (m <= 8.8d+27) then
tmp = a
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.19) {
tmp = a * (0.1 / k);
} else if (m <= 8.8e+27) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.19: tmp = a * (0.1 / k) elif m <= 8.8e+27: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.19) tmp = Float64(a * Float64(0.1 / k)); elseif (m <= 8.8e+27) tmp = a; else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.19) tmp = a * (0.1 / k); elseif (m <= 8.8e+27) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.19], N[(a * N[(0.1 / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.8e+27], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.19:\\
\;\;\;\;a \cdot \frac{0.1}{k}\\
\mathbf{elif}\;m \leq 8.8 \cdot 10^{+27}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -0.19Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 40.3%
Taylor expanded in k around 0 17.6%
*-commutative17.6%
Simplified17.6%
Taylor expanded in k around inf 23.4%
*-commutative23.4%
Simplified23.4%
Taylor expanded in a around 0 23.4%
associate-*r/23.4%
associate-*l/23.4%
*-commutative23.4%
Simplified23.4%
if -0.19 < m < 8.7999999999999995e27Initial program 93.2%
associate-*r/93.1%
*-commutative93.1%
associate-+l+93.1%
+-commutative93.1%
distribute-rgt-out93.1%
fma-def93.1%
+-commutative93.1%
Simplified93.1%
Taylor expanded in m around 0 86.9%
Taylor expanded in k around 0 48.7%
if 8.7999999999999995e27 < m Initial program 73.4%
associate-*r/73.4%
*-commutative73.4%
associate-+l+73.4%
+-commutative73.4%
distribute-rgt-out73.4%
fma-def73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 5.4%
Taylor expanded in k around inf 12.6%
*-commutative12.6%
*-commutative12.6%
*-commutative12.6%
associate-*r*12.6%
Simplified12.6%
Final simplification30.0%
(FPCore (a k m) :precision binary64 (if (<= m -0.19) (/ 0.1 (/ k a)) (if (<= m 2.6e+24) a (* a (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.19) {
tmp = 0.1 / (k / a);
} else if (m <= 2.6e+24) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.19d0)) then
tmp = 0.1d0 / (k / a)
else if (m <= 2.6d+24) then
tmp = a
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.19) {
tmp = 0.1 / (k / a);
} else if (m <= 2.6e+24) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.19: tmp = 0.1 / (k / a) elif m <= 2.6e+24: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.19) tmp = Float64(0.1 / Float64(k / a)); elseif (m <= 2.6e+24) tmp = a; else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.19) tmp = 0.1 / (k / a); elseif (m <= 2.6e+24) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.19], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.6e+24], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.19:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{elif}\;m \leq 2.6 \cdot 10^{+24}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -0.19Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 40.3%
Taylor expanded in k around 0 17.6%
*-commutative17.6%
Simplified17.6%
Taylor expanded in k around inf 23.4%
*-commutative23.4%
Simplified23.4%
*-commutative23.4%
clear-num23.8%
un-div-inv23.8%
Applied egg-rr23.8%
if -0.19 < m < 2.5999999999999998e24Initial program 93.2%
associate-*r/93.1%
*-commutative93.1%
associate-+l+93.1%
+-commutative93.1%
distribute-rgt-out93.1%
fma-def93.1%
+-commutative93.1%
Simplified93.1%
Taylor expanded in m around 0 86.9%
Taylor expanded in k around 0 48.7%
if 2.5999999999999998e24 < m Initial program 73.4%
associate-*r/73.4%
*-commutative73.4%
associate-+l+73.4%
+-commutative73.4%
distribute-rgt-out73.4%
fma-def73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 5.4%
Taylor expanded in k around inf 12.6%
*-commutative12.6%
*-commutative12.6%
*-commutative12.6%
associate-*r*12.6%
Simplified12.6%
Final simplification30.1%
(FPCore (a k m) :precision binary64 (if (<= m 2.6e+24) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.6e+24) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.6d+24) then
tmp = a
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.6e+24) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.6e+24: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.6e+24) tmp = a; else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.6e+24) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.6e+24], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.6 \cdot 10^{+24}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 2.5999999999999998e24Initial program 96.1%
associate-*r/96.1%
*-commutative96.1%
associate-+l+96.1%
+-commutative96.1%
distribute-rgt-out96.1%
fma-def96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in m around 0 66.6%
Taylor expanded in k around 0 29.2%
if 2.5999999999999998e24 < m Initial program 73.4%
associate-*r/73.4%
*-commutative73.4%
associate-+l+73.4%
+-commutative73.4%
distribute-rgt-out73.4%
fma-def73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 5.4%
Taylor expanded in k around inf 12.6%
Final simplification24.1%
(FPCore (a k m) :precision binary64 (if (<= m 8e+24) a (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 8e+24) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 8d+24) then
tmp = a
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 8e+24) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 8e+24: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 8e+24) tmp = a; else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 8e+24) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 8e+24], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 8 \cdot 10^{+24}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 7.9999999999999999e24Initial program 96.1%
associate-*r/96.1%
*-commutative96.1%
associate-+l+96.1%
+-commutative96.1%
distribute-rgt-out96.1%
fma-def96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in m around 0 66.6%
Taylor expanded in k around 0 29.2%
if 7.9999999999999999e24 < m Initial program 73.4%
associate-*r/73.4%
*-commutative73.4%
associate-+l+73.4%
+-commutative73.4%
distribute-rgt-out73.4%
fma-def73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 5.4%
Taylor expanded in k around inf 12.6%
*-commutative12.6%
*-commutative12.6%
*-commutative12.6%
associate-*r*12.6%
Simplified12.6%
Final simplification24.1%
(FPCore (a k m) :precision binary64 a)
double code(double a, double k, double m) {
return a;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a
end function
public static double code(double a, double k, double m) {
return a;
}
def code(a, k, m): return a
function code(a, k, m) return a end
function tmp = code(a, k, m) tmp = a; end
code[a_, k_, m_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 89.1%
associate-*r/89.1%
*-commutative89.1%
associate-+l+89.1%
+-commutative89.1%
distribute-rgt-out89.1%
fma-def89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in m around 0 47.0%
Taylor expanded in k around 0 21.5%
Final simplification21.5%
herbie shell --seed 2023305
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))