
(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 (hypot k (sqrt (fma k 10.0 1.0)))))
(if (<= m -8e-9)
(/ a (pow k (- m)))
(if (<= m 1.1e-12) (* (/ 1.0 t_0) (/ a t_0)) (* a (pow k m))))))
double code(double a, double k, double m) {
double t_0 = hypot(k, sqrt(fma(k, 10.0, 1.0)));
double tmp;
if (m <= -8e-9) {
tmp = a / pow(k, -m);
} else if (m <= 1.1e-12) {
tmp = (1.0 / t_0) * (a / t_0);
} else {
tmp = a * pow(k, m);
}
return tmp;
}
function code(a, k, m) t_0 = hypot(k, sqrt(fma(k, 10.0, 1.0))) tmp = 0.0 if (m <= -8e-9) tmp = Float64(a / (k ^ Float64(-m))); elseif (m <= 1.1e-12) tmp = Float64(Float64(1.0 / t_0) * Float64(a / t_0)); else tmp = Float64(a * (k ^ m)); end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[Sqrt[k ^ 2 + N[Sqrt[N[(k * 10.0 + 1.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[m, -8e-9], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.1e-12], N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(a / t$95$0), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(k, \sqrt{\mathsf{fma}\left(k, 10, 1\right)}\right)\\
\mathbf{if}\;m \leq -8 \cdot 10^{-9}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{elif}\;m \leq 1.1 \cdot 10^{-12}:\\
\;\;\;\;\frac{1}{t\_0} \cdot \frac{a}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -8.0000000000000005e-9Initial 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%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
+-commutative100.0%
fma-undefine100.0%
Applied egg-rr100.0%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 65.7%
rec-exp65.7%
mul-1-neg65.7%
remove-double-neg65.7%
log-rec65.7%
*-commutative65.7%
distribute-lft-neg-in65.7%
distribute-rgt-neg-out65.7%
exp-to-pow100.0%
Simplified100.0%
if -8.0000000000000005e-9 < m < 1.09999999999999996e-12Initial program 90.0%
associate-/l*90.0%
remove-double-neg90.0%
distribute-frac-neg290.0%
distribute-neg-frac290.0%
remove-double-neg90.0%
sqr-neg90.0%
associate-+l+90.0%
sqr-neg90.0%
distribute-rgt-out90.0%
Simplified90.0%
Taylor expanded in m around 0 90.0%
*-un-lft-identity90.0%
distribute-lft-in90.0%
associate-+l+90.0%
add-sqr-sqrt90.0%
times-frac89.9%
+-commutative89.9%
add-sqr-sqrt89.9%
hypot-define89.9%
+-commutative89.9%
fma-define89.9%
+-commutative89.9%
add-sqr-sqrt89.9%
hypot-define99.8%
Applied egg-rr99.8%
if 1.09999999999999996e-12 < m Initial program 78.1%
associate-/l*78.1%
remove-double-neg78.1%
distribute-frac-neg278.1%
distribute-neg-frac278.1%
remove-double-neg78.1%
sqr-neg78.1%
associate-+l+78.1%
sqr-neg78.1%
distribute-rgt-out78.1%
Simplified78.1%
Taylor expanded in k around 0 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification99.2%
(FPCore (a k m) :precision binary64 (if (<= (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))) 2e+218) (/ a (/ (fma k (+ k 10.0) 1.0) (pow k m))) (/ a (pow k (- m)))))
double code(double a, double k, double m) {
double tmp;
if (((a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+218) {
tmp = a / (fma(k, (k + 10.0), 1.0) / pow(k, m));
} else {
tmp = a / pow(k, -m);
}
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))) <= 2e+218) tmp = Float64(a / Float64(fma(k, Float64(k + 10.0), 1.0) / (k ^ m))); else tmp = Float64(a / (k ^ Float64(-m))); end return 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], 2e+218], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a / N[Power[k, (-m)], $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 2 \cdot 10^{+218}:\\
\;\;\;\;\frac{a}{\frac{\mathsf{fma}\left(k, k + 10, 1\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\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))) < 2.00000000000000017e218Initial program 96.4%
associate-/l*96.4%
remove-double-neg96.4%
distribute-frac-neg296.4%
distribute-neg-frac296.4%
remove-double-neg96.4%
sqr-neg96.4%
associate-+l+96.4%
sqr-neg96.4%
distribute-rgt-out96.4%
Simplified96.4%
clear-num96.4%
un-div-inv96.4%
+-commutative96.4%
+-commutative96.4%
fma-undefine96.4%
Applied egg-rr96.4%
if 2.00000000000000017e218 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 52.1%
associate-/l*52.1%
remove-double-neg52.1%
distribute-frac-neg252.1%
distribute-neg-frac252.1%
remove-double-neg52.1%
sqr-neg52.1%
associate-+l+52.1%
sqr-neg52.1%
distribute-rgt-out52.1%
Simplified52.1%
clear-num52.1%
un-div-inv52.1%
+-commutative52.1%
+-commutative52.1%
fma-undefine52.1%
Applied egg-rr52.1%
Taylor expanded in k around 0 97.9%
Taylor expanded in k around inf 58.3%
rec-exp58.3%
mul-1-neg58.3%
remove-double-neg58.3%
log-rec58.3%
*-commutative58.3%
distribute-lft-neg-in58.3%
distribute-rgt-neg-out58.3%
exp-to-pow97.9%
Simplified97.9%
Final simplification96.7%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 2e+218)
(/ t_0 (+ 1.0 (* k (+ k 10.0))))
(/ a (pow k (- m))))))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+218) {
tmp = t_0 / (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) :: t_0
real(8) :: tmp
t_0 = a * (k ** m)
if ((t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))) <= 2d+218) then
tmp = t_0 / (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 t_0 = a * Math.pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+218) {
tmp = t_0 / (1.0 + (k * (k + 10.0)));
} else {
tmp = a / Math.pow(k, -m);
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+218: tmp = t_0 / (1.0 + (k * (k + 10.0))) else: tmp = a / math.pow(k, -m) return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 2e+218) tmp = Float64(t_0 / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a / (k ^ Float64(-m))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+218) tmp = t_0 / (1.0 + (k * (k + 10.0))); else tmp = a / (k ^ -m); 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[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+218], N[(t$95$0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 2 \cdot 10^{+218}:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\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))) < 2.00000000000000017e218Initial program 96.4%
sqr-neg96.4%
associate-+l+96.4%
+-commutative96.4%
sqr-neg96.4%
distribute-rgt-out96.4%
fma-define96.4%
+-commutative96.4%
Simplified96.4%
fma-undefine96.4%
Applied egg-rr96.4%
if 2.00000000000000017e218 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 52.1%
associate-/l*52.1%
remove-double-neg52.1%
distribute-frac-neg252.1%
distribute-neg-frac252.1%
remove-double-neg52.1%
sqr-neg52.1%
associate-+l+52.1%
sqr-neg52.1%
distribute-rgt-out52.1%
Simplified52.1%
clear-num52.1%
un-div-inv52.1%
+-commutative52.1%
+-commutative52.1%
fma-undefine52.1%
Applied egg-rr52.1%
Taylor expanded in k around 0 97.9%
Taylor expanded in k around inf 58.3%
rec-exp58.3%
mul-1-neg58.3%
remove-double-neg58.3%
log-rec58.3%
*-commutative58.3%
distribute-lft-neg-in58.3%
distribute-rgt-neg-out58.3%
exp-to-pow97.9%
Simplified97.9%
Final simplification96.7%
(FPCore (a k m) :precision binary64 (if (<= m 4.5) (* 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 <= 4.5) {
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 <= 4.5d0) 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 <= 4.5) {
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 <= 4.5: 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 <= 4.5) 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 <= 4.5) 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, 4.5], 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 4.5:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 4.5Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
if 4.5 < m Initial program 77.7%
associate-/l*77.7%
remove-double-neg77.7%
distribute-frac-neg277.7%
distribute-neg-frac277.7%
remove-double-neg77.7%
sqr-neg77.7%
associate-+l+77.7%
sqr-neg77.7%
distribute-rgt-out77.7%
Simplified77.7%
Taylor expanded in k around 0 99.0%
*-commutative99.0%
Simplified99.0%
Final simplification96.7%
(FPCore (a k m) :precision binary64 (if (or (<= m -7.5e-9) (not (<= m 1.35e-12))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -7.5e-9) || !(m <= 1.35e-12)) {
tmp = a * pow(k, m);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-7.5d-9)) .or. (.not. (m <= 1.35d-12))) then
tmp = a * (k ** m)
else
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -7.5e-9) || !(m <= 1.35e-12)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -7.5e-9) or not (m <= 1.35e-12): tmp = a * math.pow(k, m) else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -7.5e-9) || !(m <= 1.35e-12)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -7.5e-9) || ~((m <= 1.35e-12))) tmp = a * (k ^ m); else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -7.5e-9], N[Not[LessEqual[m, 1.35e-12]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -7.5 \cdot 10^{-9} \lor \neg \left(m \leq 1.35 \cdot 10^{-12}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -7.49999999999999933e-9 or 1.3499999999999999e-12 < m Initial program 87.3%
associate-/l*87.3%
remove-double-neg87.3%
distribute-frac-neg287.3%
distribute-neg-frac287.3%
remove-double-neg87.3%
sqr-neg87.3%
associate-+l+87.3%
sqr-neg87.3%
distribute-rgt-out87.3%
Simplified87.3%
Taylor expanded in k around 0 98.9%
*-commutative98.9%
Simplified98.9%
if -7.49999999999999933e-9 < m < 1.3499999999999999e-12Initial program 90.0%
associate-/l*90.0%
remove-double-neg90.0%
distribute-frac-neg290.0%
distribute-neg-frac290.0%
remove-double-neg90.0%
sqr-neg90.0%
associate-+l+90.0%
sqr-neg90.0%
distribute-rgt-out90.0%
Simplified90.0%
Taylor expanded in m around 0 90.0%
Final simplification96.3%
(FPCore (a k m) :precision binary64 (if (<= m -7.5e-9) (/ a (pow k (- m))) (if (<= m 5e-13) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -7.5e-9) {
tmp = a / pow(k, -m);
} else if (m <= 5e-13) {
tmp = a / (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 <= (-7.5d-9)) then
tmp = a / (k ** -m)
else if (m <= 5d-13) then
tmp = a / (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 <= -7.5e-9) {
tmp = a / Math.pow(k, -m);
} else if (m <= 5e-13) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -7.5e-9: tmp = a / math.pow(k, -m) elif m <= 5e-13: tmp = a / (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 <= -7.5e-9) tmp = Float64(a / (k ^ Float64(-m))); elseif (m <= 5e-13) tmp = Float64(a / 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 <= -7.5e-9) tmp = a / (k ^ -m); elseif (m <= 5e-13) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -7.5e-9], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5e-13], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -7.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{elif}\;m \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -7.49999999999999933e-9Initial 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%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
+-commutative100.0%
fma-undefine100.0%
Applied egg-rr100.0%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 65.7%
rec-exp65.7%
mul-1-neg65.7%
remove-double-neg65.7%
log-rec65.7%
*-commutative65.7%
distribute-lft-neg-in65.7%
distribute-rgt-neg-out65.7%
exp-to-pow100.0%
Simplified100.0%
if -7.49999999999999933e-9 < m < 4.9999999999999999e-13Initial program 90.0%
associate-/l*90.0%
remove-double-neg90.0%
distribute-frac-neg290.0%
distribute-neg-frac290.0%
remove-double-neg90.0%
sqr-neg90.0%
associate-+l+90.0%
sqr-neg90.0%
distribute-rgt-out90.0%
Simplified90.0%
Taylor expanded in m around 0 90.0%
if 4.9999999999999999e-13 < m Initial program 78.1%
associate-/l*78.1%
remove-double-neg78.1%
distribute-frac-neg278.1%
distribute-neg-frac278.1%
remove-double-neg78.1%
sqr-neg78.1%
associate-+l+78.1%
sqr-neg78.1%
distribute-rgt-out78.1%
Simplified78.1%
Taylor expanded in k around 0 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification96.3%
(FPCore (a k m)
:precision binary64
(if (<= m -2e+24)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 1.7)
(/ a (+ 1.0 (* k (+ k 10.0))))
(+ a (* a (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2e+24) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.7) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-2d+24)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 1.7d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (a * (k * ((k * 99.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2e+24) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.7) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2e+24: tmp = a / ((k * k) + (k * 10.0)) elif m <= 1.7: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2e+24) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 1.7) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 99.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2e+24) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 1.7) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2e+24], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.7], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2 \cdot 10^{+24}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 1.7:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -2e24Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 40.6%
Taylor expanded in k around inf 40.6%
Taylor expanded in k around inf 47.5%
*-commutative47.5%
Simplified47.5%
if -2e24 < m < 1.69999999999999996Initial program 91.0%
associate-/l*91.0%
remove-double-neg91.0%
distribute-frac-neg291.0%
distribute-neg-frac291.0%
remove-double-neg91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 83.4%
if 1.69999999999999996 < m Initial program 77.7%
associate-/l*77.7%
remove-double-neg77.7%
distribute-frac-neg277.7%
distribute-neg-frac277.7%
remove-double-neg77.7%
sqr-neg77.7%
associate-+l+77.7%
sqr-neg77.7%
distribute-rgt-out77.7%
Simplified77.7%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 22.6%
Taylor expanded in a around 0 28.8%
Final simplification51.7%
(FPCore (a k m)
:precision binary64
(if (<= m -2.25e+24)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 1.85)
(/ a (+ 1.0 (* k (+ k 10.0))))
(+ a (* k (* 99.0 (* a k)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.25e+24) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.85) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.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 <= (-2.25d+24)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 1.85d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (k * (99.0d0 * (a * k)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.25e+24) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.85) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.0 * (a * k)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.25e+24: tmp = a / ((k * k) + (k * 10.0)) elif m <= 1.85: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (k * (99.0 * (a * k))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.25e+24) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 1.85) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(k * Float64(99.0 * Float64(a * k)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.25e+24) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 1.85) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (k * (99.0 * (a * k))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.25e+24], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.85], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(99.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.25 \cdot 10^{+24}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 1.85:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(99 \cdot \left(a \cdot k\right)\right)\\
\end{array}
\end{array}
if m < -2.2500000000000001e24Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 40.6%
Taylor expanded in k around inf 40.6%
Taylor expanded in k around inf 47.5%
*-commutative47.5%
Simplified47.5%
if -2.2500000000000001e24 < m < 1.8500000000000001Initial program 91.0%
associate-/l*91.0%
remove-double-neg91.0%
distribute-frac-neg291.0%
distribute-neg-frac291.0%
remove-double-neg91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
Taylor expanded in m around 0 83.4%
if 1.8500000000000001 < m Initial program 77.7%
associate-/l*77.7%
remove-double-neg77.7%
distribute-frac-neg277.7%
distribute-neg-frac277.7%
remove-double-neg77.7%
sqr-neg77.7%
associate-+l+77.7%
sqr-neg77.7%
distribute-rgt-out77.7%
Simplified77.7%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 22.6%
Taylor expanded in k around inf 22.6%
associate-*r*22.6%
neg-mul-122.6%
distribute-rgt1-in22.6%
metadata-eval22.6%
*-commutative22.6%
distribute-lft-neg-in22.6%
distribute-rgt-neg-in22.6%
distribute-rgt-neg-in22.6%
metadata-eval22.6%
Simplified22.6%
Taylor expanded in k around 0 22.6%
Final simplification49.3%
(FPCore (a k m) :precision binary64 (if (<= m 1.52) (/ a (+ 1.0 (* k (+ k 10.0)))) (+ a (* k (* 99.0 (* a k))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.52) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.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.52d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (k * (99.0d0 * (a * k)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.52) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (99.0 * (a * k)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.52: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (k * (99.0 * (a * k))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.52) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(k * Float64(99.0 * Float64(a * k)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.52) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (k * (99.0 * (a * k))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.52], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(99.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.52:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(99 \cdot \left(a \cdot k\right)\right)\\
\end{array}
\end{array}
if m < 1.52Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 64.1%
if 1.52 < m Initial program 77.7%
associate-/l*77.7%
remove-double-neg77.7%
distribute-frac-neg277.7%
distribute-neg-frac277.7%
remove-double-neg77.7%
sqr-neg77.7%
associate-+l+77.7%
sqr-neg77.7%
distribute-rgt-out77.7%
Simplified77.7%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 22.6%
Taylor expanded in k around inf 22.6%
associate-*r*22.6%
neg-mul-122.6%
distribute-rgt1-in22.6%
metadata-eval22.6%
*-commutative22.6%
distribute-lft-neg-in22.6%
distribute-rgt-neg-in22.6%
distribute-rgt-neg-in22.6%
metadata-eval22.6%
Simplified22.6%
Taylor expanded in k around 0 22.6%
Final simplification47.4%
(FPCore (a k m) :precision binary64 (if (<= m 1.85) (/ a (+ 1.0 (* k k))) (+ a (* k (* 99.0 (* a k))))))
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 * (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.85d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a + (k * (99.0d0 * (a * k)))
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 * (a * k)));
}
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 * (a * k))) 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(a * k)))); 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 * (a * k))); 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[(a * k), $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(a \cdot k\right)\right)\\
\end{array}
\end{array}
if m < 1.8500000000000001Initial program 95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in m around 0 64.1%
Taylor expanded in k around 0 61.6%
if 1.8500000000000001 < m Initial program 77.7%
associate-/l*77.7%
remove-double-neg77.7%
distribute-frac-neg277.7%
distribute-neg-frac277.7%
remove-double-neg77.7%
sqr-neg77.7%
associate-+l+77.7%
sqr-neg77.7%
distribute-rgt-out77.7%
Simplified77.7%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 22.6%
Taylor expanded in k around inf 22.6%
associate-*r*22.6%
neg-mul-122.6%
distribute-rgt1-in22.6%
metadata-eval22.6%
*-commutative22.6%
distribute-lft-neg-in22.6%
distribute-rgt-neg-in22.6%
distribute-rgt-neg-in22.6%
metadata-eval22.6%
Simplified22.6%
Taylor expanded in k around 0 22.6%
(FPCore (a k m) :precision binary64 (if (<= m 252.0) (/ a (+ 1.0 (* k k))) (* (* a k) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 252.0) {
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 <= 252.0d0) 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 <= 252.0) {
tmp = a / (1.0 + (k * k));
} else {
tmp = (a * k) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 252.0: tmp = a / (1.0 + (k * k)) else: tmp = (a * k) * -10.0 return tmp
function code(a, k, m) tmp = 0.0 if (m <= 252.0) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(Float64(a * k) * -10.0); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 252.0) tmp = a / (1.0 + (k * k)); else tmp = (a * k) * -10.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 252.0], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * k), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 252:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot k\right) \cdot -10\\
\end{array}
\end{array}
if m < 252Initial program 95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in m around 0 63.7%
Taylor expanded in k around 0 61.2%
if 252 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in k around 0 73.5%
associate-*r*73.5%
distribute-lft1-in73.5%
*-commutative73.5%
fma-define73.5%
Simplified73.5%
Taylor expanded in m around 0 6.4%
Taylor expanded in k around inf 13.6%
Final simplification42.2%
(FPCore (a k m) :precision binary64 (if (<= m 20500.0) (/ a (+ 1.0 (* k 10.0))) (* (* a k) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 20500.0) {
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 <= 20500.0d0) 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 <= 20500.0) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = (a * k) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 20500.0: 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 <= 20500.0) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(Float64(a * k) * -10.0); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 20500.0) 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, 20500.0], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * k), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 20500:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot k\right) \cdot -10\\
\end{array}
\end{array}
if m < 20500Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 63.7%
Taylor expanded in k around 0 38.0%
*-commutative38.0%
Simplified38.0%
if 20500 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in k around 0 73.5%
associate-*r*73.5%
distribute-lft1-in73.5%
*-commutative73.5%
fma-define73.5%
Simplified73.5%
Taylor expanded in m around 0 6.4%
Taylor expanded in k around inf 13.6%
Final simplification28.3%
(FPCore (a k m) :precision binary64 (if (<= m 252.0) a (* (* a k) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 252.0) {
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 <= 252.0d0) 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 <= 252.0) {
tmp = a;
} else {
tmp = (a * k) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 252.0: tmp = a else: tmp = (a * k) * -10.0 return tmp
function code(a, k, m) tmp = 0.0 if (m <= 252.0) tmp = a; else tmp = Float64(Float64(a * k) * -10.0); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 252.0) tmp = a; else tmp = (a * k) * -10.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 252.0], a, N[(N[(a * k), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 252:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot k\right) \cdot -10\\
\end{array}
\end{array}
if m < 252Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 63.7%
Taylor expanded in k around 0 28.7%
if 252 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in k around 0 73.5%
associate-*r*73.5%
distribute-lft1-in73.5%
*-commutative73.5%
fma-define73.5%
Simplified73.5%
Taylor expanded in m around 0 6.4%
Taylor expanded in k around inf 13.6%
Final simplification22.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.1%
associate-/l*88.1%
remove-double-neg88.1%
distribute-frac-neg288.1%
distribute-neg-frac288.1%
remove-double-neg88.1%
sqr-neg88.1%
associate-+l+88.1%
sqr-neg88.1%
distribute-rgt-out88.1%
Simplified88.1%
Taylor expanded in m around 0 39.4%
Taylor expanded in k around 0 18.6%
herbie shell --seed 2024086
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))