
(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 (* a (pow k m))) (t_1 (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))))) (if (<= t_1 1e+105) t_1 t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 1e+105) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = a * (k ** m)
t_1 = t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))
if (t_1 <= 1d+105) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 1e+105) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)) tmp = 0 if t_1 <= 1e+105: tmp = t_1 else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) t_1 = Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) tmp = 0.0 if (t_1 <= 1e+105) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)); tmp = 0.0; if (t_1 <= 1e+105) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+105], t$95$1, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
t_1 := \frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t_1 \leq 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) < 9.9999999999999994e104Initial program 97.9%
if 9.9999999999999994e104 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 64.7%
Taylor expanded in k around 0 100.0%
Final simplification98.3%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 3.1) (/ t_0 (+ 1.0 (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= 3.1) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a * (k ** m)
if (m <= 3.1d0) then
tmp = t_0 / (1.0d0 + (k * k))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double tmp;
if (m <= 3.1) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if m <= 3.1: tmp = t_0 / (1.0 + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (m <= 3.1) tmp = Float64(t_0 / Float64(1.0 + Float64(k * k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); tmp = 0.0; if (m <= 3.1) tmp = t_0 / (1.0 + (k * k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 3.1], N[(t$95$0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq 3.1:\\
\;\;\;\;\frac{t_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if m < 3.10000000000000009Initial program 97.5%
Taylor expanded in k around 0 96.0%
if 3.10000000000000009 < m Initial program 78.3%
Taylor expanded in k around 0 100.0%
Final simplification97.3%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.00022) (not (<= m 7.2e-35))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.00022) || !(m <= 7.2e-35)) {
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 <= (-0.00022d0)) .or. (.not. (m <= 7.2d-35))) 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 <= -0.00022) || !(m <= 7.2e-35)) {
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 <= -0.00022) or not (m <= 7.2e-35): 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 <= -0.00022) || !(m <= 7.2e-35)) 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 <= -0.00022) || ~((m <= 7.2e-35))) 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, -0.00022], N[Not[LessEqual[m, 7.2e-35]], $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 -0.00022 \lor \neg \left(m \leq 7.2 \cdot 10^{-35}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.20000000000000008e-4 or 7.20000000000000038e-35 < m Initial program 89.3%
Taylor expanded in k around 0 99.4%
if -2.20000000000000008e-4 < m < 7.20000000000000038e-35Initial program 95.1%
clear-num94.9%
inv-pow94.9%
div-inv94.9%
metadata-eval94.9%
unpow-prod-down94.9%
metadata-eval94.9%
inv-pow94.9%
associate-+l+94.9%
+-commutative94.9%
distribute-rgt-out94.9%
fma-def94.9%
+-commutative94.9%
*-commutative94.9%
associate-/r*94.9%
pow-flip94.9%
metadata-eval94.9%
Applied egg-rr94.9%
unpow-194.9%
Simplified94.9%
Taylor expanded in m around 0 94.5%
Final simplification97.7%
(FPCore (a k m) :precision binary64 (if (<= k 2.6e-20) (* a (pow k m)) (/ a (pow k (- 2.0 m)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 2.6e-20) {
tmp = a * pow(k, m);
} else {
tmp = a / pow(k, (2.0 - 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 (k <= 2.6d-20) then
tmp = a * (k ** m)
else
tmp = a / (k ** (2.0d0 - m))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 2.6e-20) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / Math.pow(k, (2.0 - m));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 2.6e-20: tmp = a * math.pow(k, m) else: tmp = a / math.pow(k, (2.0 - m)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 2.6e-20) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / (k ^ Float64(2.0 - m))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 2.6e-20) tmp = a * (k ^ m); else tmp = a / (k ^ (2.0 - m)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 2.6e-20], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[Power[k, N[(2.0 - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.6 \cdot 10^{-20}:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(2 - m\right)}}\\
\end{array}
\end{array}
if k < 2.59999999999999995e-20Initial program 97.5%
Taylor expanded in k around 0 100.0%
if 2.59999999999999995e-20 < k Initial program 80.7%
clear-num80.7%
inv-pow80.7%
div-inv80.7%
metadata-eval80.7%
unpow-prod-down80.7%
metadata-eval80.7%
inv-pow80.7%
associate-+l+80.7%
+-commutative80.7%
distribute-rgt-out80.7%
fma-def80.7%
+-commutative80.7%
*-commutative80.7%
associate-/r*80.7%
pow-flip80.7%
metadata-eval80.7%
Applied egg-rr80.7%
unpow-180.7%
Simplified80.7%
Taylor expanded in k around inf 78.0%
associate-/r*75.9%
unpow275.9%
Simplified75.9%
frac-2neg75.9%
neg-sub075.9%
div-sub63.3%
inv-pow63.3%
metadata-eval63.3%
pow-pow63.3%
metadata-eval63.3%
clear-num63.2%
div-inv63.2%
clear-num63.3%
neg-mul-163.3%
metadata-eval63.3%
times-frac63.3%
metadata-eval63.3%
metadata-eval63.3%
associate-/l/63.3%
*-commutative63.3%
pow263.3%
Applied egg-rr63.2%
div092.6%
neg-sub092.6%
distribute-lft-neg-in92.6%
metadata-eval92.6%
*-lft-identity92.6%
neg-mul-192.6%
Simplified92.6%
Taylor expanded in a around 0 91.8%
exp-to-pow92.6%
Simplified92.6%
Final simplification97.3%
(FPCore (a k m)
:precision binary64
(if (<= m -0.05)
(* k (/ (/ (- a) k) (* k (- k))))
(if (<= m 4.2e+82)
(/ a (+ 1.0 (* k (+ k 10.0))))
(/ (* (* a a) (/ (- -1.0) k)) (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.05) {
tmp = k * ((-a / k) / (k * -k));
} else if (m <= 4.2e+82) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = ((a * a) * (-(-1.0) / k)) / (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.05d0)) then
tmp = k * ((-a / k) / (k * -k))
else if (m <= 4.2d+82) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = ((a * a) * (-(-1.0d0) / k)) / (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.05) {
tmp = k * ((-a / k) / (k * -k));
} else if (m <= 4.2e+82) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = ((a * a) * (-(-1.0) / k)) / (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.05: tmp = k * ((-a / k) / (k * -k)) elif m <= 4.2e+82: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = ((a * a) * (-(-1.0) / k)) / (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.05) tmp = Float64(k * Float64(Float64(Float64(-a) / k) / Float64(k * Float64(-k)))); elseif (m <= 4.2e+82) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(Float64(Float64(a * a) * Float64(Float64(-(-1.0)) / k)) / Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.05) tmp = k * ((-a / k) / (k * -k)); elseif (m <= 4.2e+82) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = ((a * a) * (-(-1.0) / k)) / (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.05], N[(k * N[(N[((-a) / k), $MachinePrecision] / N[(k * (-k)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.2e+82], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * N[((--1.0) / k), $MachinePrecision]), $MachinePrecision] / N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.05:\\
\;\;\;\;k \cdot \frac{\frac{-a}{k}}{k \cdot \left(-k\right)}\\
\mathbf{elif}\;m \leq 4.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(a \cdot a\right) \cdot \frac{--1}{k}}{a \cdot k}\\
\end{array}
\end{array}
if m < -0.050000000000000003Initial program 100.0%
Taylor expanded in m around 0 39.6%
Taylor expanded in k around inf 61.9%
unpow261.9%
Simplified61.9%
Taylor expanded in a around 0 61.9%
unpow261.9%
associate-/r*43.7%
Simplified43.7%
frac-2neg43.7%
neg-sub043.7%
flip--44.8%
metadata-eval44.8%
neg-sub061.9%
distribute-rgt-neg-out61.9%
+-lft-identity61.9%
associate-/r/68.2%
distribute-neg-frac68.2%
distribute-rgt-neg-out68.2%
Applied egg-rr68.2%
if -0.050000000000000003 < m < 4.2e82Initial program 92.3%
clear-num92.1%
inv-pow92.1%
div-inv92.1%
metadata-eval92.1%
unpow-prod-down92.1%
metadata-eval92.1%
inv-pow92.1%
associate-+l+92.1%
+-commutative92.1%
distribute-rgt-out92.1%
fma-def92.1%
+-commutative92.1%
*-commutative92.1%
associate-/r*92.1%
pow-flip92.2%
metadata-eval92.2%
Applied egg-rr92.2%
unpow-192.2%
Simplified92.2%
Taylor expanded in m around 0 79.3%
if 4.2e82 < m Initial program 78.8%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around inf 2.2%
unpow22.2%
Simplified2.2%
frac-2neg2.2%
div-inv2.2%
distribute-rgt-neg-in2.2%
Applied egg-rr2.2%
associate-*r/2.2%
times-frac2.3%
frac-2neg2.3%
remove-double-neg2.3%
distribute-neg-frac2.3%
associate-*l/2.3%
*-commutative2.3%
associate-*l/2.3%
neg-sub02.3%
flip--17.9%
+-lft-identity17.9%
frac-times10.3%
distribute-neg-frac10.3%
metadata-eval10.3%
metadata-eval10.3%
sub0-neg10.3%
*-commutative10.3%
Applied egg-rr10.3%
Final simplification58.0%
(FPCore (a k m)
:precision binary64
(if (<= m -0.85)
(* k (* k (/ (/ (/ (/ a k) k) k) k)))
(if (<= m 2.3e+82)
(/ a (+ 1.0 (* k (+ k 10.0))))
(/ (* (* a a) (/ (- -1.0) k)) (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.85) {
tmp = k * (k * ((((a / k) / k) / k) / k));
} else if (m <= 2.3e+82) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = ((a * a) * (-(-1.0) / k)) / (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.85d0)) then
tmp = k * (k * ((((a / k) / k) / k) / k))
else if (m <= 2.3d+82) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = ((a * a) * (-(-1.0d0) / k)) / (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.85) {
tmp = k * (k * ((((a / k) / k) / k) / k));
} else if (m <= 2.3e+82) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = ((a * a) * (-(-1.0) / k)) / (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.85: tmp = k * (k * ((((a / k) / k) / k) / k)) elif m <= 2.3e+82: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = ((a * a) * (-(-1.0) / k)) / (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.85) tmp = Float64(k * Float64(k * Float64(Float64(Float64(Float64(a / k) / k) / k) / k))); elseif (m <= 2.3e+82) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(Float64(Float64(a * a) * Float64(Float64(-(-1.0)) / k)) / Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.85) tmp = k * (k * ((((a / k) / k) / k) / k)); elseif (m <= 2.3e+82) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = ((a * a) * (-(-1.0) / k)) / (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.85], N[(k * N[(k * N[(N[(N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.3e+82], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * N[((--1.0) / k), $MachinePrecision]), $MachinePrecision] / N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.85:\\
\;\;\;\;k \cdot \left(k \cdot \frac{\frac{\frac{\frac{a}{k}}{k}}{k}}{k}\right)\\
\mathbf{elif}\;m \leq 2.3 \cdot 10^{+82}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(a \cdot a\right) \cdot \frac{--1}{k}}{a \cdot k}\\
\end{array}
\end{array}
if m < -0.849999999999999978Initial program 100.0%
Taylor expanded in m around 0 39.6%
Taylor expanded in k around inf 61.9%
unpow261.9%
Simplified61.9%
Taylor expanded in a around 0 61.9%
unpow261.9%
associate-/r*43.7%
Simplified43.7%
frac-2neg43.7%
neg-sub043.7%
flip3--24.7%
metadata-eval24.7%
+-lft-identity24.7%
associate-/r/28.7%
distribute-neg-frac28.7%
metadata-eval28.7%
sub0-neg33.5%
distribute-rgt-out33.5%
+-commutative33.5%
+-lft-identity33.5%
Applied egg-rr33.5%
associate-*r*81.1%
*-commutative81.1%
*-commutative81.1%
unpow381.1%
distribute-lft-neg-out81.1%
associate-/l/83.5%
associate-/r*81.1%
associate-/r*77.6%
neg-mul-177.6%
neg-mul-177.6%
times-frac77.6%
metadata-eval77.6%
associate-/r*77.6%
*-lft-identity77.6%
Simplified77.6%
if -0.849999999999999978 < m < 2.29999999999999988e82Initial program 92.3%
clear-num92.1%
inv-pow92.1%
div-inv92.1%
metadata-eval92.1%
unpow-prod-down92.1%
metadata-eval92.1%
inv-pow92.1%
associate-+l+92.1%
+-commutative92.1%
distribute-rgt-out92.1%
fma-def92.1%
+-commutative92.1%
*-commutative92.1%
associate-/r*92.1%
pow-flip92.2%
metadata-eval92.2%
Applied egg-rr92.2%
unpow-192.2%
Simplified92.2%
Taylor expanded in m around 0 79.3%
if 2.29999999999999988e82 < m Initial program 78.8%
Taylor expanded in m around 0 3.5%
Taylor expanded in k around inf 2.2%
unpow22.2%
Simplified2.2%
frac-2neg2.2%
div-inv2.2%
distribute-rgt-neg-in2.2%
Applied egg-rr2.2%
associate-*r/2.2%
times-frac2.3%
frac-2neg2.3%
remove-double-neg2.3%
distribute-neg-frac2.3%
associate-*l/2.3%
*-commutative2.3%
associate-*l/2.3%
neg-sub02.3%
flip--17.9%
+-lft-identity17.9%
frac-times10.3%
distribute-neg-frac10.3%
metadata-eval10.3%
metadata-eval10.3%
sub0-neg10.3%
*-commutative10.3%
Applied egg-rr10.3%
Final simplification61.0%
(FPCore (a k m) :precision binary64 (if (<= m -0.17) (* k (/ (/ (- a) k) (* k (- k)))) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.17) {
tmp = k * ((-a / k) / (k * -k));
} 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 <= (-0.17d0)) then
tmp = k * ((-a / k) / (k * -k))
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 <= -0.17) {
tmp = k * ((-a / k) / (k * -k));
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.17: tmp = k * ((-a / k) / (k * -k)) else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.17) tmp = Float64(k * Float64(Float64(Float64(-a) / k) / Float64(k * Float64(-k)))); 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 <= -0.17) tmp = k * ((-a / k) / (k * -k)); else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.17], N[(k * N[(N[((-a) / k), $MachinePrecision] / N[(k * (-k)), $MachinePrecision]), $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 -0.17:\\
\;\;\;\;k \cdot \frac{\frac{-a}{k}}{k \cdot \left(-k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -0.170000000000000012Initial program 100.0%
Taylor expanded in m around 0 39.6%
Taylor expanded in k around inf 61.9%
unpow261.9%
Simplified61.9%
Taylor expanded in a around 0 61.9%
unpow261.9%
associate-/r*43.7%
Simplified43.7%
frac-2neg43.7%
neg-sub043.7%
flip--44.8%
metadata-eval44.8%
neg-sub061.9%
distribute-rgt-neg-out61.9%
+-lft-identity61.9%
associate-/r/68.2%
distribute-neg-frac68.2%
distribute-rgt-neg-out68.2%
Applied egg-rr68.2%
if -0.170000000000000012 < m Initial program 87.2%
clear-num87.1%
inv-pow87.1%
div-inv87.0%
metadata-eval87.0%
unpow-prod-down87.1%
metadata-eval87.1%
inv-pow87.1%
associate-+l+87.1%
+-commutative87.1%
distribute-rgt-out87.1%
fma-def87.1%
+-commutative87.1%
*-commutative87.1%
associate-/r*87.1%
pow-flip87.1%
metadata-eval87.1%
Applied egg-rr87.1%
unpow-187.1%
Simplified87.1%
Taylor expanded in m around 0 50.5%
Final simplification56.2%
(FPCore (a k m) :precision binary64 (if (or (<= k 2.6e-264) (not (<= k 1.38e-5))) (/ a (* k k)) (+ a (* (* a k) -10.0))))
double code(double a, double k, double m) {
double tmp;
if ((k <= 2.6e-264) || !(k <= 1.38e-5)) {
tmp = a / (k * k);
} else {
tmp = a + ((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 ((k <= 2.6d-264) .or. (.not. (k <= 1.38d-5))) then
tmp = a / (k * k)
else
tmp = a + ((a * k) * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((k <= 2.6e-264) || !(k <= 1.38e-5)) {
tmp = a / (k * k);
} else {
tmp = a + ((a * k) * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 2.6e-264) or not (k <= 1.38e-5): tmp = a / (k * k) else: tmp = a + ((a * k) * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 2.6e-264) || !(k <= 1.38e-5)) tmp = Float64(a / Float64(k * k)); else tmp = Float64(a + Float64(Float64(a * k) * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((k <= 2.6e-264) || ~((k <= 1.38e-5))) tmp = a / (k * k); else tmp = a + ((a * k) * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 2.6e-264], N[Not[LessEqual[k, 1.38e-5]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(a * k), $MachinePrecision] * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.6 \cdot 10^{-264} \lor \neg \left(k \leq 1.38 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + \left(a \cdot k\right) \cdot -10\\
\end{array}
\end{array}
if k < 2.6000000000000002e-264 or 1.38e-5 < k Initial program 86.8%
Taylor expanded in m around 0 44.6%
Taylor expanded in k around inf 46.4%
unpow246.4%
Simplified46.4%
if 2.6000000000000002e-264 < k < 1.38e-5Initial program 100.0%
Taylor expanded in m around 0 51.6%
Taylor expanded in k around 0 51.6%
Final simplification48.2%
(FPCore (a k m) :precision binary64 (if (<= k 7.2e-264) (/ 1.0 (/ (* k k) a)) (if (<= k 1.38e-5) (+ a (* (* a k) -10.0)) (/ a (* k k)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 7.2e-264) {
tmp = 1.0 / ((k * k) / a);
} else if (k <= 1.38e-5) {
tmp = a + ((a * k) * -10.0);
} else {
tmp = a / (k * 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 <= 7.2d-264) then
tmp = 1.0d0 / ((k * k) / a)
else if (k <= 1.38d-5) then
tmp = a + ((a * k) * (-10.0d0))
else
tmp = a / (k * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 7.2e-264) {
tmp = 1.0 / ((k * k) / a);
} else if (k <= 1.38e-5) {
tmp = a + ((a * k) * -10.0);
} else {
tmp = a / (k * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 7.2e-264: tmp = 1.0 / ((k * k) / a) elif k <= 1.38e-5: tmp = a + ((a * k) * -10.0) else: tmp = a / (k * k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 7.2e-264) tmp = Float64(1.0 / Float64(Float64(k * k) / a)); elseif (k <= 1.38e-5) tmp = Float64(a + Float64(Float64(a * k) * -10.0)); else tmp = Float64(a / Float64(k * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 7.2e-264) tmp = 1.0 / ((k * k) / a); elseif (k <= 1.38e-5) tmp = a + ((a * k) * -10.0); else tmp = a / (k * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 7.2e-264], N[(1.0 / N[(N[(k * k), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.38e-5], N[(a + N[(N[(a * k), $MachinePrecision] * -10.0), $MachinePrecision]), $MachinePrecision], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 7.2 \cdot 10^{-264}:\\
\;\;\;\;\frac{1}{\frac{k \cdot k}{a}}\\
\mathbf{elif}\;k \leq 1.38 \cdot 10^{-5}:\\
\;\;\;\;a + \left(a \cdot k\right) \cdot -10\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\end{array}
\end{array}
if k < 7.2000000000000004e-264Initial program 94.8%
Taylor expanded in m around 0 27.8%
Taylor expanded in k around inf 35.0%
unpow235.0%
Simplified35.0%
clear-num35.8%
inv-pow35.8%
frac-2neg35.8%
distribute-lft-neg-in35.8%
neg-mul-135.8%
metadata-eval35.8%
times-frac28.6%
frac-2neg28.6%
/-rgt-identity28.6%
Applied egg-rr28.6%
unpow-128.6%
associate-*r/35.8%
Simplified35.8%
if 7.2000000000000004e-264 < k < 1.38e-5Initial program 100.0%
Taylor expanded in m around 0 51.6%
Taylor expanded in k around 0 51.6%
if 1.38e-5 < k Initial program 80.1%
Taylor expanded in m around 0 58.7%
Taylor expanded in k around inf 55.9%
unpow255.9%
Simplified55.9%
Final simplification48.4%
(FPCore (a k m) :precision binary64 (if (<= m -0.068) (* k (/ (/ (/ a k) k) k)) (/ a (+ 1.0 (* k k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.068) {
tmp = k * (((a / k) / k) / k);
} else {
tmp = a / (1.0 + (k * k));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.068d0)) then
tmp = k * (((a / k) / k) / k)
else
tmp = a / (1.0d0 + (k * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.068) {
tmp = k * (((a / k) / k) / k);
} else {
tmp = a / (1.0 + (k * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.068: tmp = k * (((a / k) / k) / k) else: tmp = a / (1.0 + (k * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.068) tmp = Float64(k * Float64(Float64(Float64(a / k) / k) / k)); else tmp = Float64(a / Float64(1.0 + Float64(k * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.068) tmp = k * (((a / k) / k) / k); else tmp = a / (1.0 + (k * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.068], N[(k * N[(N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.068:\\
\;\;\;\;k \cdot \frac{\frac{\frac{a}{k}}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\end{array}
\end{array}
if m < -0.068000000000000005Initial program 100.0%
Taylor expanded in m around 0 39.6%
Taylor expanded in k around inf 61.9%
unpow261.9%
Simplified61.9%
Taylor expanded in a around 0 61.9%
unpow261.9%
associate-/r*43.7%
Simplified43.7%
frac-2neg43.7%
neg-sub043.7%
flip--44.8%
metadata-eval44.8%
neg-sub061.9%
distribute-rgt-neg-out61.9%
+-lft-identity61.9%
associate-/r/68.2%
distribute-neg-frac68.2%
distribute-rgt-neg-out68.2%
Applied egg-rr68.2%
*-commutative68.2%
associate-/l/78.8%
associate-/r*68.2%
neg-mul-168.2%
neg-mul-168.2%
times-frac68.2%
metadata-eval68.2%
associate-/r*65.9%
*-lft-identity65.9%
Simplified65.9%
if -0.068000000000000005 < m Initial program 87.2%
Taylor expanded in m around 0 50.5%
Taylor expanded in k around 0 49.0%
Final simplification54.4%
(FPCore (a k m) :precision binary64 (if (<= m -0.048) (* k (/ (/ (/ a k) k) k)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.048) {
tmp = k * (((a / k) / k) / k);
} 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 <= (-0.048d0)) then
tmp = k * (((a / k) / k) / k)
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 <= -0.048) {
tmp = k * (((a / k) / k) / k);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.048: tmp = k * (((a / k) / k) / k) else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.048) tmp = Float64(k * Float64(Float64(Float64(a / k) / k) / k)); 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 <= -0.048) tmp = k * (((a / k) / k) / k); else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.048], N[(k * N[(N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision] / k), $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 -0.048:\\
\;\;\;\;k \cdot \frac{\frac{\frac{a}{k}}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -0.048000000000000001Initial program 100.0%
Taylor expanded in m around 0 39.6%
Taylor expanded in k around inf 61.9%
unpow261.9%
Simplified61.9%
Taylor expanded in a around 0 61.9%
unpow261.9%
associate-/r*43.7%
Simplified43.7%
frac-2neg43.7%
neg-sub043.7%
flip--44.8%
metadata-eval44.8%
neg-sub061.9%
distribute-rgt-neg-out61.9%
+-lft-identity61.9%
associate-/r/68.2%
distribute-neg-frac68.2%
distribute-rgt-neg-out68.2%
Applied egg-rr68.2%
*-commutative68.2%
associate-/l/78.8%
associate-/r*68.2%
neg-mul-168.2%
neg-mul-168.2%
times-frac68.2%
metadata-eval68.2%
associate-/r*65.9%
*-lft-identity65.9%
Simplified65.9%
if -0.048000000000000001 < m Initial program 87.2%
clear-num87.1%
inv-pow87.1%
div-inv87.0%
metadata-eval87.0%
unpow-prod-down87.1%
metadata-eval87.1%
inv-pow87.1%
associate-+l+87.1%
+-commutative87.1%
distribute-rgt-out87.1%
fma-def87.1%
+-commutative87.1%
*-commutative87.1%
associate-/r*87.1%
pow-flip87.1%
metadata-eval87.1%
Applied egg-rr87.1%
unpow-187.1%
Simplified87.1%
Taylor expanded in m around 0 50.5%
Final simplification55.5%
(FPCore (a k m) :precision binary64 (if (or (<= k 2.7e-264) (not (<= k 1.38e-5))) (/ a (* k k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= 2.7e-264) || !(k <= 1.38e-5)) {
tmp = a / (k * k);
} else {
tmp = a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((k <= 2.7d-264) .or. (.not. (k <= 1.38d-5))) then
tmp = a / (k * k)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((k <= 2.7e-264) || !(k <= 1.38e-5)) {
tmp = a / (k * k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 2.7e-264) or not (k <= 1.38e-5): tmp = a / (k * k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 2.7e-264) || !(k <= 1.38e-5)) tmp = Float64(a / Float64(k * k)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((k <= 2.7e-264) || ~((k <= 1.38e-5))) tmp = a / (k * k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 2.7e-264], N[Not[LessEqual[k, 1.38e-5]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.7 \cdot 10^{-264} \lor \neg \left(k \leq 1.38 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < 2.69999999999999994e-264 or 1.38e-5 < k Initial program 86.8%
Taylor expanded in m around 0 44.6%
Taylor expanded in k around inf 46.4%
unpow246.4%
Simplified46.4%
if 2.69999999999999994e-264 < k < 1.38e-5Initial program 100.0%
Taylor expanded in k around 0 100.0%
Taylor expanded in m around 0 51.6%
Final simplification48.2%
(FPCore (a k m) :precision binary64 (if (<= m -0.36) (/ 1.0 (/ (* k k) a)) (/ a (+ 1.0 (* k k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.36) {
tmp = 1.0 / ((k * k) / a);
} else {
tmp = a / (1.0 + (k * k));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.36d0)) then
tmp = 1.0d0 / ((k * k) / a)
else
tmp = a / (1.0d0 + (k * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.36) {
tmp = 1.0 / ((k * k) / a);
} else {
tmp = a / (1.0 + (k * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.36: tmp = 1.0 / ((k * k) / a) else: tmp = a / (1.0 + (k * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.36) tmp = Float64(1.0 / Float64(Float64(k * k) / a)); else tmp = Float64(a / Float64(1.0 + Float64(k * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.36) tmp = 1.0 / ((k * k) / a); else tmp = a / (1.0 + (k * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.36], N[(1.0 / N[(N[(k * k), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.36:\\
\;\;\;\;\frac{1}{\frac{k \cdot k}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\end{array}
\end{array}
if m < -0.35999999999999999Initial program 100.0%
Taylor expanded in m around 0 39.6%
Taylor expanded in k around inf 61.9%
unpow261.9%
Simplified61.9%
clear-num62.6%
inv-pow62.6%
frac-2neg62.6%
distribute-lft-neg-in62.6%
neg-mul-162.6%
metadata-eval62.6%
times-frac44.4%
frac-2neg44.4%
/-rgt-identity44.4%
Applied egg-rr44.4%
unpow-144.4%
associate-*r/62.6%
Simplified62.6%
if -0.35999999999999999 < m Initial program 87.2%
Taylor expanded in m around 0 50.5%
Taylor expanded in k around 0 49.0%
Final simplification53.4%
(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 91.3%
Taylor expanded in k around 0 84.1%
Taylor expanded in m around 0 21.8%
Final simplification21.8%
herbie shell --seed 2023297
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))