
(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 14 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 -3.5e-23)
(* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0)))))
(if (<= m 0.0195)
(* (/ a (hypot 1.0 k)) (/ 1.0 (hypot 1.0 k)))
(* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.5e-23) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 0.0195) {
tmp = (a / hypot(1.0, k)) * (1.0 / hypot(1.0, k));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (m <= -3.5e-23) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 0.0195) {
tmp = (a / Math.hypot(1.0, k)) * (1.0 / Math.hypot(1.0, k));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.5e-23: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) elif m <= 0.0195: tmp = (a / math.hypot(1.0, k)) * (1.0 / math.hypot(1.0, k)) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.5e-23) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); elseif (m <= 0.0195) tmp = Float64(Float64(a / hypot(1.0, k)) * Float64(1.0 / hypot(1.0, k))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.5e-23) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); elseif (m <= 0.0195) tmp = (a / hypot(1.0, k)) * (1.0 / hypot(1.0, k)); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.5e-23], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0195], N[(N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.5 \cdot 10^{-23}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 0.0195:\\
\;\;\;\;\frac{a}{\mathsf{hypot}\left(1, k\right)} \cdot \frac{1}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -3.49999999999999993e-23Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
if -3.49999999999999993e-23 < m < 0.0195Initial 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 m around 0 94.0%
Taylor expanded in k around inf 93.1%
*-rgt-identity93.1%
add-sqr-sqrt93.1%
times-frac93.1%
hypot-1-def93.1%
hypot-1-def99.1%
Applied egg-rr99.1%
if 0.0195 < m Initial program 74.2%
associate-/l*74.1%
remove-double-neg74.1%
distribute-frac-neg274.1%
distribute-neg-frac274.1%
remove-double-neg74.1%
sqr-neg74.1%
associate-+l+74.1%
sqr-neg74.1%
distribute-rgt-out74.1%
Simplified74.1%
Taylor expanded in k around 0 99.2%
Final simplification99.4%
(FPCore (a k m) :precision binary64 (if (<= (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))) INFINITY) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (((a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= ((double) INFINITY)) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (((a * Math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= Double.POSITIVE_INFINITY) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if ((a * math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= math.inf: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= Inf) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (((a * (k ^ m)) / ((1.0 + (k * 10.0)) + (k * k))) <= Inf) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], 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[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\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))) < +inf.0Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.6%
Simplified97.6%
if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 0.0%
associate-/l*0.0%
remove-double-neg0.0%
distribute-frac-neg20.0%
distribute-neg-frac20.0%
remove-double-neg0.0%
sqr-neg0.0%
associate-+l+0.0%
sqr-neg0.0%
distribute-rgt-out0.0%
Simplified0.0%
Taylor expanded in m around 0 1.6%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.8%
(FPCore (a k m) :precision binary64 (if (or (<= m -1.55e+28) (not (<= m 0.0142))) (* a (pow k m)) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -1.55e+28) || !(m <= 0.0142)) {
tmp = a * pow(k, m);
} 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 <= (-1.55d+28)) .or. (.not. (m <= 0.0142d0))) then
tmp = a * (k ** m)
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 <= -1.55e+28) || !(m <= 0.0142)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -1.55e+28) or not (m <= 0.0142): tmp = a * math.pow(k, m) else: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -1.55e+28) || !(m <= 0.0142)) tmp = Float64(a * (k ^ m)); 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 <= -1.55e+28) || ~((m <= 0.0142))) tmp = a * (k ^ m); else tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -1.55e+28], N[Not[LessEqual[m, 0.0142]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $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 -1.55 \cdot 10^{+28} \lor \neg \left(m \leq 0.0142\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -1.55e28 or 0.014200000000000001 < m Initial program 85.1%
associate-/l*85.1%
remove-double-neg85.1%
distribute-frac-neg285.1%
distribute-neg-frac285.1%
remove-double-neg85.1%
sqr-neg85.1%
associate-+l+85.1%
sqr-neg85.1%
distribute-rgt-out85.1%
Simplified85.1%
Taylor expanded in k around 0 99.6%
if -1.55e28 < m < 0.014200000000000001Initial program 94.4%
associate-/l*94.5%
remove-double-neg94.5%
distribute-frac-neg294.5%
distribute-neg-frac294.5%
remove-double-neg94.5%
sqr-neg94.5%
associate-+l+94.5%
sqr-neg94.5%
distribute-rgt-out94.5%
Simplified94.5%
Taylor expanded in m around 0 94.5%
Final simplification97.5%
(FPCore (a k m) :precision binary64 (if (<= m 1.95) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0))))) (+ a (* a (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.95) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * ((k * 100.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 <= 1.95d0) then
tmp = a * (1.0d0 / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = a + (a * (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.95) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.95: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) else: tmp = a + (a * (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.95) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.95) tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); else tmp = a + (a * (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.95], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.95:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.94999999999999996Initial program 96.6%
associate-/l*96.6%
remove-double-neg96.6%
distribute-frac-neg296.6%
distribute-neg-frac296.6%
remove-double-neg96.6%
sqr-neg96.6%
associate-+l+96.6%
sqr-neg96.6%
distribute-rgt-out96.6%
Simplified96.6%
Taylor expanded in m around 0 71.3%
if 1.94999999999999996 < m Initial program 73.6%
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 2.9%
Taylor expanded in k around 0 2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in k around 0 36.1%
Taylor expanded in a around 0 40.4%
Final simplification60.8%
(FPCore (a k m) :precision binary64 (if (<= m 2.1) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0))))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.1) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * (1.0 + (k * (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.1d0) then
tmp = a * (1.0d0 / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = a * (1.0d0 + (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.1) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.1: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.1) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.1) tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.1], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.1:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 2.10000000000000009Initial program 96.6%
associate-/l*96.6%
remove-double-neg96.6%
distribute-frac-neg296.6%
distribute-neg-frac296.6%
remove-double-neg96.6%
sqr-neg96.6%
associate-+l+96.6%
sqr-neg96.6%
distribute-rgt-out96.6%
Simplified96.6%
Taylor expanded in m around 0 71.3%
if 2.10000000000000009 < m Initial program 73.6%
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 2.9%
Taylor expanded in k around 0 40.4%
Taylor expanded in k around inf 40.4%
*-commutative40.4%
Simplified40.4%
Final simplification60.8%
(FPCore (a k m) :precision binary64 (if (or (<= k -1.26e+87) (not (<= k 0.024))) (* 0.1 (/ a k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= -1.26e+87) || !(k <= 0.024)) {
tmp = 0.1 * (a / 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 <= (-1.26d+87)) .or. (.not. (k <= 0.024d0))) then
tmp = 0.1d0 * (a / k)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((k <= -1.26e+87) || !(k <= 0.024)) {
tmp = 0.1 * (a / k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= -1.26e+87) or not (k <= 0.024): tmp = 0.1 * (a / k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= -1.26e+87) || !(k <= 0.024)) tmp = Float64(0.1 * Float64(a / k)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((k <= -1.26e+87) || ~((k <= 0.024))) tmp = 0.1 * (a / k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, -1.26e+87], N[Not[LessEqual[k, 0.024]], $MachinePrecision]], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -1.26 \cdot 10^{+87} \lor \neg \left(k \leq 0.024\right):\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -1.26000000000000005e87 or 0.024 < k Initial program 77.2%
associate-/l*77.3%
remove-double-neg77.3%
distribute-frac-neg277.3%
distribute-neg-frac277.3%
remove-double-neg77.3%
sqr-neg77.3%
associate-+l+77.3%
sqr-neg77.3%
distribute-rgt-out77.3%
Simplified77.3%
Taylor expanded in m around 0 57.8%
Taylor expanded in k around 0 21.3%
*-commutative21.3%
Simplified21.3%
Taylor expanded in k around inf 21.3%
if -1.26000000000000005e87 < k < 0.024Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 38.6%
Taylor expanded in k around 0 37.9%
Final simplification29.7%
(FPCore (a k m) :precision binary64 (if (<= k -5.7e+88) (/ 0.1 (/ k a)) (if (<= k 0.024) a (* 0.1 (/ a k)))))
double code(double a, double k, double m) {
double tmp;
if (k <= -5.7e+88) {
tmp = 0.1 / (k / a);
} else if (k <= 0.024) {
tmp = a;
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= (-5.7d+88)) then
tmp = 0.1d0 / (k / a)
else if (k <= 0.024d0) then
tmp = a
else
tmp = 0.1d0 * (a / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -5.7e+88) {
tmp = 0.1 / (k / a);
} else if (k <= 0.024) {
tmp = a;
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -5.7e+88: tmp = 0.1 / (k / a) elif k <= 0.024: tmp = a else: tmp = 0.1 * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -5.7e+88) tmp = Float64(0.1 / Float64(k / a)); elseif (k <= 0.024) tmp = a; else tmp = Float64(0.1 * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -5.7e+88) tmp = 0.1 / (k / a); elseif (k <= 0.024) tmp = a; else tmp = 0.1 * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -5.7e+88], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.024], a, N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -5.7 \cdot 10^{+88}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{elif}\;k \leq 0.024:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < -5.70000000000000021e88Initial program 72.7%
associate-/l*72.7%
remove-double-neg72.7%
distribute-frac-neg272.7%
distribute-neg-frac272.7%
remove-double-neg72.7%
sqr-neg72.7%
associate-+l+72.7%
sqr-neg72.7%
distribute-rgt-out72.7%
Simplified72.7%
Taylor expanded in m around 0 49.9%
Taylor expanded in k around 0 21.7%
*-commutative21.7%
Simplified21.7%
Taylor expanded in k around inf 21.7%
clear-num23.8%
un-div-inv23.8%
Applied egg-rr23.8%
if -5.70000000000000021e88 < k < 0.024Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 38.6%
Taylor expanded in k around 0 37.9%
if 0.024 < k Initial program 78.8%
associate-/l*78.9%
remove-double-neg78.9%
distribute-frac-neg278.9%
distribute-neg-frac278.9%
remove-double-neg78.9%
sqr-neg78.9%
associate-+l+78.9%
sqr-neg78.9%
distribute-rgt-out78.9%
Simplified78.9%
Taylor expanded in m around 0 60.6%
Taylor expanded in k around 0 21.1%
*-commutative21.1%
Simplified21.1%
Taylor expanded in k around inf 21.1%
(FPCore (a k m) :precision binary64 (if (<= m 1.95) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.95) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (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.95d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.95) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.95: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.95) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.95) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.95], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.95:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 1.94999999999999996Initial program 96.6%
associate-/l*96.6%
remove-double-neg96.6%
distribute-frac-neg296.6%
distribute-neg-frac296.6%
remove-double-neg96.6%
sqr-neg96.6%
associate-+l+96.6%
sqr-neg96.6%
distribute-rgt-out96.6%
Simplified96.6%
Taylor expanded in m around 0 71.3%
if 1.94999999999999996 < m Initial program 73.6%
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 2.9%
Taylor expanded in k around 0 40.4%
Taylor expanded in k around inf 40.4%
*-commutative40.4%
Simplified40.4%
Final simplification60.8%
(FPCore (a k m) :precision binary64 (if (<= m 2.0) (* a (/ 1.0 (+ 1.0 (* k k)))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.0) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = a * (1.0 + (k * (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 / (1.0d0 + (k * k)))
else
tmp = a * (1.0d0 + (k * (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 / (1.0 + (k * k)));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.0: tmp = a * (1.0 / (1.0 + (k * k))) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.0) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * k)))); else tmp = Float64(a * Float64(1.0 + Float64(k * 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 / (1.0 + (k * k))); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.0], N[(a * N[(1.0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 2Initial program 96.6%
associate-/l*96.6%
remove-double-neg96.6%
distribute-frac-neg296.6%
distribute-neg-frac296.6%
remove-double-neg96.6%
sqr-neg96.6%
associate-+l+96.6%
sqr-neg96.6%
distribute-rgt-out96.6%
Simplified96.6%
Taylor expanded in m around 0 71.3%
Taylor expanded in k around inf 70.8%
if 2 < m Initial program 73.6%
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 2.9%
Taylor expanded in k around 0 40.4%
Taylor expanded in k around inf 40.4%
*-commutative40.4%
Simplified40.4%
(FPCore (a k m) :precision binary64 (if (<= m 2.1) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.1) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * (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.1d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (1.0d0 + (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.1) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.1: tmp = a / (1.0 + (k * k)) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.1) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.1) tmp = a / (1.0 + (k * k)); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.1], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.1:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 2.10000000000000009Initial program 96.6%
associate-/l*96.6%
remove-double-neg96.6%
distribute-frac-neg296.6%
distribute-neg-frac296.6%
remove-double-neg96.6%
sqr-neg96.6%
associate-+l+96.6%
sqr-neg96.6%
distribute-rgt-out96.6%
Simplified96.6%
Taylor expanded in m around 0 71.3%
Taylor expanded in k around inf 70.8%
if 2.10000000000000009 < m Initial program 73.6%
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 2.9%
Taylor expanded in k around 0 40.4%
Taylor expanded in k around inf 40.4%
*-commutative40.4%
Simplified40.4%
(FPCore (a k m) :precision binary64 (if (<= m 8.5e+16) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 8.5e+16) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 8.5d+16) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 8.5e+16) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 8.5e+16: tmp = a / (1.0 + (k * k)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 8.5e+16) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 8.5e+16) tmp = a / (1.0 + (k * k)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 8.5e+16], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 8.5 \cdot 10^{+16}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 8.5e16Initial program 96.1%
associate-/l*96.1%
remove-double-neg96.1%
distribute-frac-neg296.1%
distribute-neg-frac296.1%
remove-double-neg96.1%
sqr-neg96.1%
associate-+l+96.1%
sqr-neg96.1%
distribute-rgt-out96.1%
Simplified96.1%
Taylor expanded in m around 0 70.2%
Taylor expanded in k around inf 69.7%
if 8.5e16 < m Initial program 73.8%
associate-/l*73.8%
remove-double-neg73.8%
distribute-frac-neg273.8%
distribute-neg-frac273.8%
remove-double-neg73.8%
sqr-neg73.8%
associate-+l+73.8%
sqr-neg73.8%
distribute-rgt-out73.8%
Simplified73.8%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 10.0%
Final simplification50.1%
(FPCore (a k m) :precision binary64 (if (<= m 8.6e+15) (/ a (+ 1.0 (* k 10.0))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 8.6e+15) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 8.6d+15) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 8.6e+15) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 8.6e+15: tmp = a / (1.0 + (k * 10.0)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 8.6e+15) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 8.6e+15) tmp = a / (1.0 + (k * 10.0)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 8.6e+15], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 8.6 \cdot 10^{+15}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 8.6e15Initial program 96.1%
associate-/l*96.1%
remove-double-neg96.1%
distribute-frac-neg296.1%
distribute-neg-frac296.1%
remove-double-neg96.1%
sqr-neg96.1%
associate-+l+96.1%
sqr-neg96.1%
distribute-rgt-out96.1%
Simplified96.1%
Taylor expanded in m around 0 70.2%
Taylor expanded in k around 0 42.8%
*-commutative42.8%
Simplified42.8%
if 8.6e15 < m Initial program 73.8%
associate-/l*73.8%
remove-double-neg73.8%
distribute-frac-neg273.8%
distribute-neg-frac273.8%
remove-double-neg73.8%
sqr-neg73.8%
associate-+l+73.8%
sqr-neg73.8%
distribute-rgt-out73.8%
Simplified73.8%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 10.0%
Final simplification32.0%
(FPCore (a k m) :precision binary64 (if (<= k 0.024) (* a (+ 1.0 (* k -10.0))) (* 0.1 (/ a k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.024) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 0.024d0) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = 0.1d0 * (a / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.024) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.024: tmp = a * (1.0 + (k * -10.0)) else: tmp = 0.1 * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.024) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(0.1 * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.024) tmp = a * (1.0 + (k * -10.0)); else tmp = 0.1 * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.024], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.024:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 0.024Initial program 94.5%
associate-/l*94.5%
remove-double-neg94.5%
distribute-frac-neg294.5%
distribute-neg-frac294.5%
remove-double-neg94.5%
sqr-neg94.5%
associate-+l+94.5%
sqr-neg94.5%
distribute-rgt-out94.5%
Simplified94.5%
Taylor expanded in m around 0 40.9%
Taylor expanded in k around 0 34.5%
if 0.024 < k Initial program 78.8%
associate-/l*78.9%
remove-double-neg78.9%
distribute-frac-neg278.9%
distribute-neg-frac278.9%
remove-double-neg78.9%
sqr-neg78.9%
associate-+l+78.9%
sqr-neg78.9%
distribute-rgt-out78.9%
Simplified78.9%
Taylor expanded in m around 0 60.6%
Taylor expanded in k around 0 21.1%
*-commutative21.1%
Simplified21.1%
Taylor expanded in k around inf 21.1%
Final simplification29.7%
(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.8%
associate-/l*88.8%
remove-double-neg88.8%
distribute-frac-neg288.8%
distribute-neg-frac288.8%
remove-double-neg88.8%
sqr-neg88.8%
associate-+l+88.8%
sqr-neg88.8%
distribute-rgt-out88.8%
Simplified88.8%
Taylor expanded in m around 0 48.1%
Taylor expanded in k around 0 21.3%
herbie shell --seed 2024149
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))