
(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 1.0 (* k (sqrt (- 1.0 (/ -10.0 k)))))))
(if (or (<= m -0.00046) (not (<= m 1.55e-24)))
(* a (pow k m))
(/ (/ a t_0) t_0))))
double code(double a, double k, double m) {
double t_0 = hypot(1.0, (k * sqrt((1.0 - (-10.0 / k)))));
double tmp;
if ((m <= -0.00046) || !(m <= 1.55e-24)) {
tmp = a * pow(k, m);
} else {
tmp = (a / t_0) / t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = Math.hypot(1.0, (k * Math.sqrt((1.0 - (-10.0 / k)))));
double tmp;
if ((m <= -0.00046) || !(m <= 1.55e-24)) {
tmp = a * Math.pow(k, m);
} else {
tmp = (a / t_0) / t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.hypot(1.0, (k * math.sqrt((1.0 - (-10.0 / k))))) tmp = 0 if (m <= -0.00046) or not (m <= 1.55e-24): tmp = a * math.pow(k, m) else: tmp = (a / t_0) / t_0 return tmp
function code(a, k, m) t_0 = hypot(1.0, Float64(k * sqrt(Float64(1.0 - Float64(-10.0 / k))))) tmp = 0.0 if ((m <= -0.00046) || !(m <= 1.55e-24)) tmp = Float64(a * (k ^ m)); else tmp = Float64(Float64(a / t_0) / t_0); end return tmp end
function tmp_2 = code(a, k, m) t_0 = hypot(1.0, (k * sqrt((1.0 - (-10.0 / k))))); tmp = 0.0; if ((m <= -0.00046) || ~((m <= 1.55e-24))) tmp = a * (k ^ m); else tmp = (a / t_0) / t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[Sqrt[1.0 ^ 2 + N[(k * N[Sqrt[N[(1.0 - N[(-10.0 / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]}, If[Or[LessEqual[m, -0.00046], N[Not[LessEqual[m, 1.55e-24]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(N[(a / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(1, k \cdot \sqrt{1 - \frac{-10}{k}}\right)\\
\mathbf{if}\;m \leq -0.00046 \lor \neg \left(m \leq 1.55 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{t\_0}}{t\_0}\\
\end{array}
\end{array}
if m < -4.6000000000000001e-4 or 1.55e-24 < m Initial program 85.9%
associate-/l*85.9%
remove-double-neg85.9%
distribute-frac-neg285.9%
distribute-neg-frac285.9%
remove-double-neg85.9%
sqr-neg85.9%
associate-+l+85.9%
sqr-neg85.9%
distribute-rgt-out85.9%
Simplified85.9%
Taylor expanded in k around 0 100.0%
if -4.6000000000000001e-4 < m < 1.55e-24Initial program 92.9%
associate-/l*92.8%
remove-double-neg92.8%
distribute-frac-neg292.8%
distribute-neg-frac292.8%
remove-double-neg92.8%
sqr-neg92.8%
associate-+l+92.8%
sqr-neg92.8%
distribute-rgt-out92.8%
Simplified92.8%
Taylor expanded in m around 0 92.9%
Taylor expanded in k around inf 92.9%
associate-*r/92.9%
metadata-eval92.9%
Simplified92.9%
*-un-lft-identity92.9%
add-sqr-sqrt92.9%
times-frac92.9%
add-sqr-sqrt92.9%
hypot-1-def92.9%
associate-*r*92.9%
sqrt-prod92.9%
sqrt-unprod92.8%
add-sqr-sqrt92.9%
add-sqr-sqrt92.9%
Applied egg-rr99.9%
associate-*l/100.0%
*-lft-identity100.0%
metadata-eval100.0%
distribute-neg-frac100.0%
unsub-neg100.0%
metadata-eval100.0%
distribute-neg-frac100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -1.02e-5) (not (<= m 1.55e-24))) (* a (pow k m)) (/ (/ a (hypot 1.0 k)) (hypot 1.0 k))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -1.02e-5) || !(m <= 1.55e-24)) {
tmp = a * pow(k, m);
} else {
tmp = (a / hypot(1.0, k)) / hypot(1.0, k);
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -1.02e-5) || !(m <= 1.55e-24)) {
tmp = a * Math.pow(k, m);
} else {
tmp = (a / Math.hypot(1.0, k)) / Math.hypot(1.0, k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -1.02e-5) or not (m <= 1.55e-24): tmp = a * math.pow(k, m) else: tmp = (a / math.hypot(1.0, k)) / math.hypot(1.0, k) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -1.02e-5) || !(m <= 1.55e-24)) tmp = Float64(a * (k ^ m)); else tmp = Float64(Float64(a / hypot(1.0, k)) / hypot(1.0, k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -1.02e-5) || ~((m <= 1.55e-24))) tmp = a * (k ^ m); else tmp = (a / hypot(1.0, k)) / hypot(1.0, k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -1.02e-5], N[Not[LessEqual[m, 1.55e-24]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.02 \cdot 10^{-5} \lor \neg \left(m \leq 1.55 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{\mathsf{hypot}\left(1, k\right)}}{\mathsf{hypot}\left(1, k\right)}\\
\end{array}
\end{array}
if m < -1.0200000000000001e-5 or 1.55e-24 < m Initial program 85.9%
associate-/l*85.9%
remove-double-neg85.9%
distribute-frac-neg285.9%
distribute-neg-frac285.9%
remove-double-neg85.9%
sqr-neg85.9%
associate-+l+85.9%
sqr-neg85.9%
distribute-rgt-out85.9%
Simplified85.9%
Taylor expanded in k around 0 100.0%
if -1.0200000000000001e-5 < m < 1.55e-24Initial program 92.9%
associate-/l*92.8%
remove-double-neg92.8%
distribute-frac-neg292.8%
distribute-neg-frac292.8%
remove-double-neg92.8%
sqr-neg92.8%
associate-+l+92.8%
sqr-neg92.8%
distribute-rgt-out92.8%
Simplified92.8%
Taylor expanded in m around 0 92.8%
Taylor expanded in k around inf 91.8%
div-inv91.9%
add-sqr-sqrt91.9%
associate-/r*91.9%
hypot-1-def91.9%
hypot-1-def98.9%
Applied egg-rr98.9%
Final simplification99.7%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 1.55e-24) (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= 1.55e-24) {
tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a * (k ** m)
if (m <= 1.55d-24) then
tmp = t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double tmp;
if (m <= 1.55e-24) {
tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if m <= 1.55e-24: tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (m <= 1.55e-24) tmp = Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); tmp = 0.0; if (m <= 1.55e-24) tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 1.55e-24], N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq 1.55 \cdot 10^{-24}:\\
\;\;\;\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 1.55e-24Initial program 96.7%
if 1.55e-24 < m Initial program 70.9%
associate-/l*70.9%
remove-double-neg70.9%
distribute-frac-neg270.9%
distribute-neg-frac270.9%
remove-double-neg70.9%
sqr-neg70.9%
associate-+l+70.9%
sqr-neg70.9%
distribute-rgt-out70.9%
Simplified70.9%
Taylor expanded in k around 0 100.0%
Final simplification97.8%
(FPCore (a k m) :precision binary64 (if (<= m 1.55e-24) (* 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 <= 1.55e-24) {
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 <= 1.55d-24) 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 <= 1.55e-24) {
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 <= 1.55e-24: 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 <= 1.55e-24) 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 <= 1.55e-24) 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, 1.55e-24], 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 1.55 \cdot 10^{-24}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 1.55e-24Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
if 1.55e-24 < m Initial program 70.9%
associate-/l*70.9%
remove-double-neg70.9%
distribute-frac-neg270.9%
distribute-neg-frac270.9%
remove-double-neg70.9%
sqr-neg70.9%
associate-+l+70.9%
sqr-neg70.9%
distribute-rgt-out70.9%
Simplified70.9%
Taylor expanded in k around 0 100.0%
Final simplification97.8%
(FPCore (a k m) :precision binary64 (if (or (<= m -5800000.0) (not (<= m 1.55e-24))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -5800000.0) || !(m <= 1.55e-24)) {
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 <= (-5800000.0d0)) .or. (.not. (m <= 1.55d-24))) 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 <= -5800000.0) || !(m <= 1.55e-24)) {
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 <= -5800000.0) or not (m <= 1.55e-24): 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 <= -5800000.0) || !(m <= 1.55e-24)) 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 <= -5800000.0) || ~((m <= 1.55e-24))) 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, -5800000.0], N[Not[LessEqual[m, 1.55e-24]], $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 -5800000 \lor \neg \left(m \leq 1.55 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -5.8e6 or 1.55e-24 < m Initial program 85.8%
associate-/l*85.8%
remove-double-neg85.8%
distribute-frac-neg285.8%
distribute-neg-frac285.8%
remove-double-neg85.8%
sqr-neg85.8%
associate-+l+85.8%
sqr-neg85.8%
distribute-rgt-out85.8%
Simplified85.8%
Taylor expanded in k around 0 100.0%
if -5.8e6 < m < 1.55e-24Initial program 93.0%
associate-/l*92.9%
remove-double-neg92.9%
distribute-frac-neg292.9%
distribute-neg-frac292.9%
remove-double-neg92.9%
sqr-neg92.9%
associate-+l+92.9%
sqr-neg92.9%
distribute-rgt-out92.9%
Simplified92.9%
Taylor expanded in m around 0 93.0%
Final simplification97.8%
(FPCore (a k m) :precision binary64 (if (<= m 1.55e-24) (/ 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.55e-24) {
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.55d-24) 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.55e-24) {
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.55e-24: 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.55e-24) 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.55e-24) 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.55e-24], 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.55 \cdot 10^{-24}:\\
\;\;\;\;\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.55e-24Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
Taylor expanded in m around 0 64.0%
if 1.55e-24 < m Initial program 70.9%
associate-/l*70.9%
remove-double-neg70.9%
distribute-frac-neg270.9%
distribute-neg-frac270.9%
remove-double-neg70.9%
sqr-neg70.9%
associate-+l+70.9%
sqr-neg70.9%
distribute-rgt-out70.9%
Simplified70.9%
Taylor expanded in m around 0 3.9%
Taylor expanded in k around 0 39.6%
Taylor expanded in k around inf 39.6%
*-commutative39.6%
Simplified39.6%
Final simplification55.8%
(FPCore (a k m) :precision binary64 (if (<= m 1.55e-24) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.55e-24) {
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 <= 1.55d-24) 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 <= 1.55e-24) {
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 <= 1.55e-24: 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 <= 1.55e-24) 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 <= 1.55e-24) 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, 1.55e-24], 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 1.55 \cdot 10^{-24}:\\
\;\;\;\;\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 < 1.55e-24Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
Taylor expanded in m around 0 64.0%
Taylor expanded in k around inf 63.5%
if 1.55e-24 < m Initial program 70.9%
associate-/l*70.9%
remove-double-neg70.9%
distribute-frac-neg270.9%
distribute-neg-frac270.9%
remove-double-neg70.9%
sqr-neg70.9%
associate-+l+70.9%
sqr-neg70.9%
distribute-rgt-out70.9%
Simplified70.9%
Taylor expanded in m around 0 3.9%
Taylor expanded in k around 0 39.6%
Taylor expanded in k around inf 39.6%
*-commutative39.6%
Simplified39.6%
(FPCore (a k m) :precision binary64 (if (<= m 4.5e+14) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.5e+14) {
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 <= 4.5d+14) 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 <= 4.5e+14) {
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 <= 4.5e+14: 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 <= 4.5e+14) 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 <= 4.5e+14) 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, 4.5e+14], 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 4.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 4.5e14Initial program 95.6%
associate-/l*95.6%
remove-double-neg95.6%
distribute-frac-neg295.6%
distribute-neg-frac295.6%
remove-double-neg95.6%
sqr-neg95.6%
associate-+l+95.6%
sqr-neg95.6%
distribute-rgt-out95.6%
Simplified95.6%
Taylor expanded in m around 0 63.2%
Taylor expanded in k around inf 62.7%
if 4.5e14 < m Initial program 72.0%
associate-/l*72.0%
remove-double-neg72.0%
distribute-frac-neg272.0%
distribute-neg-frac272.0%
remove-double-neg72.0%
sqr-neg72.0%
associate-+l+72.0%
sqr-neg72.0%
distribute-rgt-out72.0%
Simplified72.0%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 13.6%
*-commutative13.6%
Simplified13.6%
(FPCore (a k m) :precision binary64 (if (<= m 4.5e+14) (/ a (+ 1.0 (* k 10.0))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.5e+14) {
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 <= 4.5d+14) 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 <= 4.5e+14) {
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 <= 4.5e+14: 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 <= 4.5e+14) 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 <= 4.5e+14) 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, 4.5e+14], 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 4.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 4.5e14Initial program 95.6%
associate-/l*95.6%
remove-double-neg95.6%
distribute-frac-neg295.6%
distribute-neg-frac295.6%
remove-double-neg95.6%
sqr-neg95.6%
associate-+l+95.6%
sqr-neg95.6%
distribute-rgt-out95.6%
Simplified95.6%
Taylor expanded in m around 0 63.2%
Taylor expanded in k around 0 39.3%
*-commutative39.3%
Simplified39.3%
if 4.5e14 < m Initial program 72.0%
associate-/l*72.0%
remove-double-neg72.0%
distribute-frac-neg272.0%
distribute-neg-frac272.0%
remove-double-neg72.0%
sqr-neg72.0%
associate-+l+72.0%
sqr-neg72.0%
distribute-rgt-out72.0%
Simplified72.0%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 13.6%
*-commutative13.6%
Simplified13.6%
(FPCore (a k m) :precision binary64 (if (<= k 9.5e-20) (* a (+ 1.0 (* k -10.0))) (/ 1.0 (/ k (* a 0.1)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 9.5e-20) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 1.0 / (k / (a * 0.1));
}
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 <= 9.5d-20) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = 1.0d0 / (k / (a * 0.1d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 9.5e-20) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 1.0 / (k / (a * 0.1));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 9.5e-20: tmp = a * (1.0 + (k * -10.0)) else: tmp = 1.0 / (k / (a * 0.1)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 9.5e-20) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(1.0 / Float64(k / Float64(a * 0.1))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 9.5e-20) tmp = a * (1.0 + (k * -10.0)); else tmp = 1.0 / (k / (a * 0.1)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 9.5e-20], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(k / N[(a * 0.1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{k}{a \cdot 0.1}}\\
\end{array}
\end{array}
if k < 9.5e-20Initial program 92.3%
associate-/l*92.3%
remove-double-neg92.3%
distribute-frac-neg292.3%
distribute-neg-frac292.3%
remove-double-neg92.3%
sqr-neg92.3%
associate-+l+92.3%
sqr-neg92.3%
distribute-rgt-out92.3%
Simplified92.3%
Taylor expanded in m around 0 32.4%
Taylor expanded in k around 0 30.1%
*-commutative30.1%
Simplified30.1%
if 9.5e-20 < k Initial program 81.4%
associate-/l*81.3%
remove-double-neg81.3%
distribute-frac-neg281.3%
distribute-neg-frac281.3%
remove-double-neg81.3%
sqr-neg81.3%
associate-+l+81.3%
sqr-neg81.3%
distribute-rgt-out81.3%
Simplified81.3%
Taylor expanded in m around 0 61.7%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in k around inf 28.7%
associate-*r/28.7%
clear-num30.3%
*-commutative30.3%
Applied egg-rr30.3%
(FPCore (a k m) :precision binary64 (if (<= k 9.5e-20) (* a (+ 1.0 (* k -10.0))) (/ 0.1 (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 9.5e-20) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 0.1 / (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 (k <= 9.5d-20) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = 0.1d0 / (k / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 9.5e-20) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 9.5e-20: tmp = a * (1.0 + (k * -10.0)) else: tmp = 0.1 / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 9.5e-20) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(0.1 / Float64(k / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 9.5e-20) tmp = a * (1.0 + (k * -10.0)); else tmp = 0.1 / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 9.5e-20], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 9.5e-20Initial program 92.3%
associate-/l*92.3%
remove-double-neg92.3%
distribute-frac-neg292.3%
distribute-neg-frac292.3%
remove-double-neg92.3%
sqr-neg92.3%
associate-+l+92.3%
sqr-neg92.3%
distribute-rgt-out92.3%
Simplified92.3%
Taylor expanded in m around 0 32.4%
Taylor expanded in k around 0 30.1%
*-commutative30.1%
Simplified30.1%
if 9.5e-20 < k Initial program 81.4%
associate-/l*81.3%
remove-double-neg81.3%
distribute-frac-neg281.3%
distribute-neg-frac281.3%
remove-double-neg81.3%
sqr-neg81.3%
associate-+l+81.3%
sqr-neg81.3%
distribute-rgt-out81.3%
Simplified81.3%
Taylor expanded in m around 0 61.7%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in k around inf 28.7%
clear-num29.6%
un-div-inv29.6%
Applied egg-rr29.6%
(FPCore (a k m) :precision binary64 (if (<= k 9.5e-20) a (/ 0.1 (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 9.5e-20) {
tmp = a;
} else {
tmp = 0.1 / (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 (k <= 9.5d-20) then
tmp = a
else
tmp = 0.1d0 / (k / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 9.5e-20) {
tmp = a;
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 9.5e-20: tmp = a else: tmp = 0.1 / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 9.5e-20) tmp = a; else tmp = Float64(0.1 / Float64(k / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 9.5e-20) tmp = a; else tmp = 0.1 / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 9.5e-20], a, N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 9.5e-20Initial program 92.3%
associate-/l*92.3%
remove-double-neg92.3%
distribute-frac-neg292.3%
distribute-neg-frac292.3%
remove-double-neg92.3%
sqr-neg92.3%
associate-+l+92.3%
sqr-neg92.3%
distribute-rgt-out92.3%
Simplified92.3%
Taylor expanded in m around 0 32.4%
Taylor expanded in k around 0 24.6%
if 9.5e-20 < k Initial program 81.4%
associate-/l*81.3%
remove-double-neg81.3%
distribute-frac-neg281.3%
distribute-neg-frac281.3%
remove-double-neg81.3%
sqr-neg81.3%
associate-+l+81.3%
sqr-neg81.3%
distribute-rgt-out81.3%
Simplified81.3%
Taylor expanded in m around 0 61.7%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in k around inf 28.7%
clear-num29.6%
un-div-inv29.6%
Applied egg-rr29.6%
(FPCore (a k m) :precision binary64 (if (<= k 9.5e-20) a (* 0.1 (/ a k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 9.5e-20) {
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 <= 9.5d-20) 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 <= 9.5e-20) {
tmp = a;
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 9.5e-20: tmp = a else: tmp = 0.1 * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 9.5e-20) 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 <= 9.5e-20) tmp = a; else tmp = 0.1 * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 9.5e-20], a, N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 9.5e-20Initial program 92.3%
associate-/l*92.3%
remove-double-neg92.3%
distribute-frac-neg292.3%
distribute-neg-frac292.3%
remove-double-neg92.3%
sqr-neg92.3%
associate-+l+92.3%
sqr-neg92.3%
distribute-rgt-out92.3%
Simplified92.3%
Taylor expanded in m around 0 32.4%
Taylor expanded in k around 0 24.6%
if 9.5e-20 < k Initial program 81.4%
associate-/l*81.3%
remove-double-neg81.3%
distribute-frac-neg281.3%
distribute-neg-frac281.3%
remove-double-neg81.3%
sqr-neg81.3%
associate-+l+81.3%
sqr-neg81.3%
distribute-rgt-out81.3%
Simplified81.3%
Taylor expanded in m around 0 61.7%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in k around inf 28.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.0%
associate-/l*88.0%
remove-double-neg88.0%
distribute-frac-neg288.0%
distribute-neg-frac288.0%
remove-double-neg88.0%
sqr-neg88.0%
associate-+l+88.0%
sqr-neg88.0%
distribute-rgt-out88.0%
Simplified88.0%
Taylor expanded in m around 0 43.8%
Taylor expanded in k around 0 16.8%
herbie shell --seed 2024175
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))