
(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 (let* ((t_0 (* (pow k m) a)) (t_1 (/ 1.0 t_0))) (if (<= k 2e-40) 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-40) {
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-40) 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-40) {
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-40: 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-40) 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-40) 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-40], 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^{-40}:\\
\;\;\;\;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-40Initial 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 k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 1.9999999999999999e-40 < k Initial program 78.3%
associate-/l*78.2%
remove-double-neg78.2%
distribute-frac-neg278.2%
distribute-neg-frac278.2%
remove-double-neg78.2%
sqr-neg78.2%
associate-+l+78.2%
sqr-neg78.2%
distribute-rgt-out78.2%
Simplified78.2%
distribute-lft-in78.2%
associate-+l+78.2%
associate-*r/78.3%
clear-num77.7%
associate-+l+77.7%
distribute-lft-in77.7%
+-commutative77.7%
fma-define77.7%
+-commutative77.7%
*-commutative77.7%
Applied egg-rr77.7%
Taylor expanded in k around 0 98.9%
Final simplification99.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 4e+208)
(/ 1.0 (+ (/ 1.0 t_0) (pow (cbrt (* k (/ (+ k 10.0) a))) 3.0)))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 4e+208) {
tmp = 1.0 / ((1.0 / t_0) + pow(cbrt((k * ((k + 10.0) / a))), 3.0));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 4e+208) {
tmp = 1.0 / ((1.0 / t_0) + Math.pow(Math.cbrt((k * ((k + 10.0) / a))), 3.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 4e+208) tmp = Float64(1.0 / Float64(Float64(1.0 / t_0) + (cbrt(Float64(k * Float64(Float64(k + 10.0) / a))) ^ 3.0))); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+208], N[(1.0 / N[(N[(1.0 / t$95$0), $MachinePrecision] + N[Power[N[Power[N[(k * N[(N[(k + 10.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 4 \cdot 10^{+208}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0} + {\left(\sqrt[3]{k \cdot \frac{k + 10}{a}}\right)}^{3}}\\
\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))) < 3.9999999999999999e208Initial program 97.4%
associate-/l*97.4%
remove-double-neg97.4%
distribute-frac-neg297.4%
distribute-neg-frac297.4%
remove-double-neg97.4%
sqr-neg97.4%
associate-+l+97.4%
sqr-neg97.4%
distribute-rgt-out97.4%
Simplified97.4%
distribute-lft-in97.4%
associate-+l+97.4%
associate-*r/97.4%
clear-num97.1%
associate-+l+97.1%
distribute-lft-in97.1%
+-commutative97.1%
fma-define97.1%
+-commutative97.1%
*-commutative97.1%
Applied egg-rr97.1%
Taylor expanded in k around 0 80.3%
add-cube-cbrt80.2%
pow380.2%
div-inv80.2%
distribute-rgt-out83.7%
Applied egg-rr83.7%
Taylor expanded in m around 0 84.8%
associate-/l*87.0%
Simplified87.0%
if 3.9999999999999999e208 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 51.8%
associate-/l*51.8%
remove-double-neg51.8%
distribute-frac-neg251.8%
distribute-neg-frac251.8%
remove-double-neg51.8%
sqr-neg51.8%
associate-+l+51.8%
sqr-neg51.8%
distribute-rgt-out51.8%
Simplified51.8%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification89.8%
(FPCore (a k m) :precision binary64 (let* ((t_0 (/ (* (pow k m) a) (+ (+ 1.0 (* k 10.0)) (* k k))))) (if (<= t_0 INFINITY) t_0 (* a (+ 1.0 (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double t_0 = (pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = (Math.pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): t_0 = (math.pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k)) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) t_0 = Float64(Float64((k ^ m) * a) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) tmp = 0.0 if (t_0 <= Inf) tmp = t_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) t_0 = ((k ^ m) * a) / ((1.0 + (k * 10.0)) + (k * k)); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, 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}
t_0 := \frac{{k}^{m} \cdot a}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99 - 10\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.8%
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%
Final simplification98.0%
(FPCore (a k m) :precision binary64 (if (<= m 3.65) (* 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 <= 3.65) {
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 <= 3.65d0) 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 <= 3.65) {
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 <= 3.65: 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 <= 3.65) 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 <= 3.65) 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, 3.65], 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 3.65:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 3.64999999999999991Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
if 3.64999999999999991 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -4.8e-6) (not (<= m 0.0052))) (* (pow k m) a) (/ 1.0 (+ (* k (/ (+ k 10.0) a)) (/ 1.0 a)))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -4.8e-6) || !(m <= 0.0052)) {
tmp = pow(k, m) * a;
} else {
tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / 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-6)) .or. (.not. (m <= 0.0052d0))) then
tmp = (k ** m) * a
else
tmp = 1.0d0 / ((k * ((k + 10.0d0) / a)) + (1.0d0 / a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -4.8e-6) || !(m <= 0.0052)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -4.8e-6) or not (m <= 0.0052): tmp = math.pow(k, m) * a else: tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / a)) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -4.8e-6) || !(m <= 0.0052)) tmp = Float64((k ^ m) * a); else tmp = Float64(1.0 / Float64(Float64(k * Float64(Float64(k + 10.0) / a)) + Float64(1.0 / a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -4.8e-6) || ~((m <= 0.0052))) tmp = (k ^ m) * a; else tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -4.8e-6], N[Not[LessEqual[m, 0.0052]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(1.0 / N[(N[(k * N[(N[(k + 10.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.8 \cdot 10^{-6} \lor \neg \left(m \leq 0.0052\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k + 10}{a} + \frac{1}{a}}\\
\end{array}
\end{array}
if m < -4.7999999999999998e-6 or 0.0051999999999999998 < m Initial program 83.4%
associate-/l*83.4%
remove-double-neg83.4%
distribute-frac-neg283.4%
distribute-neg-frac283.4%
remove-double-neg83.4%
sqr-neg83.4%
associate-+l+83.4%
sqr-neg83.4%
distribute-rgt-out83.4%
Simplified83.4%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.7999999999999998e-6 < m < 0.0051999999999999998Initial program 94.5%
associate-/l*94.4%
remove-double-neg94.4%
distribute-frac-neg294.4%
distribute-neg-frac294.4%
remove-double-neg94.4%
sqr-neg94.4%
associate-+l+94.4%
sqr-neg94.4%
distribute-rgt-out94.4%
Simplified94.4%
distribute-lft-in94.4%
associate-+l+94.4%
associate-*r/94.5%
clear-num93.7%
associate-+l+93.7%
distribute-lft-in93.7%
+-commutative93.7%
fma-define93.7%
+-commutative93.7%
*-commutative93.7%
Applied egg-rr93.7%
Taylor expanded in k around 0 98.6%
add-cube-cbrt98.3%
pow398.2%
div-inv98.2%
distribute-rgt-out98.2%
Applied egg-rr98.2%
Taylor expanded in m around 0 92.7%
+-commutative92.7%
associate-/l*97.6%
Simplified97.6%
Final simplification99.1%
(FPCore (a k m)
:precision binary64
(if (<= m -2e-89)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m 6.3e+15)
(/ 1.0 (+ (* k (/ (+ k 10.0) a)) (/ 1.0 a)))
(* a (+ 1.0 (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2e-89) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 6.3e+15) {
tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / a));
} 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 <= (-2d-89)) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= 6.3d+15) then
tmp = 1.0d0 / ((k * ((k + 10.0d0) / a)) + (1.0d0 / a))
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 <= -2e-89) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 6.3e+15) {
tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / a));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2e-89: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= 6.3e+15: tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / a)) else: tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2e-89) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= 6.3e+15) tmp = Float64(1.0 / Float64(Float64(k * Float64(Float64(k + 10.0) / a)) + Float64(1.0 / a))); 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 <= -2e-89) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= 6.3e+15) tmp = 1.0 / ((k * ((k + 10.0) / a)) + (1.0 / a)); else tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2e-89], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 6.3e+15], N[(1.0 / N[(N[(k * N[(N[(k + 10.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $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 -2 \cdot 10^{-89}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 6.3 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k + 10}{a} + \frac{1}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -2.00000000000000008e-89Initial 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 39.0%
if -2.00000000000000008e-89 < m < 6.3e15Initial program 94.0%
associate-/l*93.9%
remove-double-neg93.9%
distribute-frac-neg293.9%
distribute-neg-frac293.9%
remove-double-neg93.9%
sqr-neg93.9%
associate-+l+93.9%
sqr-neg93.9%
distribute-rgt-out93.9%
Simplified93.9%
distribute-lft-in93.9%
associate-+l+93.9%
associate-*r/94.0%
clear-num93.9%
associate-+l+93.9%
distribute-lft-in93.9%
+-commutative93.9%
fma-define93.9%
+-commutative93.9%
*-commutative93.9%
Applied egg-rr93.9%
Taylor expanded in k around 0 99.2%
add-cube-cbrt98.9%
pow398.8%
div-inv98.8%
distribute-rgt-out98.8%
Applied egg-rr98.8%
Taylor expanded in m around 0 91.7%
+-commutative91.7%
associate-/l*97.0%
Simplified97.0%
if 6.3e15 < m Initial program 67.9%
associate-/l*67.9%
remove-double-neg67.9%
distribute-frac-neg267.9%
distribute-neg-frac267.9%
remove-double-neg67.9%
sqr-neg67.9%
associate-+l+67.9%
sqr-neg67.9%
distribute-rgt-out67.9%
Simplified67.9%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 48.7%
Final simplification61.4%
(FPCore (a k m) :precision binary64 (if (<= m 2.1) (/ 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 <= 2.1) {
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 <= 2.1d0) 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 <= 2.1) {
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 <= 2.1: 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 <= 2.1) 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 <= 2.1) 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, 2.1], 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 2.1:\\
\;\;\;\;\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 < 2.10000000000000009Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
Taylor expanded in m around 0 65.4%
if 2.10000000000000009 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 48.2%
Final simplification59.7%
(FPCore (a k m) :precision binary64 (if (<= m 1.72) (/ 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 <= 1.72) {
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 <= 1.72d0) 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 <= 1.72) {
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 <= 1.72: 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 <= 1.72) 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 <= 1.72) 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, 1.72], 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 1.72:\\
\;\;\;\;\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 < 1.71999999999999997Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
Taylor expanded in m around 0 65.4%
if 1.71999999999999997 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 38.1%
cancel-sign-sub-inv38.1%
metadata-eval38.1%
mul-1-neg38.1%
distribute-rgt-neg-in38.1%
distribute-rgt1-in38.1%
metadata-eval38.1%
metadata-eval38.1%
distribute-lft-neg-in38.1%
metadata-eval38.1%
metadata-eval38.1%
*-commutative38.1%
Simplified38.1%
Taylor expanded in k around inf 39.3%
Final simplification56.7%
(FPCore (a k m) :precision binary64 (if (<= m 1.85) (/ a (+ 1.0 (* k k))) (+ a (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.85) {
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 <= 1.85d0) 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 <= 1.85) {
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 <= 1.85: 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 <= 1.85) 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 <= 1.85) 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, 1.85], 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 1.85:\\
\;\;\;\;\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 < 1.8500000000000001Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
Taylor expanded in m around 0 65.4%
Taylor expanded in k around inf 64.5%
if 1.8500000000000001 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 38.1%
cancel-sign-sub-inv38.1%
metadata-eval38.1%
mul-1-neg38.1%
distribute-rgt-neg-in38.1%
distribute-rgt1-in38.1%
metadata-eval38.1%
metadata-eval38.1%
distribute-lft-neg-in38.1%
metadata-eval38.1%
metadata-eval38.1%
*-commutative38.1%
Simplified38.1%
Taylor expanded in k around inf 39.3%
Final simplification56.1%
(FPCore (a k m) :precision binary64 (if (<= m 0.9) (/ a (+ 1.0 (* k k))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.9) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (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 <= 0.9d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.9) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.9: tmp = a / (1.0 + (k * k)) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.9) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.9) tmp = a / (1.0 + (k * k)); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.9], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.9:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.900000000000000022Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
Taylor expanded in m around 0 65.4%
Taylor expanded in k around inf 64.5%
if 0.900000000000000022 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 10.8%
*-commutative10.8%
Simplified10.8%
Taylor expanded in k around inf 20.4%
*-commutative20.4%
associate-*r*20.4%
Simplified20.4%
(FPCore (a k m) :precision binary64 (if (<= m 0.65) (/ a (+ 1.0 (* k 10.0))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.65) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (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 <= 0.65d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.65) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.65: tmp = a / (1.0 + (k * 10.0)) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.65) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.65) tmp = a / (1.0 + (k * 10.0)); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.65], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.65:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.650000000000000022Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
Taylor expanded in m around 0 65.4%
Taylor expanded in k around 0 41.0%
*-commutative41.0%
Simplified41.0%
if 0.650000000000000022 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 10.8%
*-commutative10.8%
Simplified10.8%
Taylor expanded in k around inf 20.4%
*-commutative20.4%
associate-*r*20.4%
Simplified20.4%
(FPCore (a k m) :precision binary64 (if (<= m 0.58) a (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.58) {
tmp = a;
} else {
tmp = a * (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 <= 0.58d0) then
tmp = a
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.58) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.58: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.58) tmp = a; else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.58) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.58], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.58:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.57999999999999996Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
Taylor expanded in k around 0 76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in m around 0 31.8%
if 0.57999999999999996 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 10.8%
*-commutative10.8%
Simplified10.8%
Taylor expanded in k around inf 20.4%
*-commutative20.4%
associate-*r*20.4%
Simplified20.4%
(FPCore (a k m) :precision binary64 (if (<= m 0.32) a (* (* k a) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.32) {
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 <= 0.32d0) 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 <= 0.32) {
tmp = a;
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.32: tmp = a else: tmp = (k * a) * -10.0 return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.32) 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 <= 0.32) tmp = a; else tmp = (k * a) * -10.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.32], a, N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.32:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot a\right) \cdot -10\\
\end{array}
\end{array}
if m < 0.320000000000000007Initial program 97.0%
associate-/l*97.0%
remove-double-neg97.0%
distribute-frac-neg297.0%
distribute-neg-frac297.0%
remove-double-neg97.0%
sqr-neg97.0%
associate-+l+97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
Simplified97.0%
Taylor expanded in k around 0 76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in m around 0 31.8%
if 0.320000000000000007 < m Initial program 68.2%
associate-/l*68.2%
remove-double-neg68.2%
distribute-frac-neg268.2%
distribute-neg-frac268.2%
remove-double-neg68.2%
sqr-neg68.2%
associate-+l+68.2%
sqr-neg68.2%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 10.8%
*-commutative10.8%
Simplified10.8%
Taylor expanded in k around inf 20.4%
Final simplification28.0%
(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 87.5%
associate-/l*87.4%
remove-double-neg87.4%
distribute-frac-neg287.4%
distribute-neg-frac287.4%
remove-double-neg87.4%
sqr-neg87.4%
associate-+l+87.4%
sqr-neg87.4%
distribute-rgt-out87.4%
Simplified87.4%
Taylor expanded in k around 0 84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in m around 0 22.7%
herbie shell --seed 2024132
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))