
(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 13 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 (if (<= m 0.00048) (* (/ (pow k m) (fma k (+ k 10.0) 1.0)) a) (/ a (pow k (- 2.0 m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.00048) {
tmp = (pow(k, m) / fma(k, (k + 10.0), 1.0)) * a;
} else {
tmp = a / pow(k, (2.0 - m));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= 0.00048) tmp = Float64(Float64((k ^ m) / fma(k, Float64(k + 10.0), 1.0)) * a); else tmp = Float64(a / (k ^ Float64(2.0 - m))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, 0.00048], N[(N[(N[Power[k, m], $MachinePrecision] / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[(a / N[Power[k, N[(2.0 - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.00048:\\
\;\;\;\;\frac{{k}^{m}}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(2 - m\right)}}\\
\end{array}
\end{array}
if m < 4.80000000000000012e-4Initial program 96.1%
associate-*r/96.1%
*-commutative96.1%
sqr-neg96.1%
associate-+l+96.1%
+-commutative96.1%
sqr-neg96.1%
distribute-rgt-out96.1%
fma-def96.1%
+-commutative96.1%
Simplified96.1%
if 4.80000000000000012e-4 < m Initial program 72.6%
Taylor expanded in k around inf 47.6%
unpow247.6%
Simplified47.6%
expm1-log1p-u34.5%
expm1-udef34.5%
associate-/l*34.5%
pow234.5%
pow-div71.4%
Applied egg-rr71.4%
expm1-def71.4%
expm1-log1p100.0%
Simplified100.0%
Final simplification97.4%
(FPCore (a k m) :precision binary64 (if (<= m 0.00048) (/ (* (pow k m) a) (+ (+ 1.0 (* k 10.0)) (* k k))) (/ a (pow k (- 2.0 m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.00048) {
tmp = (pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = a / pow(k, (2.0 - 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 <= 0.00048d0) then
tmp = ((k ** m) * a) / ((1.0d0 + (k * 10.0d0)) + (k * k))
else
tmp = a / (k ** (2.0d0 - m))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.00048) {
tmp = (Math.pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = a / Math.pow(k, (2.0 - m));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.00048: tmp = (math.pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k)) else: tmp = a / math.pow(k, (2.0 - m)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.00048) tmp = Float64(Float64((k ^ m) * a) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))); else tmp = Float64(a / (k ^ Float64(2.0 - m))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.00048) tmp = ((k ^ m) * a) / ((1.0 + (k * 10.0)) + (k * k)); else tmp = a / (k ^ (2.0 - m)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.00048], N[(N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a / N[Power[k, N[(2.0 - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.00048:\\
\;\;\;\;\frac{{k}^{m} \cdot a}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(2 - m\right)}}\\
\end{array}
\end{array}
if m < 4.80000000000000012e-4Initial program 96.1%
if 4.80000000000000012e-4 < m Initial program 72.6%
Taylor expanded in k around inf 47.6%
unpow247.6%
Simplified47.6%
expm1-log1p-u34.5%
expm1-udef34.5%
associate-/l*34.5%
pow234.5%
pow-div71.4%
Applied egg-rr71.4%
expm1-def71.4%
expm1-log1p100.0%
Simplified100.0%
Final simplification97.3%
(FPCore (a k m) :precision binary64 (if (<= k 1.0) (* (pow k m) a) (* (/ a k) (/ (pow k m) k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = pow(k, m) * a;
} else {
tmp = (a / k) * (pow(k, m) / 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 <= 1.0d0) then
tmp = (k ** m) * a
else
tmp = (a / k) * ((k ** m) / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = Math.pow(k, m) * a;
} else {
tmp = (a / k) * (Math.pow(k, m) / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = math.pow(k, m) * a else: tmp = (a / k) * (math.pow(k, m) / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64((k ^ m) * a); else tmp = Float64(Float64(a / k) * Float64((k ^ m) / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.0) tmp = (k ^ m) * a; else tmp = (a / k) * ((k ^ m) / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.0], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(N[(a / k), $MachinePrecision] * N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{{k}^{m}}{k}\\
\end{array}
\end{array}
if k < 1Initial program 95.1%
associate-*r/95.1%
*-commutative95.1%
sqr-neg95.1%
associate-+l+95.1%
+-commutative95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
fma-def95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in k around 0 54.2%
exp-to-pow99.7%
Simplified99.7%
if 1 < k Initial program 76.1%
Taylor expanded in k around inf 75.3%
unpow275.3%
Simplified75.3%
Taylor expanded in a around 0 75.3%
exp-to-pow75.3%
*-commutative75.3%
unpow275.3%
times-frac92.5%
Simplified92.5%
Final simplification97.1%
(FPCore (a k m) :precision binary64 (if (or (<= m -2.85e-8) (not (<= m 0.0018))) (* (pow k m) a) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -2.85e-8) || !(m <= 0.0018)) {
tmp = pow(k, m) * a;
} else {
tmp = a * (1.0 / (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 <= (-2.85d-8)) .or. (.not. (m <= 0.0018d0))) then
tmp = (k ** m) * a
else
tmp = a * (1.0d0 / (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 <= -2.85e-8) || !(m <= 0.0018)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -2.85e-8) or not (m <= 0.0018): tmp = math.pow(k, m) * a else: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -2.85e-8) || !(m <= 0.0018)) tmp = Float64((k ^ m) * a); else tmp = Float64(a * Float64(1.0 / 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 <= -2.85e-8) || ~((m <= 0.0018))) tmp = (k ^ m) * a; else tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -2.85e-8], N[Not[LessEqual[m, 0.0018]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.85 \cdot 10^{-8} \lor \neg \left(m \leq 0.0018\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.85000000000000004e-8 or 0.0018 < m Initial program 86.7%
associate-*r/86.7%
*-commutative86.7%
sqr-neg86.7%
associate-+l+86.7%
+-commutative86.7%
sqr-neg86.7%
distribute-rgt-out86.7%
fma-def86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in k around 0 56.6%
exp-to-pow100.0%
Simplified100.0%
if -2.85000000000000004e-8 < m < 0.0018Initial program 91.8%
associate-*r/91.9%
*-commutative91.9%
sqr-neg91.9%
associate-+l+91.9%
+-commutative91.9%
sqr-neg91.9%
distribute-rgt-out91.9%
fma-def91.9%
+-commutative91.9%
Simplified91.9%
Taylor expanded in m around 0 90.5%
Final simplification96.9%
(FPCore (a k m) :precision binary64 (if (<= k 1.0) (* (pow k m) a) (/ a (pow k (- 2.0 m)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = pow(k, m) * a;
} else {
tmp = a / pow(k, (2.0 - 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 (k <= 1.0d0) then
tmp = (k ** m) * a
else
tmp = a / (k ** (2.0d0 - m))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a / Math.pow(k, (2.0 - m));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = math.pow(k, m) * a else: tmp = a / math.pow(k, (2.0 - m)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64((k ^ m) * a); else tmp = Float64(a / (k ^ Float64(2.0 - m))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.0) tmp = (k ^ m) * a; else tmp = a / (k ^ (2.0 - m)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.0], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[Power[k, N[(2.0 - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(2 - m\right)}}\\
\end{array}
\end{array}
if k < 1Initial program 95.1%
associate-*r/95.1%
*-commutative95.1%
sqr-neg95.1%
associate-+l+95.1%
+-commutative95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
fma-def95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in k around 0 54.2%
exp-to-pow99.7%
Simplified99.7%
if 1 < k Initial program 76.1%
Taylor expanded in k around inf 75.3%
unpow275.3%
Simplified75.3%
expm1-log1p-u68.7%
expm1-udef55.9%
associate-/l*55.9%
pow255.9%
pow-div61.4%
Applied egg-rr61.4%
expm1-def74.1%
expm1-log1p91.7%
Simplified91.7%
Final simplification96.8%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (+ 1.0 (* k 10.0)))))
(if (<= m -2.2e-10)
(* a (/ 1.0 (* k k)))
(if (<= m -2.2e-233)
t_0
(if (<= m 1.25e-182)
(* (/ a k) (/ 1.0 k))
(if (<= m 8.1e+34) t_0 (+ a (* -10.0 (* k a)))))))))
double code(double a, double k, double m) {
double t_0 = a / (1.0 + (k * 10.0));
double tmp;
if (m <= -2.2e-10) {
tmp = a * (1.0 / (k * k));
} else if (m <= -2.2e-233) {
tmp = t_0;
} else if (m <= 1.25e-182) {
tmp = (a / k) * (1.0 / k);
} else if (m <= 8.1e+34) {
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 = a / (1.0d0 + (k * 10.0d0))
if (m <= (-2.2d-10)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= (-2.2d-233)) then
tmp = t_0
else if (m <= 1.25d-182) then
tmp = (a / k) * (1.0d0 / k)
else if (m <= 8.1d+34) 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 = a / (1.0 + (k * 10.0));
double tmp;
if (m <= -2.2e-10) {
tmp = a * (1.0 / (k * k));
} else if (m <= -2.2e-233) {
tmp = t_0;
} else if (m <= 1.25e-182) {
tmp = (a / k) * (1.0 / k);
} else if (m <= 8.1e+34) {
tmp = t_0;
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
def code(a, k, m): t_0 = a / (1.0 + (k * 10.0)) tmp = 0 if m <= -2.2e-10: tmp = a * (1.0 / (k * k)) elif m <= -2.2e-233: tmp = t_0 elif m <= 1.25e-182: tmp = (a / k) * (1.0 / k) elif m <= 8.1e+34: tmp = t_0 else: tmp = a + (-10.0 * (k * a)) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(1.0 + Float64(k * 10.0))) tmp = 0.0 if (m <= -2.2e-10) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= -2.2e-233) tmp = t_0; elseif (m <= 1.25e-182) tmp = Float64(Float64(a / k) * Float64(1.0 / k)); elseif (m <= 8.1e+34) 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 = a / (1.0 + (k * 10.0)); tmp = 0.0; if (m <= -2.2e-10) tmp = a * (1.0 / (k * k)); elseif (m <= -2.2e-233) tmp = t_0; elseif (m <= 1.25e-182) tmp = (a / k) * (1.0 / k); elseif (m <= 8.1e+34) tmp = t_0; else tmp = a + (-10.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -2.2e-10], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -2.2e-233], t$95$0, If[LessEqual[m, 1.25e-182], N[(N[(a / k), $MachinePrecision] * N[(1.0 / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8.1e+34], t$95$0, N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{1 + k \cdot 10}\\
\mathbf{if}\;m \leq -2.2 \cdot 10^{-10}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq -2.2 \cdot 10^{-233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;m \leq 1.25 \cdot 10^{-182}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{1}{k}\\
\mathbf{elif}\;m \leq 8.1 \cdot 10^{+34}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -2.1999999999999999e-10Initial 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 38.1%
Taylor expanded in k around inf 66.4%
unpow266.4%
associate-/r*52.7%
Simplified52.7%
frac-2neg52.7%
associate-/l/66.4%
un-div-inv66.4%
*-commutative66.4%
add-sqr-sqrt32.1%
sqrt-unprod44.2%
sqr-neg44.2%
sqrt-unprod16.1%
add-sqr-sqrt35.7%
add-sqr-sqrt19.4%
sqrt-unprod60.7%
sqr-neg60.7%
sqrt-unprod41.3%
add-sqr-sqrt66.4%
Applied egg-rr66.4%
if -2.1999999999999999e-10 < m < -2.2e-233 or 1.25000000000000006e-182 < m < 8.1000000000000001e34Initial program 89.6%
associate-*r/89.6%
*-commutative89.6%
sqr-neg89.6%
associate-+l+89.6%
+-commutative89.6%
sqr-neg89.6%
distribute-rgt-out89.7%
fma-def89.7%
+-commutative89.7%
Simplified89.7%
Taylor expanded in m around 0 83.6%
Taylor expanded in k around 0 69.4%
*-commutative69.4%
Simplified69.4%
if -2.2e-233 < m < 1.25000000000000006e-182Initial program 87.5%
associate-*r/87.6%
*-commutative87.6%
sqr-neg87.6%
associate-+l+87.6%
+-commutative87.6%
sqr-neg87.6%
distribute-rgt-out87.6%
fma-def87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in m around 0 87.5%
Taylor expanded in k around inf 59.4%
unpow259.4%
Simplified59.4%
associate-/r*71.7%
div-inv71.8%
Applied egg-rr71.8%
if 8.1000000000000001e34 < m Initial program 74.0%
associate-*r/74.0%
*-commutative74.0%
sqr-neg74.0%
associate-+l+74.0%
+-commutative74.0%
sqr-neg74.0%
distribute-rgt-out74.0%
fma-def74.0%
+-commutative74.0%
Simplified74.0%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 11.6%
Final simplification51.2%
(FPCore (a k m)
:precision binary64
(if (<= m -900.0)
(/ a (* k k))
(if (<= m 6.4e+32)
(* a (/ 1.0 (+ 1.0 (* k (+ k 10.0)))))
(+ a (* -10.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -900.0) {
tmp = a / (k * k);
} else if (m <= 6.4e+32) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.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) :: tmp
if (m <= (-900.0d0)) then
tmp = a / (k * k)
else if (m <= 6.4d+32) then
tmp = a * (1.0d0 / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = a + ((-10.0d0) * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -900.0) {
tmp = a / (k * k);
} else if (m <= 6.4e+32) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -900.0: tmp = a / (k * k) elif m <= 6.4e+32: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) else: tmp = a + (-10.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -900.0) tmp = Float64(a / Float64(k * k)); elseif (m <= 6.4e+32) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a + Float64(-10.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -900.0) tmp = a / (k * k); elseif (m <= 6.4e+32) tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); else tmp = a + (-10.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -900.0], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 6.4e+32], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -900:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 6.4 \cdot 10^{+32}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -900Initial 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 37.2%
Taylor expanded in k around inf 66.9%
unpow266.9%
Simplified66.9%
if -900 < m < 6.3999999999999998e32Initial program 89.2%
associate-*r/89.3%
*-commutative89.3%
sqr-neg89.3%
associate-+l+89.3%
+-commutative89.3%
sqr-neg89.3%
distribute-rgt-out89.3%
fma-def89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in m around 0 84.3%
if 6.3999999999999998e32 < m Initial program 74.0%
associate-*r/74.0%
*-commutative74.0%
sqr-neg74.0%
associate-+l+74.0%
+-commutative74.0%
sqr-neg74.0%
distribute-rgt-out74.0%
fma-def74.0%
+-commutative74.0%
Simplified74.0%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 11.6%
Final simplification56.5%
(FPCore (a k m)
:precision binary64
(if (<= m -3.5e-46)
(* a (/ 1.0 (* k k)))
(if (<= m -1.3e-235)
a
(if (<= m 4.6e-164) (* (/ a k) (/ 1.0 k)) (+ a (* -10.0 (* k a)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.5e-46) {
tmp = a * (1.0 / (k * k));
} else if (m <= -1.3e-235) {
tmp = a;
} else if (m <= 4.6e-164) {
tmp = (a / k) * (1.0 / k);
} 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) :: tmp
if (m <= (-3.5d-46)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= (-1.3d-235)) then
tmp = a
else if (m <= 4.6d-164) then
tmp = (a / k) * (1.0d0 / k)
else
tmp = a + ((-10.0d0) * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -3.5e-46) {
tmp = a * (1.0 / (k * k));
} else if (m <= -1.3e-235) {
tmp = a;
} else if (m <= 4.6e-164) {
tmp = (a / k) * (1.0 / k);
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.5e-46: tmp = a * (1.0 / (k * k)) elif m <= -1.3e-235: tmp = a elif m <= 4.6e-164: tmp = (a / k) * (1.0 / k) else: tmp = a + (-10.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.5e-46) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= -1.3e-235) tmp = a; elseif (m <= 4.6e-164) tmp = Float64(Float64(a / k) * Float64(1.0 / k)); else tmp = Float64(a + Float64(-10.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.5e-46) tmp = a * (1.0 / (k * k)); elseif (m <= -1.3e-235) tmp = a; elseif (m <= 4.6e-164) tmp = (a / k) * (1.0 / k); else tmp = a + (-10.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.5e-46], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -1.3e-235], a, If[LessEqual[m, 4.6e-164], N[(N[(a / k), $MachinePrecision] * N[(1.0 / k), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.5 \cdot 10^{-46}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq -1.3 \cdot 10^{-235}:\\
\;\;\;\;a\\
\mathbf{elif}\;m \leq 4.6 \cdot 10^{-164}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{1}{k}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -3.5000000000000002e-46Initial 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 41.0%
Taylor expanded in k around inf 66.2%
unpow266.2%
associate-/r*53.2%
Simplified53.2%
frac-2neg53.2%
associate-/l/66.2%
un-div-inv66.2%
*-commutative66.2%
add-sqr-sqrt31.5%
sqrt-unprod45.0%
sqr-neg45.0%
sqrt-unprod17.3%
add-sqr-sqrt36.0%
add-sqr-sqrt18.4%
sqrt-unprod60.8%
sqr-neg60.8%
sqrt-unprod42.4%
add-sqr-sqrt66.2%
Applied egg-rr66.2%
if -3.5000000000000002e-46 < m < -1.3e-235Initial program 95.4%
associate-*r/95.4%
*-commutative95.4%
sqr-neg95.4%
associate-+l+95.4%
+-commutative95.4%
sqr-neg95.4%
distribute-rgt-out95.5%
fma-def95.5%
+-commutative95.5%
Simplified95.5%
Taylor expanded in k around 0 69.9%
exp-to-pow69.9%
Simplified69.9%
Taylor expanded in m around 0 69.9%
if -1.3e-235 < m < 4.59999999999999971e-164Initial program 87.9%
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 87.9%
Taylor expanded in k around inf 60.7%
unpow260.7%
Simplified60.7%
associate-/r*72.6%
div-inv72.7%
Applied egg-rr72.7%
if 4.59999999999999971e-164 < m Initial program 76.1%
associate-*r/76.1%
*-commutative76.1%
sqr-neg76.1%
associate-+l+76.1%
+-commutative76.1%
sqr-neg76.1%
distribute-rgt-out76.1%
fma-def76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in m around 0 20.4%
Taylor expanded in k around 0 22.0%
Final simplification49.4%
(FPCore (a k m) :precision binary64 (if (<= m -900.0) (/ a (* k k)) (if (<= m 7.5e+30) (/ a (+ 1.0 (* k (+ k 10.0)))) (+ a (* -10.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -900.0) {
tmp = a / (k * k);
} else if (m <= 7.5e+30) {
tmp = a / (1.0 + (k * (k + 10.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) :: tmp
if (m <= (-900.0d0)) then
tmp = a / (k * k)
else if (m <= 7.5d+30) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + ((-10.0d0) * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -900.0) {
tmp = a / (k * k);
} else if (m <= 7.5e+30) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -900.0: tmp = a / (k * k) elif m <= 7.5e+30: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (-10.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -900.0) tmp = Float64(a / Float64(k * k)); elseif (m <= 7.5e+30) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(-10.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -900.0) tmp = a / (k * k); elseif (m <= 7.5e+30) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (-10.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -900.0], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 7.5e+30], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -900:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 7.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -900Initial 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 37.2%
Taylor expanded in k around inf 66.9%
unpow266.9%
Simplified66.9%
if -900 < m < 7.49999999999999973e30Initial program 89.2%
associate-*r/89.3%
*-commutative89.3%
sqr-neg89.3%
associate-+l+89.3%
+-commutative89.3%
sqr-neg89.3%
distribute-rgt-out89.3%
fma-def89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in m around 0 84.3%
if 7.49999999999999973e30 < m Initial program 74.0%
associate-*r/74.0%
*-commutative74.0%
sqr-neg74.0%
associate-+l+74.0%
+-commutative74.0%
sqr-neg74.0%
distribute-rgt-out74.0%
fma-def74.0%
+-commutative74.0%
Simplified74.0%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 11.6%
Final simplification56.4%
(FPCore (a k m) :precision binary64 (if (<= m -900.0) (/ a (* k k)) (if (<= m 1.05e+30) (/ a (+ 1.0 (* k k))) (+ a (* -10.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -900.0) {
tmp = a / (k * k);
} else if (m <= 1.05e+30) {
tmp = a / (1.0 + (k * k));
} 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) :: tmp
if (m <= (-900.0d0)) then
tmp = a / (k * k)
else if (m <= 1.05d+30) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a + ((-10.0d0) * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -900.0) {
tmp = a / (k * k);
} else if (m <= 1.05e+30) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -900.0: tmp = a / (k * k) elif m <= 1.05e+30: tmp = a / (1.0 + (k * k)) else: tmp = a + (-10.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -900.0) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.05e+30) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a + Float64(-10.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -900.0) tmp = a / (k * k); elseif (m <= 1.05e+30) tmp = a / (1.0 + (k * k)); else tmp = a + (-10.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -900.0], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.05e+30], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -900:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.05 \cdot 10^{+30}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -900Initial 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 37.2%
Taylor expanded in k around inf 66.9%
unpow266.9%
Simplified66.9%
if -900 < m < 1.05e30Initial program 89.2%
associate-*r/89.3%
*-commutative89.3%
sqr-neg89.3%
associate-+l+89.3%
+-commutative89.3%
sqr-neg89.3%
distribute-rgt-out89.3%
fma-def89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in m around 0 84.3%
Taylor expanded in k around inf 82.9%
unpow282.9%
Simplified82.9%
if 1.05e30 < m Initial program 74.0%
associate-*r/74.0%
*-commutative74.0%
sqr-neg74.0%
associate-+l+74.0%
+-commutative74.0%
sqr-neg74.0%
distribute-rgt-out74.0%
fma-def74.0%
+-commutative74.0%
Simplified74.0%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 11.6%
Final simplification56.0%
(FPCore (a k m) :precision binary64 (if (or (<= k 6e-308) (not (<= k 1.0))) (/ a (* k k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= 6e-308) || !(k <= 1.0)) {
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 <= 6d-308) .or. (.not. (k <= 1.0d0))) 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 <= 6e-308) || !(k <= 1.0)) {
tmp = a / (k * k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 6e-308) or not (k <= 1.0): tmp = a / (k * k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 6e-308) || !(k <= 1.0)) tmp = Float64(a / Float64(k * k)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((k <= 6e-308) || ~((k <= 1.0))) tmp = a / (k * k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 6e-308], N[Not[LessEqual[k, 1.0]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6 \cdot 10^{-308} \lor \neg \left(k \leq 1\right):\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < 6.00000000000000044e-308 or 1 < k Initial program 82.2%
associate-*r/82.2%
*-commutative82.2%
sqr-neg82.2%
associate-+l+82.2%
+-commutative82.2%
sqr-neg82.2%
distribute-rgt-out82.2%
fma-def82.2%
+-commutative82.2%
Simplified82.2%
Taylor expanded in m around 0 40.9%
Taylor expanded in k around inf 43.8%
unpow243.8%
Simplified43.8%
if 6.00000000000000044e-308 < k < 1Initial 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 0 99.4%
exp-to-pow99.4%
Simplified99.4%
Taylor expanded in m around 0 48.1%
Final simplification45.3%
(FPCore (a k m) :precision binary64 (if (<= k 8e-308) (/ a (* k k)) (if (<= k 1.0) a (/ (/ a k) k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 8e-308) {
tmp = a / (k * k);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = (a / k) / 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 <= 8d-308) then
tmp = a / (k * k)
else if (k <= 1.0d0) then
tmp = a
else
tmp = (a / k) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 8e-308) {
tmp = a / (k * k);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 8e-308: tmp = a / (k * k) elif k <= 1.0: tmp = a else: tmp = (a / k) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= 8e-308) tmp = Float64(a / Float64(k * k)); elseif (k <= 1.0) tmp = a; else tmp = Float64(Float64(a / k) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 8e-308) tmp = a / (k * k); elseif (k <= 1.0) tmp = a; else tmp = (a / k) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 8e-308], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.0], a, N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 8 \cdot 10^{-308}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < 8.00000000000000026e-308Initial program 89.5%
associate-*r/89.5%
*-commutative89.5%
sqr-neg89.5%
associate-+l+89.5%
+-commutative89.5%
sqr-neg89.5%
distribute-rgt-out89.5%
fma-def89.5%
+-commutative89.5%
Simplified89.5%
Taylor expanded in m around 0 25.3%
Taylor expanded in k around inf 32.5%
unpow232.5%
Simplified32.5%
if 8.00000000000000026e-308 < k < 1Initial 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 0 99.4%
exp-to-pow99.4%
Simplified99.4%
Taylor expanded in m around 0 48.1%
if 1 < k Initial program 76.1%
associate-*r/76.1%
*-commutative76.1%
sqr-neg76.1%
associate-+l+76.1%
+-commutative76.1%
sqr-neg76.1%
distribute-rgt-out76.2%
fma-def76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in m around 0 54.0%
Taylor expanded in k around inf 53.2%
unpow253.2%
associate-/r*58.4%
Simplified58.4%
Final simplification47.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 88.4%
associate-*r/88.4%
*-commutative88.4%
sqr-neg88.4%
associate-+l+88.4%
+-commutative88.4%
sqr-neg88.4%
distribute-rgt-out88.4%
fma-def88.4%
+-commutative88.4%
Simplified88.4%
Taylor expanded in k around 0 55.2%
exp-to-pow84.5%
Simplified84.5%
Taylor expanded in m around 0 19.5%
Final simplification19.5%
herbie shell --seed 2023264
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))