
(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 19 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 (* a (pow k m))))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 5e+286)
(* a (/ (pow k m) (fma k (+ k 10.0) 1.0)))
t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+286) {
tmp = a * (pow(k, m) / fma(k, (k + 10.0), 1.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 5e+286) tmp = Float64(a * Float64((k ^ m) / fma(k, Float64(k + 10.0), 1.0))); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+286], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 5 \cdot 10^{+286}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{\mathsf{fma}\left(k, k + 10, 1\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))) < 5.0000000000000004e286Initial program 97.9%
associate-*r/98.0%
*-commutative98.0%
sqr-neg98.0%
associate-+l+98.0%
+-commutative98.0%
sqr-neg98.0%
distribute-rgt-out98.0%
fma-def98.0%
+-commutative98.0%
Simplified98.0%
if 5.0000000000000004e286 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 79.5%
associate-*r/79.5%
*-commutative79.5%
sqr-neg79.5%
associate-+l+79.5%
+-commutative79.5%
sqr-neg79.5%
distribute-rgt-out79.5%
fma-def79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in k around 0 59.1%
exp-to-pow100.0%
Simplified100.0%
Final simplification98.3%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 5e+286)
(/ t_0 (+ 1.0 (+ (* k k) (* k 10.0))))
t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+286) {
tmp = t_0 / (1.0 + ((k * k) + (k * 10.0)));
} 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 = a * (k ** m)
if ((t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))) <= 5d+286) then
tmp = t_0 / (1.0d0 + ((k * k) + (k * 10.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+286) {
tmp = t_0 / (1.0 + ((k * k) + (k * 10.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+286: tmp = t_0 / (1.0 + ((k * k) + (k * 10.0))) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 5e+286) tmp = Float64(t_0 / Float64(1.0 + Float64(Float64(k * k) + Float64(k * 10.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+286) tmp = t_0 / (1.0 + ((k * k) + (k * 10.0))); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+286], N[(t$95$0 / N[(1.0 + N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 5 \cdot 10^{+286}:\\
\;\;\;\;\frac{t_0}{1 + \left(k \cdot k + k \cdot 10\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))) < 5.0000000000000004e286Initial program 97.9%
sqr-neg97.9%
associate-+l+97.9%
*-commutative97.9%
sqr-neg97.9%
Simplified97.9%
if 5.0000000000000004e286 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 79.5%
associate-*r/79.5%
*-commutative79.5%
sqr-neg79.5%
associate-+l+79.5%
+-commutative79.5%
sqr-neg79.5%
distribute-rgt-out79.5%
fma-def79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in k around 0 59.1%
exp-to-pow100.0%
Simplified100.0%
Final simplification98.3%
(FPCore (a k m) :precision binary64 (if (<= m 6.6e-12) (/ (pow k m) (/ (+ 1.0 (* k (+ k 10.0))) a)) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 6.6e-12) {
tmp = pow(k, m) / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * pow(k, m);
}
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 <= 6.6d-12) then
tmp = (k ** m) / ((1.0d0 + (k * (k + 10.0d0))) / a)
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 6.6e-12) {
tmp = Math.pow(k, m) / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 6.6e-12: tmp = math.pow(k, m) / ((1.0 + (k * (k + 10.0))) / a) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 6.6e-12) tmp = Float64((k ^ m) / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / a)); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 6.6e-12) tmp = (k ^ m) / ((1.0 + (k * (k + 10.0))) / a); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 6.6e-12], N[(N[Power[k, m], $MachinePrecision] / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 6.6 \cdot 10^{-12}:\\
\;\;\;\;\frac{{k}^{m}}{\frac{1 + k \cdot \left(k + 10\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 6.6000000000000001e-12Initial program 97.4%
associate-*r/97.4%
*-commutative97.4%
sqr-neg97.4%
associate-+l+97.4%
+-commutative97.4%
sqr-neg97.4%
distribute-rgt-out97.4%
fma-def97.4%
+-commutative97.4%
Simplified97.4%
associate-*l/97.4%
fma-udef97.4%
+-commutative97.4%
distribute-lft-out97.4%
+-commutative97.4%
associate-/l*97.3%
+-commutative97.3%
distribute-lft-out97.3%
+-commutative97.3%
fma-udef97.3%
Applied egg-rr97.3%
fma-udef97.3%
Applied egg-rr97.3%
if 6.6000000000000001e-12 < m Initial program 90.0%
associate-*r/90.0%
*-commutative90.0%
sqr-neg90.0%
associate-+l+90.0%
+-commutative90.0%
sqr-neg90.0%
distribute-rgt-out90.0%
fma-def90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in k around 0 50.0%
exp-to-pow100.0%
Simplified100.0%
Final simplification98.3%
(FPCore (a k m) :precision binary64 (if (<= k 2.85e-5) (* (* a (pow k m)) (+ 1.0 (* k -10.0))) (* (/ (pow k m) k) (/ a k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 2.85e-5) {
tmp = (a * pow(k, m)) * (1.0 + (k * -10.0));
} else {
tmp = (pow(k, m) / k) * (a / k);
}
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 <= 2.85d-5) then
tmp = (a * (k ** m)) * (1.0d0 + (k * (-10.0d0)))
else
tmp = ((k ** m) / k) * (a / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 2.85e-5) {
tmp = (a * Math.pow(k, m)) * (1.0 + (k * -10.0));
} else {
tmp = (Math.pow(k, m) / k) * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 2.85e-5: tmp = (a * math.pow(k, m)) * (1.0 + (k * -10.0)) else: tmp = (math.pow(k, m) / k) * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 2.85e-5) tmp = Float64(Float64(a * (k ^ m)) * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(Float64((k ^ m) / k) * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 2.85e-5) tmp = (a * (k ^ m)) * (1.0 + (k * -10.0)); else tmp = ((k ^ m) / k) * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 2.85e-5], N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.85 \cdot 10^{-5}:\\
\;\;\;\;\left(a \cdot {k}^{m}\right) \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{k}^{m}}{k} \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 2.8500000000000002e-5Initial program 98.3%
associate-*r/98.3%
*-commutative98.3%
sqr-neg98.3%
associate-+l+98.3%
+-commutative98.3%
sqr-neg98.3%
distribute-rgt-out98.3%
fma-def98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in k around 0 39.8%
associate-*r*39.8%
exp-to-pow39.8%
exp-to-pow85.4%
distribute-lft1-in99.8%
metadata-eval99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
*-commutative99.8%
Simplified99.8%
if 2.8500000000000002e-5 < k Initial program 86.4%
associate-*r/86.4%
*-commutative86.4%
sqr-neg86.4%
associate-+l+86.4%
+-commutative86.4%
sqr-neg86.4%
distribute-rgt-out86.4%
fma-def86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in k around inf 84.5%
unpow284.5%
Simplified84.5%
Taylor expanded in k around 0 84.5%
exp-to-pow84.5%
unpow284.5%
times-frac94.1%
Simplified94.1%
Final simplification98.1%
(FPCore (a k m) :precision binary64 (if (<= k 2.85e-5) (* a (pow k m)) (* (/ (pow k m) k) (/ a k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 2.85e-5) {
tmp = a * pow(k, m);
} else {
tmp = (pow(k, m) / k) * (a / k);
}
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 <= 2.85d-5) then
tmp = a * (k ** m)
else
tmp = ((k ** m) / k) * (a / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 2.85e-5) {
tmp = a * Math.pow(k, m);
} else {
tmp = (Math.pow(k, m) / k) * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 2.85e-5: tmp = a * math.pow(k, m) else: tmp = (math.pow(k, m) / k) * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 2.85e-5) tmp = Float64(a * (k ^ m)); else tmp = Float64(Float64((k ^ m) / k) * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 2.85e-5) tmp = a * (k ^ m); else tmp = ((k ^ m) / k) * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 2.85e-5], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.85 \cdot 10^{-5}:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{{k}^{m}}{k} \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 2.8500000000000002e-5Initial program 98.3%
associate-*r/98.3%
*-commutative98.3%
sqr-neg98.3%
associate-+l+98.3%
+-commutative98.3%
sqr-neg98.3%
distribute-rgt-out98.3%
fma-def98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in k around 0 53.9%
exp-to-pow99.5%
Simplified99.5%
if 2.8500000000000002e-5 < k Initial program 86.4%
associate-*r/86.4%
*-commutative86.4%
sqr-neg86.4%
associate-+l+86.4%
+-commutative86.4%
sqr-neg86.4%
distribute-rgt-out86.4%
fma-def86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in k around inf 84.5%
unpow284.5%
Simplified84.5%
Taylor expanded in k around 0 84.5%
exp-to-pow84.5%
unpow284.5%
times-frac94.1%
Simplified94.1%
Final simplification97.9%
(FPCore (a k m) :precision binary64 (if (or (<= m -29000000000000.0) (not (<= m 6.6e-12))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -29000000000000.0) || !(m <= 6.6e-12)) {
tmp = a * pow(k, m);
} 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 <= (-29000000000000.0d0)) .or. (.not. (m <= 6.6d-12))) then
tmp = a * (k ** m)
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 <= -29000000000000.0) || !(m <= 6.6e-12)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -29000000000000.0) or not (m <= 6.6e-12): tmp = a * math.pow(k, m) else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -29000000000000.0) || !(m <= 6.6e-12)) tmp = Float64(a * (k ^ m)); 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 <= -29000000000000.0) || ~((m <= 6.6e-12))) tmp = a * (k ^ m); else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -29000000000000.0], N[Not[LessEqual[m, 6.6e-12]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $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 -29000000000000 \lor \neg \left(m \leq 6.6 \cdot 10^{-12}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.9e13 or 6.6000000000000001e-12 < m Initial program 94.7%
associate-*r/94.7%
*-commutative94.7%
sqr-neg94.7%
associate-+l+94.7%
+-commutative94.7%
sqr-neg94.7%
distribute-rgt-out94.7%
fma-def94.7%
+-commutative94.7%
Simplified94.7%
Taylor expanded in k around 0 51.5%
exp-to-pow100.0%
Simplified100.0%
if -2.9e13 < m < 6.6000000000000001e-12Initial program 95.0%
associate-*r/95.0%
*-commutative95.0%
sqr-neg95.0%
associate-+l+95.0%
+-commutative95.0%
sqr-neg95.0%
distribute-rgt-out95.0%
fma-def95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in m around 0 93.9%
Final simplification97.9%
(FPCore (a k m) :precision binary64 (if (<= k 2.85e-5) (* a (pow k m)) (* a (pow k (- m 2.0)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 2.85e-5) {
tmp = a * pow(k, m);
} else {
tmp = a * pow(k, (m - 2.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 <= 2.85d-5) then
tmp = a * (k ** m)
else
tmp = a * (k ** (m - 2.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 2.85e-5) {
tmp = a * Math.pow(k, m);
} else {
tmp = a * Math.pow(k, (m - 2.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 2.85e-5: tmp = a * math.pow(k, m) else: tmp = a * math.pow(k, (m - 2.0)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 2.85e-5) tmp = Float64(a * (k ^ m)); else tmp = Float64(a * (k ^ Float64(m - 2.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 2.85e-5) tmp = a * (k ^ m); else tmp = a * (k ^ (m - 2.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 2.85e-5], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m - 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.85 \cdot 10^{-5}:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\
\end{array}
\end{array}
if k < 2.8500000000000002e-5Initial program 98.3%
associate-*r/98.3%
*-commutative98.3%
sqr-neg98.3%
associate-+l+98.3%
+-commutative98.3%
sqr-neg98.3%
distribute-rgt-out98.3%
fma-def98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in k around 0 53.9%
exp-to-pow99.5%
Simplified99.5%
if 2.8500000000000002e-5 < k Initial program 86.4%
associate-*r/86.4%
*-commutative86.4%
sqr-neg86.4%
associate-+l+86.4%
+-commutative86.4%
sqr-neg86.4%
distribute-rgt-out86.4%
fma-def86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in k around inf 84.5%
unpow284.5%
Simplified84.5%
pow284.5%
metadata-eval84.5%
pow-div92.1%
metadata-eval92.1%
Applied egg-rr92.1%
Final simplification97.3%
(FPCore (a k m)
:precision binary64
(if (<= m -5.1e-8)
(* a (/ 1.0 (* k k)))
(if (<= m 6.6e-12)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m 9.5e+46)
(+ a (* a (+ (* k -10.0) (* k (* k 100.0)))))
(* -10.0 (* a k))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.1e-8) {
tmp = a * (1.0 / (k * k));
} else if (m <= 6.6e-12) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 9.5e+46) {
tmp = a + (a * ((k * -10.0) + (k * (k * 100.0))));
} else {
tmp = -10.0 * (a * k);
}
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 <= (-5.1d-8)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 6.6d-12) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= 9.5d+46) then
tmp = a + (a * ((k * (-10.0d0)) + (k * (k * 100.0d0))))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5.1e-8) {
tmp = a * (1.0 / (k * k));
} else if (m <= 6.6e-12) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 9.5e+46) {
tmp = a + (a * ((k * -10.0) + (k * (k * 100.0))));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.1e-8: tmp = a * (1.0 / (k * k)) elif m <= 6.6e-12: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= 9.5e+46: tmp = a + (a * ((k * -10.0) + (k * (k * 100.0)))) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.1e-8) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 6.6e-12) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= 9.5e+46) tmp = Float64(a + Float64(a * Float64(Float64(k * -10.0) + Float64(k * Float64(k * 100.0))))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5.1e-8) tmp = a * (1.0 / (k * k)); elseif (m <= 6.6e-12) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= 9.5e+46) tmp = a + (a * ((k * -10.0) + (k * (k * 100.0)))); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.1e-8], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 6.6e-12], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 9.5e+46], N[(a + N[(a * N[(N[(k * -10.0), $MachinePrecision] + N[(k * N[(k * 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.1 \cdot 10^{-8}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 6.6 \cdot 10^{-12}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 9.5 \cdot 10^{+46}:\\
\;\;\;\;a + a \cdot \left(k \cdot -10 + k \cdot \left(k \cdot 100\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -5.10000000000000001e-8Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in m around 0 56.2%
unpow256.2%
Simplified56.2%
if -5.10000000000000001e-8 < m < 6.6000000000000001e-12Initial program 94.8%
associate-*r/94.8%
*-commutative94.8%
sqr-neg94.8%
associate-+l+94.9%
+-commutative94.9%
sqr-neg94.9%
distribute-rgt-out94.9%
fma-def94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in m around 0 94.4%
if 6.6000000000000001e-12 < m < 9.5000000000000008e46Initial program 78.6%
associate-*r/78.6%
*-commutative78.6%
sqr-neg78.6%
associate-+l+78.6%
+-commutative78.6%
sqr-neg78.6%
distribute-rgt-out78.6%
fma-def78.6%
+-commutative78.6%
Simplified78.6%
Taylor expanded in m around 0 7.9%
Taylor expanded in k around 0 7.9%
*-commutative7.9%
Simplified7.9%
Taylor expanded in k around 0 29.0%
associate-*r*29.0%
unpow229.0%
associate-*r*29.0%
*-commutative29.0%
distribute-rgt-out43.2%
*-commutative43.2%
associate-*l*43.2%
Simplified43.2%
if 9.5000000000000008e46 < m Initial program 92.1%
associate-*r/92.1%
*-commutative92.1%
sqr-neg92.1%
associate-+l+92.1%
+-commutative92.1%
sqr-neg92.1%
distribute-rgt-out92.1%
fma-def92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in m around 0 3.6%
Taylor expanded in k around 0 4.9%
Taylor expanded in k around inf 25.4%
Final simplification58.9%
(FPCore (a k m)
:precision binary64
(if (<= k -2.05e-104)
(/ a (* k k))
(if (<= k -1.3e-260)
(* -10.0 (* a k))
(if (or (<= k 5.5e-291) (not (<= k 2.85e-5)))
(/ (/ a k) k)
(* a (+ 1.0 (* k -10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (k <= -2.05e-104) {
tmp = a / (k * k);
} else if (k <= -1.3e-260) {
tmp = -10.0 * (a * k);
} else if ((k <= 5.5e-291) || !(k <= 2.85e-5)) {
tmp = (a / k) / k;
} else {
tmp = a * (1.0 + (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 <= (-2.05d-104)) then
tmp = a / (k * k)
else if (k <= (-1.3d-260)) then
tmp = (-10.0d0) * (a * k)
else if ((k <= 5.5d-291) .or. (.not. (k <= 2.85d-5))) then
tmp = (a / k) / k
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -2.05e-104) {
tmp = a / (k * k);
} else if (k <= -1.3e-260) {
tmp = -10.0 * (a * k);
} else if ((k <= 5.5e-291) || !(k <= 2.85e-5)) {
tmp = (a / k) / k;
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -2.05e-104: tmp = a / (k * k) elif k <= -1.3e-260: tmp = -10.0 * (a * k) elif (k <= 5.5e-291) or not (k <= 2.85e-5): tmp = (a / k) / k else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -2.05e-104) tmp = Float64(a / Float64(k * k)); elseif (k <= -1.3e-260) tmp = Float64(-10.0 * Float64(a * k)); elseif ((k <= 5.5e-291) || !(k <= 2.85e-5)) tmp = Float64(Float64(a / k) / k); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -2.05e-104) tmp = a / (k * k); elseif (k <= -1.3e-260) tmp = -10.0 * (a * k); elseif ((k <= 5.5e-291) || ~((k <= 2.85e-5))) tmp = (a / k) / k; else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -2.05e-104], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -1.3e-260], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[k, 5.5e-291], N[Not[LessEqual[k, 2.85e-5]], $MachinePrecision]], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -2.05 \cdot 10^{-104}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq -1.3 \cdot 10^{-260}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\mathbf{elif}\;k \leq 5.5 \cdot 10^{-291} \lor \neg \left(k \leq 2.85 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if k < -2.04999999999999992e-104Initial program 95.0%
associate-*r/95.0%
*-commutative95.0%
sqr-neg95.0%
associate-+l+95.0%
+-commutative95.0%
sqr-neg95.0%
distribute-rgt-out95.0%
fma-def95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in m around 0 24.4%
Taylor expanded in k around inf 28.9%
unpow228.9%
Simplified28.9%
if -2.04999999999999992e-104 < k < -1.29999999999999997e-260Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.1%
Taylor expanded in k around 0 4.1%
Taylor expanded in k around inf 34.9%
if -1.29999999999999997e-260 < k < 5.5000000000000002e-291 or 2.8500000000000002e-5 < k Initial program 88.0%
associate-*r/88.0%
*-commutative88.0%
sqr-neg88.0%
associate-+l+88.0%
+-commutative88.0%
sqr-neg88.0%
distribute-rgt-out88.0%
fma-def88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in m around 0 56.7%
Taylor expanded in k around inf 60.5%
unpow260.5%
Simplified60.5%
Taylor expanded in a around 0 60.5%
unpow260.5%
associate-/r*62.4%
Simplified62.4%
if 5.5000000000000002e-291 < k < 2.8500000000000002e-5Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 49.0%
Taylor expanded in k around 0 48.6%
associate-*r*48.6%
distribute-rgt1-in48.6%
Applied egg-rr48.6%
Final simplification47.6%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* -10.0 (* a k))))
(if (<= k -2.3e-103)
(/ a (* k k))
(if (<= k -1.25e-260)
t_0
(if (or (<= k 6.2e-291) (not (<= k 2.85e-5)))
(/ 1.0 (* k (/ k a)))
(+ a t_0))))))
double code(double a, double k, double m) {
double t_0 = -10.0 * (a * k);
double tmp;
if (k <= -2.3e-103) {
tmp = a / (k * k);
} else if (k <= -1.25e-260) {
tmp = t_0;
} else if ((k <= 6.2e-291) || !(k <= 2.85e-5)) {
tmp = 1.0 / (k * (k / a));
} else {
tmp = a + 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 = (-10.0d0) * (a * k)
if (k <= (-2.3d-103)) then
tmp = a / (k * k)
else if (k <= (-1.25d-260)) then
tmp = t_0
else if ((k <= 6.2d-291) .or. (.not. (k <= 2.85d-5))) then
tmp = 1.0d0 / (k * (k / a))
else
tmp = a + t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = -10.0 * (a * k);
double tmp;
if (k <= -2.3e-103) {
tmp = a / (k * k);
} else if (k <= -1.25e-260) {
tmp = t_0;
} else if ((k <= 6.2e-291) || !(k <= 2.85e-5)) {
tmp = 1.0 / (k * (k / a));
} else {
tmp = a + t_0;
}
return tmp;
}
def code(a, k, m): t_0 = -10.0 * (a * k) tmp = 0 if k <= -2.3e-103: tmp = a / (k * k) elif k <= -1.25e-260: tmp = t_0 elif (k <= 6.2e-291) or not (k <= 2.85e-5): tmp = 1.0 / (k * (k / a)) else: tmp = a + t_0 return tmp
function code(a, k, m) t_0 = Float64(-10.0 * Float64(a * k)) tmp = 0.0 if (k <= -2.3e-103) tmp = Float64(a / Float64(k * k)); elseif (k <= -1.25e-260) tmp = t_0; elseif ((k <= 6.2e-291) || !(k <= 2.85e-5)) tmp = Float64(1.0 / Float64(k * Float64(k / a))); else tmp = Float64(a + t_0); end return tmp end
function tmp_2 = code(a, k, m) t_0 = -10.0 * (a * k); tmp = 0.0; if (k <= -2.3e-103) tmp = a / (k * k); elseif (k <= -1.25e-260) tmp = t_0; elseif ((k <= 6.2e-291) || ~((k <= 2.85e-5))) tmp = 1.0 / (k * (k / a)); else tmp = a + t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -2.3e-103], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -1.25e-260], t$95$0, If[Or[LessEqual[k, 6.2e-291], N[Not[LessEqual[k, 2.85e-5]], $MachinePrecision]], N[(1.0 / N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -10 \cdot \left(a \cdot k\right)\\
\mathbf{if}\;k \leq -2.3 \cdot 10^{-103}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq -1.25 \cdot 10^{-260}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 6.2 \cdot 10^{-291} \lor \neg \left(k \leq 2.85 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a}}\\
\mathbf{else}:\\
\;\;\;\;a + t_0\\
\end{array}
\end{array}
if k < -2.3000000000000001e-103Initial program 95.0%
associate-*r/95.0%
*-commutative95.0%
sqr-neg95.0%
associate-+l+95.0%
+-commutative95.0%
sqr-neg95.0%
distribute-rgt-out95.0%
fma-def95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in m around 0 24.4%
Taylor expanded in k around inf 28.9%
unpow228.9%
Simplified28.9%
if -2.3000000000000001e-103 < k < -1.2500000000000001e-260Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.1%
Taylor expanded in k around 0 4.1%
Taylor expanded in k around inf 34.9%
if -1.2500000000000001e-260 < k < 6.20000000000000023e-291 or 2.8500000000000002e-5 < k Initial program 88.0%
associate-*r/88.0%
*-commutative88.0%
sqr-neg88.0%
associate-+l+88.0%
+-commutative88.0%
sqr-neg88.0%
distribute-rgt-out88.0%
fma-def88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in k around inf 81.7%
unpow281.7%
Simplified81.7%
Taylor expanded in m around 0 60.5%
unpow260.5%
Simplified60.5%
associate-/r*60.5%
associate-*l/62.4%
associate-/r/62.4%
associate-/l/62.6%
Applied egg-rr62.6%
if 6.20000000000000023e-291 < k < 2.8500000000000002e-5Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 49.0%
Taylor expanded in k around 0 48.6%
Final simplification47.7%
(FPCore (a k m)
:precision binary64
(if (<= k -3.2e-99)
(/ a (* k k))
(if (<= k -5e-263)
(* -10.0 (* a k))
(if (<= k 5.5e-291)
(/ (/ a k) k)
(if (<= k 2.85e-5) (* a (+ 1.0 (* k -10.0))) (* (/ a k) (/ 1.0 k)))))))
double code(double a, double k, double m) {
double tmp;
if (k <= -3.2e-99) {
tmp = a / (k * k);
} else if (k <= -5e-263) {
tmp = -10.0 * (a * k);
} else if (k <= 5.5e-291) {
tmp = (a / k) / k;
} else if (k <= 2.85e-5) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = (a / k) * (1.0 / k);
}
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 <= (-3.2d-99)) then
tmp = a / (k * k)
else if (k <= (-5d-263)) then
tmp = (-10.0d0) * (a * k)
else if (k <= 5.5d-291) then
tmp = (a / k) / k
else if (k <= 2.85d-5) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = (a / k) * (1.0d0 / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -3.2e-99) {
tmp = a / (k * k);
} else if (k <= -5e-263) {
tmp = -10.0 * (a * k);
} else if (k <= 5.5e-291) {
tmp = (a / k) / k;
} else if (k <= 2.85e-5) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = (a / k) * (1.0 / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -3.2e-99: tmp = a / (k * k) elif k <= -5e-263: tmp = -10.0 * (a * k) elif k <= 5.5e-291: tmp = (a / k) / k elif k <= 2.85e-5: tmp = a * (1.0 + (k * -10.0)) else: tmp = (a / k) * (1.0 / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -3.2e-99) tmp = Float64(a / Float64(k * k)); elseif (k <= -5e-263) tmp = Float64(-10.0 * Float64(a * k)); elseif (k <= 5.5e-291) tmp = Float64(Float64(a / k) / k); elseif (k <= 2.85e-5) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(Float64(a / k) * Float64(1.0 / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -3.2e-99) tmp = a / (k * k); elseif (k <= -5e-263) tmp = -10.0 * (a * k); elseif (k <= 5.5e-291) tmp = (a / k) / k; elseif (k <= 2.85e-5) tmp = a * (1.0 + (k * -10.0)); else tmp = (a / k) * (1.0 / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -3.2e-99], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -5e-263], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 5.5e-291], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[k, 2.85e-5], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] * N[(1.0 / k), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -3.2 \cdot 10^{-99}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq -5 \cdot 10^{-263}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\mathbf{elif}\;k \leq 5.5 \cdot 10^{-291}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\mathbf{elif}\;k \leq 2.85 \cdot 10^{-5}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{1}{k}\\
\end{array}
\end{array}
if k < -3.2000000000000001e-99Initial program 95.0%
associate-*r/95.0%
*-commutative95.0%
sqr-neg95.0%
associate-+l+95.0%
+-commutative95.0%
sqr-neg95.0%
distribute-rgt-out95.0%
fma-def95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in m around 0 24.4%
Taylor expanded in k around inf 28.9%
unpow228.9%
Simplified28.9%
if -3.2000000000000001e-99 < k < -5.00000000000000006e-263Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.1%
Taylor expanded in k around 0 4.1%
Taylor expanded in k around inf 34.9%
if -5.00000000000000006e-263 < k < 5.5000000000000002e-291Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 13.8%
Taylor expanded in k around inf 60.9%
unpow260.9%
Simplified60.9%
Taylor expanded in a around 0 60.9%
unpow260.9%
associate-/r*60.9%
Simplified60.9%
if 5.5000000000000002e-291 < k < 2.8500000000000002e-5Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 49.0%
Taylor expanded in k around 0 48.6%
associate-*r*48.6%
distribute-rgt1-in48.6%
Applied egg-rr48.6%
if 2.8500000000000002e-5 < k Initial program 86.4%
associate-*r/86.4%
*-commutative86.4%
sqr-neg86.4%
associate-+l+86.4%
+-commutative86.4%
sqr-neg86.4%
distribute-rgt-out86.4%
fma-def86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in m around 0 62.3%
Taylor expanded in k around inf 60.4%
unpow260.4%
Simplified60.4%
associate-/r*62.6%
div-inv62.6%
Applied egg-rr62.6%
Final simplification47.6%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* -10.0 (* a k))))
(if (<= k -7e-101)
(/ a (* k k))
(if (<= k -5e-262)
t_0
(if (<= k 5.5e-291)
(/ (/ a k) k)
(if (<= k 2.85e-5) (+ a t_0) (* (/ a k) (/ 1.0 k))))))))
double code(double a, double k, double m) {
double t_0 = -10.0 * (a * k);
double tmp;
if (k <= -7e-101) {
tmp = a / (k * k);
} else if (k <= -5e-262) {
tmp = t_0;
} else if (k <= 5.5e-291) {
tmp = (a / k) / k;
} else if (k <= 2.85e-5) {
tmp = a + t_0;
} else {
tmp = (a / k) * (1.0 / k);
}
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 = (-10.0d0) * (a * k)
if (k <= (-7d-101)) then
tmp = a / (k * k)
else if (k <= (-5d-262)) then
tmp = t_0
else if (k <= 5.5d-291) then
tmp = (a / k) / k
else if (k <= 2.85d-5) then
tmp = a + t_0
else
tmp = (a / k) * (1.0d0 / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = -10.0 * (a * k);
double tmp;
if (k <= -7e-101) {
tmp = a / (k * k);
} else if (k <= -5e-262) {
tmp = t_0;
} else if (k <= 5.5e-291) {
tmp = (a / k) / k;
} else if (k <= 2.85e-5) {
tmp = a + t_0;
} else {
tmp = (a / k) * (1.0 / k);
}
return tmp;
}
def code(a, k, m): t_0 = -10.0 * (a * k) tmp = 0 if k <= -7e-101: tmp = a / (k * k) elif k <= -5e-262: tmp = t_0 elif k <= 5.5e-291: tmp = (a / k) / k elif k <= 2.85e-5: tmp = a + t_0 else: tmp = (a / k) * (1.0 / k) return tmp
function code(a, k, m) t_0 = Float64(-10.0 * Float64(a * k)) tmp = 0.0 if (k <= -7e-101) tmp = Float64(a / Float64(k * k)); elseif (k <= -5e-262) tmp = t_0; elseif (k <= 5.5e-291) tmp = Float64(Float64(a / k) / k); elseif (k <= 2.85e-5) tmp = Float64(a + t_0); else tmp = Float64(Float64(a / k) * Float64(1.0 / k)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = -10.0 * (a * k); tmp = 0.0; if (k <= -7e-101) tmp = a / (k * k); elseif (k <= -5e-262) tmp = t_0; elseif (k <= 5.5e-291) tmp = (a / k) / k; elseif (k <= 2.85e-5) tmp = a + t_0; else tmp = (a / k) * (1.0 / k); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -7e-101], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -5e-262], t$95$0, If[LessEqual[k, 5.5e-291], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[k, 2.85e-5], N[(a + t$95$0), $MachinePrecision], N[(N[(a / k), $MachinePrecision] * N[(1.0 / k), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -10 \cdot \left(a \cdot k\right)\\
\mathbf{if}\;k \leq -7 \cdot 10^{-101}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq -5 \cdot 10^{-262}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 5.5 \cdot 10^{-291}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\mathbf{elif}\;k \leq 2.85 \cdot 10^{-5}:\\
\;\;\;\;a + t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{1}{k}\\
\end{array}
\end{array}
if k < -6.99999999999999989e-101Initial program 95.0%
associate-*r/95.0%
*-commutative95.0%
sqr-neg95.0%
associate-+l+95.0%
+-commutative95.0%
sqr-neg95.0%
distribute-rgt-out95.0%
fma-def95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in m around 0 24.4%
Taylor expanded in k around inf 28.9%
unpow228.9%
Simplified28.9%
if -6.99999999999999989e-101 < k < -4.99999999999999992e-262Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.1%
Taylor expanded in k around 0 4.1%
Taylor expanded in k around inf 34.9%
if -4.99999999999999992e-262 < k < 5.5000000000000002e-291Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 13.8%
Taylor expanded in k around inf 60.9%
unpow260.9%
Simplified60.9%
Taylor expanded in a around 0 60.9%
unpow260.9%
associate-/r*60.9%
Simplified60.9%
if 5.5000000000000002e-291 < k < 2.8500000000000002e-5Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 49.0%
Taylor expanded in k around 0 48.6%
if 2.8500000000000002e-5 < k Initial program 86.4%
associate-*r/86.4%
*-commutative86.4%
sqr-neg86.4%
associate-+l+86.4%
+-commutative86.4%
sqr-neg86.4%
distribute-rgt-out86.4%
fma-def86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in m around 0 62.3%
Taylor expanded in k around inf 60.4%
unpow260.4%
Simplified60.4%
associate-/r*62.6%
div-inv62.6%
Applied egg-rr62.6%
Final simplification47.6%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k -8.6e-104)
t_0
(if (<= k -1.2e-263)
(* -10.0 (* a k))
(if (or (<= k 5.8e-291) (not (<= k 2.85e-5))) t_0 a)))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= -8.6e-104) {
tmp = t_0;
} else if (k <= -1.2e-263) {
tmp = -10.0 * (a * k);
} else if ((k <= 5.8e-291) || !(k <= 2.85e-5)) {
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 = a / (k * k)
if (k <= (-8.6d-104)) then
tmp = t_0
else if (k <= (-1.2d-263)) then
tmp = (-10.0d0) * (a * k)
else if ((k <= 5.8d-291) .or. (.not. (k <= 2.85d-5))) 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 = a / (k * k);
double tmp;
if (k <= -8.6e-104) {
tmp = t_0;
} else if (k <= -1.2e-263) {
tmp = -10.0 * (a * k);
} else if ((k <= 5.8e-291) || !(k <= 2.85e-5)) {
tmp = t_0;
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= -8.6e-104: tmp = t_0 elif k <= -1.2e-263: tmp = -10.0 * (a * k) elif (k <= 5.8e-291) or not (k <= 2.85e-5): tmp = t_0 else: tmp = a return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= -8.6e-104) tmp = t_0; elseif (k <= -1.2e-263) tmp = Float64(-10.0 * Float64(a * k)); elseif ((k <= 5.8e-291) || !(k <= 2.85e-5)) tmp = t_0; else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (k <= -8.6e-104) tmp = t_0; elseif (k <= -1.2e-263) tmp = -10.0 * (a * k); elseif ((k <= 5.8e-291) || ~((k <= 2.85e-5))) tmp = t_0; else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -8.6e-104], t$95$0, If[LessEqual[k, -1.2e-263], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[k, 5.8e-291], N[Not[LessEqual[k, 2.85e-5]], $MachinePrecision]], t$95$0, a]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq -8.6 \cdot 10^{-104}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq -1.2 \cdot 10^{-263}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\mathbf{elif}\;k \leq 5.8 \cdot 10^{-291} \lor \neg \left(k \leq 2.85 \cdot 10^{-5}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -8.6000000000000002e-104 or -1.2e-263 < k < 5.80000000000000003e-291 or 2.8500000000000002e-5 < k Initial program 90.9%
associate-*r/90.9%
*-commutative90.9%
sqr-neg90.9%
associate-+l+90.9%
+-commutative90.9%
sqr-neg90.9%
distribute-rgt-out90.9%
fma-def90.9%
+-commutative90.9%
Simplified90.9%
Taylor expanded in m around 0 43.4%
Taylor expanded in k around inf 47.5%
unpow247.5%
Simplified47.5%
if -8.6000000000000002e-104 < k < -1.2e-263Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.1%
Taylor expanded in k around 0 4.1%
Taylor expanded in k around inf 34.9%
if 5.80000000000000003e-291 < k < 2.8500000000000002e-5Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 49.0%
Taylor expanded in k around 0 47.9%
Final simplification46.7%
(FPCore (a k m)
:precision binary64
(if (<= k -2.8e-97)
(/ a (* k k))
(if (<= k -7.5e-262)
(* -10.0 (* a k))
(if (or (<= k 4.5e-291) (not (<= k 2.85e-5))) (/ (/ a k) k) a))))
double code(double a, double k, double m) {
double tmp;
if (k <= -2.8e-97) {
tmp = a / (k * k);
} else if (k <= -7.5e-262) {
tmp = -10.0 * (a * k);
} else if ((k <= 4.5e-291) || !(k <= 2.85e-5)) {
tmp = (a / k) / k;
} 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) :: tmp
if (k <= (-2.8d-97)) then
tmp = a / (k * k)
else if (k <= (-7.5d-262)) then
tmp = (-10.0d0) * (a * k)
else if ((k <= 4.5d-291) .or. (.not. (k <= 2.85d-5))) then
tmp = (a / k) / k
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -2.8e-97) {
tmp = a / (k * k);
} else if (k <= -7.5e-262) {
tmp = -10.0 * (a * k);
} else if ((k <= 4.5e-291) || !(k <= 2.85e-5)) {
tmp = (a / k) / k;
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -2.8e-97: tmp = a / (k * k) elif k <= -7.5e-262: tmp = -10.0 * (a * k) elif (k <= 4.5e-291) or not (k <= 2.85e-5): tmp = (a / k) / k else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if (k <= -2.8e-97) tmp = Float64(a / Float64(k * k)); elseif (k <= -7.5e-262) tmp = Float64(-10.0 * Float64(a * k)); elseif ((k <= 4.5e-291) || !(k <= 2.85e-5)) tmp = Float64(Float64(a / k) / k); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -2.8e-97) tmp = a / (k * k); elseif (k <= -7.5e-262) tmp = -10.0 * (a * k); elseif ((k <= 4.5e-291) || ~((k <= 2.85e-5))) tmp = (a / k) / k; else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -2.8e-97], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -7.5e-262], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[k, 4.5e-291], N[Not[LessEqual[k, 2.85e-5]], $MachinePrecision]], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], a]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -2.8 \cdot 10^{-97}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq -7.5 \cdot 10^{-262}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\mathbf{elif}\;k \leq 4.5 \cdot 10^{-291} \lor \neg \left(k \leq 2.85 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -2.8000000000000002e-97Initial program 95.0%
associate-*r/95.0%
*-commutative95.0%
sqr-neg95.0%
associate-+l+95.0%
+-commutative95.0%
sqr-neg95.0%
distribute-rgt-out95.0%
fma-def95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in m around 0 24.4%
Taylor expanded in k around inf 28.9%
unpow228.9%
Simplified28.9%
if -2.8000000000000002e-97 < k < -7.5000000000000002e-262Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.1%
Taylor expanded in k around 0 4.1%
Taylor expanded in k around inf 34.9%
if -7.5000000000000002e-262 < k < 4.49999999999999974e-291 or 2.8500000000000002e-5 < k Initial program 88.0%
associate-*r/88.0%
*-commutative88.0%
sqr-neg88.0%
associate-+l+88.0%
+-commutative88.0%
sqr-neg88.0%
distribute-rgt-out88.0%
fma-def88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in m around 0 56.7%
Taylor expanded in k around inf 60.5%
unpow260.5%
Simplified60.5%
Taylor expanded in a around 0 60.5%
unpow260.5%
associate-/r*62.4%
Simplified62.4%
if 4.49999999999999974e-291 < k < 2.8500000000000002e-5Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 49.0%
Taylor expanded in k around 0 47.9%
Final simplification47.4%
(FPCore (a k m) :precision binary64 (if (<= m -5.1e-8) (* a (/ 1.0 (* k k))) (if (<= m 8.2e+21) (/ a (+ 1.0 (* k (+ k 10.0)))) (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.1e-8) {
tmp = a * (1.0 / (k * k));
} else if (m <= 8.2e+21) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (a * k);
}
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 <= (-5.1d-8)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 8.2d+21) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5.1e-8) {
tmp = a * (1.0 / (k * k));
} else if (m <= 8.2e+21) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.1e-8: tmp = a * (1.0 / (k * k)) elif m <= 8.2e+21: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.1e-8) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 8.2e+21) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5.1e-8) tmp = a * (1.0 / (k * k)); elseif (m <= 8.2e+21) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.1e-8], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.2e+21], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.1 \cdot 10^{-8}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 8.2 \cdot 10^{+21}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -5.10000000000000001e-8Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in m around 0 56.2%
unpow256.2%
Simplified56.2%
if -5.10000000000000001e-8 < m < 8.2e21Initial program 93.1%
associate-*r/93.2%
*-commutative93.2%
sqr-neg93.2%
associate-+l+93.2%
+-commutative93.2%
sqr-neg93.2%
distribute-rgt-out93.2%
fma-def93.2%
+-commutative93.2%
Simplified93.2%
Taylor expanded in m around 0 86.3%
if 8.2e21 < m Initial program 91.4%
associate-*r/91.4%
*-commutative91.4%
sqr-neg91.4%
associate-+l+91.4%
+-commutative91.4%
sqr-neg91.4%
distribute-rgt-out91.4%
fma-def91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in m around 0 3.6%
Taylor expanded in k around 0 4.8%
Taylor expanded in k around inf 24.1%
Final simplification57.0%
(FPCore (a k m) :precision binary64 (if (<= m -4.5e-30) (/ a (* k k)) (if (<= m 8.2e+21) (/ a (+ 1.0 (* k 10.0))) (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4.5e-30) {
tmp = a / (k * k);
} else if (m <= 8.2e+21) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (a * k);
}
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.5d-30)) then
tmp = a / (k * k)
else if (m <= 8.2d+21) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -4.5e-30) {
tmp = a / (k * k);
} else if (m <= 8.2e+21) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4.5e-30: tmp = a / (k * k) elif m <= 8.2e+21: tmp = a / (1.0 + (k * 10.0)) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4.5e-30) tmp = Float64(a / Float64(k * k)); elseif (m <= 8.2e+21) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -4.5e-30) tmp = a / (k * k); elseif (m <= 8.2e+21) tmp = a / (1.0 + (k * 10.0)); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4.5e-30], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.2e+21], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 8.2 \cdot 10^{+21}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -4.49999999999999967e-30Initial program 99.9%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 33.2%
Taylor expanded in k around inf 56.4%
unpow256.4%
Simplified56.4%
if -4.49999999999999967e-30 < m < 8.2e21Initial program 93.0%
associate-*r/93.0%
*-commutative93.0%
sqr-neg93.0%
associate-+l+93.0%
+-commutative93.0%
sqr-neg93.0%
distribute-rgt-out93.0%
fma-def93.0%
+-commutative93.0%
Simplified93.0%
Taylor expanded in m around 0 86.3%
Taylor expanded in k around 0 64.8%
*-commutative64.8%
Simplified64.8%
if 8.2e21 < m Initial program 91.4%
associate-*r/91.4%
*-commutative91.4%
sqr-neg91.4%
associate-+l+91.4%
+-commutative91.4%
sqr-neg91.4%
distribute-rgt-out91.4%
fma-def91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in m around 0 3.6%
Taylor expanded in k around 0 4.8%
Taylor expanded in k around inf 24.1%
Final simplification49.2%
(FPCore (a k m) :precision binary64 (if (<= m -5.1e-8) (* a (/ 1.0 (* k k))) (if (<= m 8.2e+21) (/ a (+ 1.0 (* k k))) (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.1e-8) {
tmp = a * (1.0 / (k * k));
} else if (m <= 8.2e+21) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (a * k);
}
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 <= (-5.1d-8)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 8.2d+21) then
tmp = a / (1.0d0 + (k * k))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5.1e-8) {
tmp = a * (1.0 / (k * k));
} else if (m <= 8.2e+21) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.1e-8: tmp = a * (1.0 / (k * k)) elif m <= 8.2e+21: tmp = a / (1.0 + (k * k)) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.1e-8) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 8.2e+21) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5.1e-8) tmp = a * (1.0 / (k * k)); elseif (m <= 8.2e+21) tmp = a / (1.0 + (k * k)); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.1e-8], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.2e+21], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.1 \cdot 10^{-8}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 8.2 \cdot 10^{+21}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -5.10000000000000001e-8Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in m around 0 56.2%
unpow256.2%
Simplified56.2%
if -5.10000000000000001e-8 < m < 8.2e21Initial program 93.1%
associate-*r/93.2%
*-commutative93.2%
sqr-neg93.2%
associate-+l+93.2%
+-commutative93.2%
sqr-neg93.2%
distribute-rgt-out93.2%
fma-def93.2%
+-commutative93.2%
Simplified93.2%
Taylor expanded in m around 0 86.3%
Taylor expanded in k around inf 83.7%
unpow283.7%
Simplified83.7%
if 8.2e21 < m Initial program 91.4%
associate-*r/91.4%
*-commutative91.4%
sqr-neg91.4%
associate-+l+91.4%
+-commutative91.4%
sqr-neg91.4%
distribute-rgt-out91.4%
fma-def91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in m around 0 3.6%
Taylor expanded in k around 0 4.8%
Taylor expanded in k around inf 24.1%
Final simplification56.1%
(FPCore (a k m) :precision binary64 (if (<= m 8.2e+21) a (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 8.2e+21) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
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 <= 8.2d+21) then
tmp = a
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 8.2e+21) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 8.2e+21: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 8.2e+21) tmp = a; else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 8.2e+21) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 8.2e+21], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 8.2 \cdot 10^{+21}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 8.2e21Initial program 96.4%
associate-*r/96.4%
*-commutative96.4%
sqr-neg96.4%
associate-+l+96.4%
+-commutative96.4%
sqr-neg96.4%
distribute-rgt-out96.4%
fma-def96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in m around 0 60.5%
Taylor expanded in k around 0 27.5%
if 8.2e21 < m Initial program 91.4%
associate-*r/91.4%
*-commutative91.4%
sqr-neg91.4%
associate-+l+91.4%
+-commutative91.4%
sqr-neg91.4%
distribute-rgt-out91.4%
fma-def91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in m around 0 3.6%
Taylor expanded in k around 0 4.8%
Taylor expanded in k around inf 24.1%
Final simplification26.4%
(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 94.8%
associate-*r/94.8%
*-commutative94.8%
sqr-neg94.8%
associate-+l+94.8%
+-commutative94.8%
sqr-neg94.8%
distribute-rgt-out94.8%
fma-def94.8%
+-commutative94.8%
Simplified94.8%
Taylor expanded in m around 0 42.5%
Taylor expanded in k around 0 20.1%
Final simplification20.1%
herbie shell --seed 2023274
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))