
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a)) (t_1 (/ 1.0 t_0))) (if (<= k 2e-69) t_0 (/ 1.0 (+ t_1 (* k (+ (* 10.0 t_1) (/ k t_0))))))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 2e-69) {
tmp = t_0;
} else {
tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / 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) :: t_1
real(8) :: tmp
t_0 = (k ** m) * a
t_1 = 1.0d0 / t_0
if (k <= 2d-69) then
tmp = t_0
else
tmp = 1.0d0 / (t_1 + (k * ((10.0d0 * t_1) + (k / t_0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 2e-69) {
tmp = t_0;
} else {
tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0))));
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a t_1 = 1.0 / t_0 tmp = 0 if k <= 2e-69: tmp = t_0 else: tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0)))) return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (k <= 2e-69) tmp = t_0; else tmp = Float64(1.0 / Float64(t_1 + Float64(k * Float64(Float64(10.0 * t_1) + Float64(k / t_0))))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; t_1 = 1.0 / t_0; tmp = 0.0; if (k <= 2e-69) tmp = t_0; else tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[k, 2e-69], t$95$0, N[(1.0 / N[(t$95$1 + N[(k * N[(N[(10.0 * t$95$1), $MachinePrecision] + N[(k / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
t_1 := \frac{1}{t\_0}\\
\mathbf{if}\;k \leq 2 \cdot 10^{-69}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + k \cdot \left(10 \cdot t\_1 + \frac{k}{t\_0}\right)}\\
\end{array}
\end{array}
if k < 1.9999999999999999e-69Initial program 94.0%
associate-/l*94.0%
remove-double-neg94.0%
distribute-frac-neg294.0%
distribute-neg-frac294.0%
remove-double-neg94.0%
sqr-neg94.0%
associate-+l+94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
Simplified94.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 1.9999999999999999e-69 < k Initial program 93.5%
associate-/l*93.5%
remove-double-neg93.5%
distribute-frac-neg293.5%
distribute-neg-frac293.5%
remove-double-neg93.5%
sqr-neg93.5%
associate-+l+93.5%
sqr-neg93.5%
distribute-rgt-out93.5%
Simplified93.5%
distribute-lft-in93.5%
associate-+l+93.5%
associate-*r/93.5%
clear-num93.5%
associate-+l+93.5%
distribute-lft-in93.5%
+-commutative93.5%
fma-define93.5%
+-commutative93.5%
*-commutative93.5%
Applied egg-rr93.5%
Taylor expanded in k around 0 99.8%
Final simplification99.9%
(FPCore (a k m) :precision binary64 (if (<= m 1.45) (* (/ (pow k m) (hypot 1.0 k)) (/ a (hypot 1.0 k))) (pow (sqrt (* (pow k m) a)) 2.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.45) {
tmp = (pow(k, m) / hypot(1.0, k)) * (a / hypot(1.0, k));
} else {
tmp = pow(sqrt((pow(k, m) * a)), 2.0);
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.45) {
tmp = (Math.pow(k, m) / Math.hypot(1.0, k)) * (a / Math.hypot(1.0, k));
} else {
tmp = Math.pow(Math.sqrt((Math.pow(k, m) * a)), 2.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.45: tmp = (math.pow(k, m) / math.hypot(1.0, k)) * (a / math.hypot(1.0, k)) else: tmp = math.pow(math.sqrt((math.pow(k, m) * a)), 2.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.45) tmp = Float64(Float64((k ^ m) / hypot(1.0, k)) * Float64(a / hypot(1.0, k))); else tmp = sqrt(Float64((k ^ m) * a)) ^ 2.0; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.45) tmp = ((k ^ m) / hypot(1.0, k)) * (a / hypot(1.0, k)); else tmp = sqrt(((k ^ m) * a)) ^ 2.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.45], N[(N[(N[Power[k, m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.45:\\
\;\;\;\;\frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right)} \cdot \frac{a}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{{k}^{m} \cdot a}\right)}^{2}\\
\end{array}
\end{array}
if m < 1.44999999999999996Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in a around 0 97.8%
Taylor expanded in k around inf 96.0%
*-commutative96.0%
add-sqr-sqrt56.9%
unpow256.9%
*-un-lft-identity56.9%
add-sqr-sqrt56.9%
times-frac56.9%
hypot-1-def56.9%
unpow256.9%
add-sqr-sqrt95.9%
hypot-1-def98.1%
Applied egg-rr98.1%
associate-*l/98.1%
*-lft-identity98.1%
associate-/l*98.1%
associate-*l/98.1%
Simplified98.1%
if 1.44999999999999996 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in a around 0 85.7%
add-sqr-sqrt73.8%
pow273.8%
*-commutative73.8%
Applied egg-rr73.8%
Taylor expanded in k around 0 84.5%
Final simplification93.7%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a))) (if (<= m 1.45) (/ t_0 (+ 1.0 (* k (+ k 10.0)))) (pow (sqrt t_0) 2.0))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 1.45) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} else {
tmp = pow(sqrt(t_0), 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) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (m <= 1.45d0) then
tmp = t_0 / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = sqrt(t_0) ** 2.0d0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if (m <= 1.45) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} else {
tmp = Math.pow(Math.sqrt(t_0), 2.0);
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 1.45: tmp = t_0 / (1.0 + (k * (k + 10.0))) else: tmp = math.pow(math.sqrt(t_0), 2.0) return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 1.45) tmp = Float64(t_0 / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = sqrt(t_0) ^ 2.0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (m <= 1.45) tmp = t_0 / (1.0 + (k * (k + 10.0))); else tmp = sqrt(t_0) ^ 2.0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, 1.45], N[(t$95$0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 1.45:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{t\_0}\right)}^{2}\\
\end{array}
\end{array}
if m < 1.44999999999999996Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in a around 0 97.8%
if 1.44999999999999996 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in a around 0 85.7%
add-sqr-sqrt73.8%
pow273.8%
*-commutative73.8%
Applied egg-rr73.8%
Taylor expanded in k around 0 84.5%
Final simplification93.4%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a))) (if (<= m 2.95e-15) (/ t_0 (+ 1.0 (* k (+ k 10.0)))) t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 2.95e-15) {
tmp = t_0 / (1.0 + (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 = (k ** m) * a
if (m <= 2.95d-15) then
tmp = t_0 / (1.0d0 + (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 = Math.pow(k, m) * a;
double tmp;
if (m <= 2.95e-15) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 2.95e-15: tmp = t_0 / (1.0 + (k * (k + 10.0))) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 2.95e-15) tmp = Float64(t_0 / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (m <= 2.95e-15) tmp = t_0 / (1.0 + (k * (k + 10.0))); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, 2.95e-15], N[(t$95$0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 2.95 \cdot 10^{-15}:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 2.94999999999999982e-15Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in a around 0 97.7%
if 2.94999999999999982e-15 < m Initial program 86.0%
associate-/l*86.0%
remove-double-neg86.0%
distribute-frac-neg286.0%
distribute-neg-frac286.0%
remove-double-neg86.0%
sqr-neg86.0%
associate-+l+86.0%
sqr-neg86.0%
distribute-rgt-out86.0%
Simplified86.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (a k m) :precision binary64 (if (<= m 2.95e-15) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.95e-15) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = pow(k, m) * a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.95d-15) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.95e-15) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.95e-15: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.95e-15) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.95e-15) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.95e-15], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.95 \cdot 10^{-15}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 2.94999999999999982e-15Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
if 2.94999999999999982e-15 < m Initial program 86.0%
associate-/l*86.0%
remove-double-neg86.0%
distribute-frac-neg286.0%
distribute-neg-frac286.0%
remove-double-neg86.0%
sqr-neg86.0%
associate-+l+86.0%
sqr-neg86.0%
distribute-rgt-out86.0%
Simplified86.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a))) (if (<= m 2.95e-15) (/ t_0 (+ 1.0 (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 2.95e-15) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (m <= 2.95d-15) then
tmp = t_0 / (1.0d0 + (k * k))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if (m <= 2.95e-15) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 2.95e-15: tmp = t_0 / (1.0 + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 2.95e-15) tmp = Float64(t_0 / Float64(1.0 + Float64(k * k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (m <= 2.95e-15) tmp = t_0 / (1.0 + (k * k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, 2.95e-15], N[(t$95$0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 2.95 \cdot 10^{-15}:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 2.94999999999999982e-15Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in a around 0 97.7%
Taylor expanded in k around inf 95.9%
if 2.94999999999999982e-15 < m Initial program 86.0%
associate-/l*86.0%
remove-double-neg86.0%
distribute-frac-neg286.0%
distribute-neg-frac286.0%
remove-double-neg86.0%
sqr-neg86.0%
associate-+l+86.0%
sqr-neg86.0%
distribute-rgt-out86.0%
Simplified86.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.3%
(FPCore (a k m) :precision binary64 (if (<= m 2.95e-15) (* a (/ (pow k m) (+ 1.0 (* k k)))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.95e-15) {
tmp = a * (pow(k, m) / (1.0 + (k * k)));
} else {
tmp = pow(k, m) * a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.95d-15) then
tmp = a * ((k ** m) / (1.0d0 + (k * k)))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.95e-15) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * k)));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.95e-15: tmp = a * (math.pow(k, m) / (1.0 + (k * k))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.95e-15) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * k)))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.95e-15) tmp = a * ((k ^ m) / (1.0 + (k * k))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.95e-15], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.95 \cdot 10^{-15}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 2.94999999999999982e-15Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in k around inf 95.9%
if 2.94999999999999982e-15 < m Initial program 86.0%
associate-/l*86.0%
remove-double-neg86.0%
distribute-frac-neg286.0%
distribute-neg-frac286.0%
remove-double-neg86.0%
sqr-neg86.0%
associate-+l+86.0%
sqr-neg86.0%
distribute-rgt-out86.0%
Simplified86.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -3.5e-11) (not (<= m 2.95e-15))) (* (pow k m) a) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -3.5e-11) || !(m <= 2.95e-15)) {
tmp = pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-3.5d-11)) .or. (.not. (m <= 2.95d-15))) then
tmp = (k ** m) * a
else
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -3.5e-11) || !(m <= 2.95e-15)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -3.5e-11) or not (m <= 2.95e-15): tmp = math.pow(k, m) * a else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -3.5e-11) || !(m <= 2.95e-15)) tmp = Float64((k ^ m) * a); else tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -3.5e-11) || ~((m <= 2.95e-15))) tmp = (k ^ m) * a; else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -3.5e-11], N[Not[LessEqual[m, 2.95e-15]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.5 \cdot 10^{-11} \lor \neg \left(m \leq 2.95 \cdot 10^{-15}\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -3.50000000000000019e-11 or 2.94999999999999982e-15 < m Initial program 92.7%
associate-/l*92.7%
remove-double-neg92.7%
distribute-frac-neg292.7%
distribute-neg-frac292.7%
remove-double-neg92.7%
sqr-neg92.7%
associate-+l+92.7%
sqr-neg92.7%
distribute-rgt-out92.7%
Simplified92.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -3.50000000000000019e-11 < m < 2.94999999999999982e-15Initial program 95.8%
associate-/l*95.7%
remove-double-neg95.7%
distribute-frac-neg295.7%
distribute-neg-frac295.7%
remove-double-neg95.7%
sqr-neg95.7%
associate-+l+95.7%
sqr-neg95.7%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 95.3%
Final simplification98.3%
(FPCore (a k m)
:precision binary64
(if (<= m -2.4e+36)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 4.8e-47)
(/ a (+ 1.0 (* k (+ k 10.0))))
(+ a (* a (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.4e+36) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 4.8e-47) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * ((k * 99.0) - 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.4d+36)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 4.8d-47) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (a * (k * ((k * 99.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.4e+36) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 4.8e-47) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.4e+36: tmp = a / ((k * k) + (k * 10.0)) elif m <= 4.8e-47: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.4e+36) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 4.8e-47) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 99.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.4e+36) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 4.8e-47) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.4e+36], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.8e-47], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.4 \cdot 10^{+36}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 4.8 \cdot 10^{-47}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -2.39999999999999992e36Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.4%
Taylor expanded in k around inf 37.4%
Taylor expanded in k around inf 45.1%
*-commutative45.1%
Simplified45.1%
if -2.39999999999999992e36 < m < 4.7999999999999999e-47Initial program 96.0%
associate-/l*95.9%
remove-double-neg95.9%
distribute-frac-neg295.9%
distribute-neg-frac295.9%
remove-double-neg95.9%
sqr-neg95.9%
associate-+l+95.9%
sqr-neg95.9%
distribute-rgt-out95.9%
Simplified95.9%
Taylor expanded in m around 0 92.1%
if 4.7999999999999999e-47 < m Initial program 86.5%
associate-/l*86.5%
remove-double-neg86.5%
distribute-frac-neg286.5%
distribute-neg-frac286.5%
remove-double-neg86.5%
sqr-neg86.5%
associate-+l+86.5%
sqr-neg86.5%
distribute-rgt-out86.5%
Simplified86.5%
Taylor expanded in m around 0 7.8%
Taylor expanded in k around 0 23.7%
Taylor expanded in a around 0 27.9%
Final simplification56.5%
(FPCore (a k m)
:precision binary64
(if (<= m -8e+35)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 820000.0)
(/ a (+ 1.0 (* k (+ k 10.0))))
(+ a (* k (* 99.0 (* k a)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -8e+35) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 820000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.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 <= (-8d+35)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 820000.0d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (k * (99.0d0 * (k * a)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -8e+35) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 820000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.0 * (k * a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -8e+35: tmp = a / ((k * k) + (k * 10.0)) elif m <= 820000.0: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (k * (99.0 * (k * a))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -8e+35) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 820000.0) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(k * Float64(99.0 * Float64(k * a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -8e+35) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 820000.0) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (k * (99.0 * (k * a))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -8e+35], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 820000.0], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -8 \cdot 10^{+35}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 820000:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -7.9999999999999997e35Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.4%
Taylor expanded in k around inf 37.4%
Taylor expanded in k around inf 45.1%
*-commutative45.1%
Simplified45.1%
if -7.9999999999999997e35 < m < 8.2e5Initial program 96.2%
associate-/l*96.2%
remove-double-neg96.2%
distribute-frac-neg296.2%
distribute-neg-frac296.2%
remove-double-neg96.2%
sqr-neg96.2%
associate-+l+96.2%
sqr-neg96.2%
distribute-rgt-out96.2%
Simplified96.2%
Taylor expanded in m around 0 89.2%
if 8.2e5 < m Initial program 85.2%
associate-/l*85.2%
remove-double-neg85.2%
distribute-frac-neg285.2%
distribute-neg-frac285.2%
remove-double-neg85.2%
sqr-neg85.2%
associate-+l+85.2%
sqr-neg85.2%
distribute-rgt-out85.2%
Simplified85.2%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 20.5%
Taylor expanded in k around inf 20.5%
associate-*r*20.5%
neg-mul-120.5%
distribute-rgt1-in20.5%
metadata-eval20.5%
*-commutative20.5%
distribute-lft-neg-in20.5%
*-commutative20.5%
*-commutative20.5%
associate-*r*20.5%
distribute-lft-neg-in20.5%
metadata-eval20.5%
associate-*r*20.5%
Simplified20.5%
Taylor expanded in a around 0 20.5%
Final simplification55.1%
(FPCore (a k m) :precision binary64 (if (<= m 820000.0) (/ a (+ 1.0 (* k (+ k 10.0)))) (+ a (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 820000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.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 <= 820000.0d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (k * (99.0d0 * (k * a)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 820000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.0 * (k * a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 820000.0: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (k * (99.0 * (k * a))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 820000.0) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(k * Float64(99.0 * Float64(k * a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 820000.0) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (k * (99.0 * (k * a))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 820000.0], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 820000:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < 8.2e5Initial program 97.8%
associate-/l*97.8%
remove-double-neg97.8%
distribute-frac-neg297.8%
distribute-neg-frac297.8%
remove-double-neg97.8%
sqr-neg97.8%
associate-+l+97.8%
sqr-neg97.8%
distribute-rgt-out97.8%
Simplified97.8%
Taylor expanded in m around 0 67.9%
if 8.2e5 < m Initial program 85.2%
associate-/l*85.2%
remove-double-neg85.2%
distribute-frac-neg285.2%
distribute-neg-frac285.2%
remove-double-neg85.2%
sqr-neg85.2%
associate-+l+85.2%
sqr-neg85.2%
distribute-rgt-out85.2%
Simplified85.2%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 20.5%
Taylor expanded in k around inf 20.5%
associate-*r*20.5%
neg-mul-120.5%
distribute-rgt1-in20.5%
metadata-eval20.5%
*-commutative20.5%
distribute-lft-neg-in20.5%
*-commutative20.5%
*-commutative20.5%
associate-*r*20.5%
distribute-lft-neg-in20.5%
metadata-eval20.5%
associate-*r*20.5%
Simplified20.5%
Taylor expanded in a around 0 20.5%
Final simplification52.9%
(FPCore (a k m) :precision binary64 (if (<= m 4.8e-47) (/ a (+ 1.0 (* k k))) (+ a (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.8e-47) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (k * (99.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 <= 4.8d-47) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a + (k * (99.0d0 * (k * a)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 4.8e-47) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (k * (99.0 * (k * a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4.8e-47: tmp = a / (1.0 + (k * k)) else: tmp = a + (k * (99.0 * (k * a))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4.8e-47) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a + Float64(k * Float64(99.0 * Float64(k * a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 4.8e-47) tmp = a / (1.0 + (k * k)); else tmp = a + (k * (99.0 * (k * a))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4.8e-47], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.8 \cdot 10^{-47}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < 4.7999999999999999e-47Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 68.5%
Taylor expanded in k around inf 66.8%
if 4.7999999999999999e-47 < m Initial program 86.5%
associate-/l*86.5%
remove-double-neg86.5%
distribute-frac-neg286.5%
distribute-neg-frac286.5%
remove-double-neg86.5%
sqr-neg86.5%
associate-+l+86.5%
sqr-neg86.5%
distribute-rgt-out86.5%
Simplified86.5%
Taylor expanded in m around 0 7.8%
Taylor expanded in k around 0 23.7%
Taylor expanded in k around inf 23.3%
associate-*r*23.3%
neg-mul-123.3%
distribute-rgt1-in23.3%
metadata-eval23.3%
*-commutative23.3%
distribute-lft-neg-in23.3%
*-commutative23.3%
*-commutative23.3%
associate-*r*23.3%
distribute-lft-neg-in23.3%
metadata-eval23.3%
associate-*r*23.3%
Simplified23.3%
Taylor expanded in a around 0 23.3%
Final simplification51.7%
(FPCore (a k m) :precision binary64 (if (<= m 3.55) (/ a (+ 1.0 (* k k))) (* (* k a) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.55) {
tmp = a / (1.0 + (k * k));
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 3.55d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = (k * a) * (-10.0d0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 3.55) {
tmp = a / (1.0 + (k * k));
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 3.55: tmp = a / (1.0 + (k * k)) else: tmp = (k * a) * -10.0 return tmp
function code(a, k, m) tmp = 0.0 if (m <= 3.55) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(Float64(k * a) * -10.0); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 3.55) tmp = a / (1.0 + (k * k)); else tmp = (k * a) * -10.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 3.55], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3.55:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot a\right) \cdot -10\\
\end{array}
\end{array}
if m < 3.5499999999999998Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 68.6%
Taylor expanded in k around inf 66.9%
if 3.5499999999999998 < m Initial program 85.5%
associate-/l*85.5%
remove-double-neg85.5%
distribute-frac-neg285.5%
distribute-neg-frac285.5%
remove-double-neg85.5%
sqr-neg85.5%
associate-+l+85.5%
sqr-neg85.5%
distribute-rgt-out85.5%
Simplified85.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.8%
Taylor expanded in k around inf 17.4%
Final simplification50.8%
(FPCore (a k m) :precision binary64 (if (<= m 1.75) (/ a (+ 1.0 (* k 10.0))) (* (* k a) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.75) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.75d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = (k * a) * (-10.0d0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.75) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.75: tmp = a / (1.0 + (k * 10.0)) else: tmp = (k * a) * -10.0 return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.75) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(Float64(k * a) * -10.0); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.75) tmp = a / (1.0 + (k * 10.0)); else tmp = (k * a) * -10.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.75], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.75:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot a\right) \cdot -10\\
\end{array}
\end{array}
if m < 1.75Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 68.6%
Taylor expanded in k around 0 44.8%
*-commutative44.8%
Simplified44.8%
if 1.75 < m Initial program 85.5%
associate-/l*85.5%
remove-double-neg85.5%
distribute-frac-neg285.5%
distribute-neg-frac285.5%
remove-double-neg85.5%
sqr-neg85.5%
associate-+l+85.5%
sqr-neg85.5%
distribute-rgt-out85.5%
Simplified85.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.8%
Taylor expanded in k around inf 17.4%
Final simplification35.9%
(FPCore (a k m) :precision binary64 (if (<= m 1.5) a (* (* k a) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.5) {
tmp = a;
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.5d0) then
tmp = a
else
tmp = (k * a) * (-10.0d0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.5) {
tmp = a;
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.5: tmp = a else: tmp = (k * a) * -10.0 return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.5) tmp = a; else tmp = Float64(Float64(k * a) * -10.0); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.5) tmp = a; else tmp = (k * a) * -10.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.5], a, N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.5:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot a\right) \cdot -10\\
\end{array}
\end{array}
if m < 1.5Initial program 97.8%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 68.6%
Taylor expanded in k around 0 31.0%
if 1.5 < m Initial program 85.5%
associate-/l*85.5%
remove-double-neg85.5%
distribute-frac-neg285.5%
distribute-neg-frac285.5%
remove-double-neg85.5%
sqr-neg85.5%
associate-+l+85.5%
sqr-neg85.5%
distribute-rgt-out85.5%
Simplified85.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.8%
Taylor expanded in k around inf 17.4%
Final simplification26.6%
(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 93.8%
associate-/l*93.8%
remove-double-neg93.8%
distribute-frac-neg293.8%
distribute-neg-frac293.8%
remove-double-neg93.8%
sqr-neg93.8%
associate-+l+93.8%
sqr-neg93.8%
distribute-rgt-out93.8%
Simplified93.8%
Taylor expanded in m around 0 47.4%
Taylor expanded in k around 0 22.2%
herbie shell --seed 2024110
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))