
(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 15 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 (+ (* k k) (+ 1.0 (* k 10.0)))) 1e+245)
(/ (/ a (hypot 1.0 k)) (/ (hypot 1.0 k) (pow k m)))
t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if ((t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245) {
tmp = (a / hypot(1.0, k)) / (hypot(1.0, k) / pow(k, m));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double tmp;
if ((t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245) {
tmp = (a / Math.hypot(1.0, k)) / (Math.hypot(1.0, k) / Math.pow(k, m));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if (t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245: tmp = (a / math.hypot(1.0, k)) / (math.hypot(1.0, k) / math.pow(k, m)) 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(k * k) + Float64(1.0 + Float64(k * 10.0)))) <= 1e+245) tmp = Float64(Float64(a / hypot(1.0, k)) / Float64(hypot(1.0, k) / (k ^ m))); 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 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245) tmp = (a / hypot(1.0, k)) / (hypot(1.0, k) / (k ^ m)); 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[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+245], N[(N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t\_0}{k \cdot k + \left(1 + k \cdot 10\right)} \leq 10^{+245}:\\
\;\;\;\;\frac{\frac{a}{\mathsf{hypot}\left(1, k\right)}}{\frac{\mathsf{hypot}\left(1, k\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.00000000000000004e245Initial program 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in k around 0 96.5%
*-commutative96.5%
add-sqr-sqrt96.5%
times-frac96.5%
hypot-1-def96.5%
hypot-1-def98.3%
Applied egg-rr98.3%
*-commutative98.3%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
if 1.00000000000000004e245 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 53.1%
associate-/l*53.1%
remove-double-neg53.1%
distribute-frac-neg253.1%
distribute-neg-frac253.1%
remove-double-neg53.1%
sqr-neg53.1%
associate-+l+53.1%
sqr-neg53.1%
distribute-rgt-out53.1%
Simplified53.1%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.6%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= (/ t_0 (+ (* k k) (+ 1.0 (* k 10.0)))) 1e+245)
(* (/ a (hypot 1.0 k)) (/ (pow k m) (hypot 1.0 k)))
t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if ((t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245) {
tmp = (a / hypot(1.0, k)) * (pow(k, m) / hypot(1.0, k));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double tmp;
if ((t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245) {
tmp = (a / Math.hypot(1.0, k)) * (Math.pow(k, m) / Math.hypot(1.0, k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if (t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245: tmp = (a / math.hypot(1.0, k)) * (math.pow(k, m) / math.hypot(1.0, k)) 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(k * k) + Float64(1.0 + Float64(k * 10.0)))) <= 1e+245) tmp = Float64(Float64(a / hypot(1.0, k)) * Float64((k ^ m) / hypot(1.0, k))); 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 / ((k * k) + (1.0 + (k * 10.0)))) <= 1e+245) tmp = (a / hypot(1.0, k)) * ((k ^ m) / hypot(1.0, k)); 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[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+245], N[(N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t\_0}{k \cdot k + \left(1 + k \cdot 10\right)} \leq 10^{+245}:\\
\;\;\;\;\frac{a}{\mathsf{hypot}\left(1, k\right)} \cdot \frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.00000000000000004e245Initial program 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in k around 0 96.5%
*-commutative96.5%
add-sqr-sqrt96.5%
times-frac96.5%
hypot-1-def96.5%
hypot-1-def98.3%
Applied egg-rr98.3%
if 1.00000000000000004e245 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 53.1%
associate-/l*53.1%
remove-double-neg53.1%
distribute-frac-neg253.1%
distribute-neg-frac253.1%
remove-double-neg53.1%
sqr-neg53.1%
associate-+l+53.1%
sqr-neg53.1%
distribute-rgt-out53.1%
Simplified53.1%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.6%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m))) (t_1 (/ t_0 (+ (* k k) (+ 1.0 (* k 10.0)))))) (if (<= t_1 1e+245) t_1 t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double t_1 = t_0 / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_1 <= 1e+245) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = a * (k ** m)
t_1 = t_0 / ((k * k) + (1.0d0 + (k * 10.0d0)))
if (t_1 <= 1d+245) then
tmp = t_1
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 t_1 = t_0 / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_1 <= 1e+245) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) t_1 = t_0 / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_1 <= 1e+245: tmp = t_1 else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) t_1 = Float64(t_0 / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_1 <= 1e+245) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); t_1 = t_0 / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_1 <= 1e+245) tmp = t_1; 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]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+245], t$95$1, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
t_1 := \frac{t\_0}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{if}\;t\_1 \leq 10^{+245}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.00000000000000004e245Initial program 98.2%
if 1.00000000000000004e245 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 53.1%
associate-/l*53.1%
remove-double-neg53.1%
distribute-frac-neg253.1%
distribute-neg-frac253.1%
remove-double-neg53.1%
sqr-neg53.1%
associate-+l+53.1%
sqr-neg53.1%
distribute-rgt-out53.1%
Simplified53.1%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 5.6) (/ t_0 (+ 1.0 (* k (+ k 10.0)))) t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= 5.6) {
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 = a * (k ** m)
if (m <= 5.6d0) 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 = a * Math.pow(k, m);
double tmp;
if (m <= 5.6) {
tmp = t_0 / (1.0 + (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 m <= 5.6: tmp = t_0 / (1.0 + (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 (m <= 5.6) 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 = a * (k ^ m); tmp = 0.0; if (m <= 5.6) 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[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 5.6], 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 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq 5.6:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 5.5999999999999996Initial 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 5.5999999999999996 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (a k m) :precision binary64 (if (<= m 3.6) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.6) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} 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 <= 3.6d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
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 <= 3.6) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 3.6: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 3.6) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 3.6) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 3.6], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3.6:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 3.60000000000000009Initial 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%
if 3.60000000000000009 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 3.4) (/ t_0 (+ 1.0 (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= 3.4) {
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 = a * (k ** m)
if (m <= 3.4d0) 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 = a * Math.pow(k, m);
double tmp;
if (m <= 3.4) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if m <= 3.4: tmp = t_0 / (1.0 + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (m <= 3.4) 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 = a * (k ^ m); tmp = 0.0; if (m <= 3.4) 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[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 3.4], N[(t$95$0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq 3.4:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 3.39999999999999991Initial program 97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in k around 0 95.7%
if 3.39999999999999991 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.2%
(FPCore (a k m) :precision binary64 (if (or (<= m -6400.0) (not (<= m 1.7e-9))) (* a (pow k m)) (/ a (+ (* k k) (+ 1.0 (* k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -6400.0) || !(m <= 1.7e-9)) {
tmp = a * pow(k, m);
} else {
tmp = a / ((k * k) + (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 ((m <= (-6400.0d0)) .or. (.not. (m <= 1.7d-9))) then
tmp = a * (k ** m)
else
tmp = a / ((k * k) + (1.0d0 + (k * 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -6400.0) || !(m <= 1.7e-9)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -6400.0) or not (m <= 1.7e-9): tmp = a * math.pow(k, m) else: tmp = a / ((k * k) + (1.0 + (k * 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -6400.0) || !(m <= 1.7e-9)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -6400.0) || ~((m <= 1.7e-9))) tmp = a * (k ^ m); else tmp = a / ((k * k) + (1.0 + (k * 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -6400.0], N[Not[LessEqual[m, 1.7e-9]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6400 \lor \neg \left(m \leq 1.7 \cdot 10^{-9}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\end{array}
\end{array}
if m < -6400 or 1.6999999999999999e-9 < m Initial program 85.3%
associate-/l*85.3%
remove-double-neg85.3%
distribute-frac-neg285.3%
distribute-neg-frac285.3%
remove-double-neg85.3%
sqr-neg85.3%
associate-+l+85.3%
sqr-neg85.3%
distribute-rgt-out85.3%
Simplified85.3%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -6400 < m < 1.6999999999999999e-9Initial program 96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in m around 0 94.3%
Final simplification97.8%
(FPCore (a k m) :precision binary64 (if (<= m 4.5e-22) (/ a (+ (* k k) (+ 1.0 (* k 10.0)))) (* a (+ 1.0 (* k (- (* k 99.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.5e-22) {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = a * (1.0 + (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 <= 4.5d-22) then
tmp = a / ((k * k) + (1.0d0 + (k * 10.0d0)))
else
tmp = a * (1.0d0 + (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 <= 4.5e-22) {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4.5e-22: tmp = a / ((k * k) + (1.0 + (k * 10.0))) else: tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4.5e-22) tmp = Float64(a / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))); else tmp = Float64(a * Float64(1.0 + 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 <= 4.5e-22) tmp = a / ((k * k) + (1.0 + (k * 10.0))); else tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4.5e-22], N[(a / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{a}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < 4.49999999999999987e-22Initial program 97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in m around 0 71.5%
if 4.49999999999999987e-22 < m Initial program 73.5%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 3.9%
Taylor expanded in k around 0 38.1%
Final simplification60.2%
(FPCore (a k m) :precision binary64 (if (<= m 4.5e-22) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (- (* k 99.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.5e-22) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (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 <= 4.5d-22) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (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 <= 4.5e-22) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4.5e-22: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4.5e-22) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + 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 <= 4.5e-22) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4.5e-22], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < 4.49999999999999987e-22Initial 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 71.5%
if 4.49999999999999987e-22 < m Initial program 73.5%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 3.9%
Taylor expanded in k around 0 38.1%
Final simplification60.1%
(FPCore (a k m) :precision binary64 (if (<= m 1.76) (/ a (+ 1.0 (* k (+ k 10.0)))) (+ a (* k (* a (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.76) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (a * (k * 99.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.76d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (k * (a * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.76) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (a * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.76: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (k * (a * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.76) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(k * Float64(a * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.76) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (k * (a * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.76], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(a * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.76:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(a \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 1.76000000000000001Initial 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 71.7%
if 1.76000000000000001 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 35.2%
cancel-sign-sub-inv35.2%
mul-1-neg35.2%
distribute-rgt1-in35.2%
metadata-eval35.2%
metadata-eval35.2%
*-commutative35.2%
Simplified35.2%
metadata-eval35.2%
distribute-lft1-in35.2%
distribute-rgt-in21.2%
*-commutative21.2%
Applied egg-rr21.2%
Taylor expanded in k around inf 35.2%
mul-1-neg35.2%
distribute-rgt1-in35.2%
metadata-eval35.2%
distribute-rgt-neg-in35.2%
distribute-lft-neg-in35.2%
metadata-eval35.2%
associate-*l*35.2%
metadata-eval35.2%
distribute-rgt-out35.2%
*-commutative35.2%
distribute-rgt-out35.2%
metadata-eval35.2%
Simplified35.2%
Final simplification59.4%
(FPCore (a k m) :precision binary64 (if (<= m 2.0) (/ a (+ 1.0 (* k k))) (+ a (* k (* a (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.0) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (k * (a * (k * 99.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.0d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a + (k * (a * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.0) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (k * (a * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.0: tmp = a / (1.0 + (k * k)) else: tmp = a + (k * (a * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.0) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a + Float64(k * Float64(a * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.0) tmp = a / (1.0 + (k * k)); else tmp = a + (k * (a * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.0], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(a * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(a \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 2Initial program 97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in k around 0 95.7%
Taylor expanded in m around 0 69.9%
if 2 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 35.2%
cancel-sign-sub-inv35.2%
mul-1-neg35.2%
distribute-rgt1-in35.2%
metadata-eval35.2%
metadata-eval35.2%
*-commutative35.2%
Simplified35.2%
metadata-eval35.2%
distribute-lft1-in35.2%
distribute-rgt-in21.2%
*-commutative21.2%
Applied egg-rr21.2%
Taylor expanded in k around inf 35.2%
mul-1-neg35.2%
distribute-rgt1-in35.2%
metadata-eval35.2%
distribute-rgt-neg-in35.2%
distribute-lft-neg-in35.2%
metadata-eval35.2%
associate-*l*35.2%
metadata-eval35.2%
distribute-rgt-out35.2%
*-commutative35.2%
distribute-rgt-out35.2%
metadata-eval35.2%
Simplified35.2%
(FPCore (a k m) :precision binary64 (if (<= m 1.5) (/ a (+ 1.0 (* k k))) (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.5) {
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 <= 1.5d0) 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 <= 1.5) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.5: tmp = a / (1.0 + (k * k)) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.5) 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 <= 1.5) tmp = a / (1.0 + (k * k)); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.5], 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 1.5:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 1.5Initial program 97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in k around 0 95.7%
Taylor expanded in m around 0 69.9%
if 1.5 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.9%
Taylor expanded in k around inf 18.6%
(FPCore (a k m) :precision binary64 (if (<= m 1.3) (/ a (+ 1.0 (* k 10.0))) (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.3) {
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 <= 1.3d0) 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 <= 1.3) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.3: 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 <= 1.3) 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 <= 1.3) 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, 1.3], 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 1.3:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 1.30000000000000004Initial 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 71.7%
Taylor expanded in k around 0 46.1%
*-commutative46.1%
Simplified46.1%
if 1.30000000000000004 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.9%
Taylor expanded in k around inf 18.6%
(FPCore (a k m) :precision binary64 (if (<= m 0.17) a (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.17) {
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 <= 0.17d0) 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 <= 0.17) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.17: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.17) 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 <= 0.17) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.17], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.17:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 0.170000000000000012Initial 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 71.7%
Taylor expanded in k around 0 29.8%
if 0.170000000000000012 < m Initial program 73.3%
associate-/l*73.3%
remove-double-neg73.3%
distribute-frac-neg273.3%
distribute-neg-frac273.3%
remove-double-neg73.3%
sqr-neg73.3%
associate-+l+73.3%
sqr-neg73.3%
distribute-rgt-out73.3%
Simplified73.3%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 10.9%
Taylor expanded in k around inf 18.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 89.5%
associate-/l*89.5%
remove-double-neg89.5%
distribute-frac-neg289.5%
distribute-neg-frac289.5%
remove-double-neg89.5%
sqr-neg89.5%
associate-+l+89.5%
sqr-neg89.5%
distribute-rgt-out89.5%
Simplified89.5%
Taylor expanded in m around 0 48.5%
Taylor expanded in k around 0 21.1%
herbie shell --seed 2024102
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))