
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m -1.05e-34) (* (/ (pow k m) k) (/ a k)) (if (<= m 5e-8) (/ a (fma k (+ k 10.0) 1.0)) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.05e-34) {
tmp = (pow(k, m) / k) * (a / k);
} else if (m <= 5e-8) {
tmp = a / fma(k, (k + 10.0), 1.0);
} else {
tmp = a * pow(k, m);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -1.05e-34) tmp = Float64(Float64((k ^ m) / k) * Float64(a / k)); elseif (m <= 5e-8) tmp = Float64(a / fma(k, Float64(k + 10.0), 1.0)); else tmp = Float64(a * (k ^ m)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -1.05e-34], N[(N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5e-8], N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.05 \cdot 10^{-34}:\\
\;\;\;\;\frac{{k}^{m}}{k} \cdot \frac{a}{k}\\
\mathbf{elif}\;m \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -1.05e-34Initial program 98.1%
associate-/l*98.1%
associate-+l+98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in k around inf 63.0%
unpow263.0%
associate-/l*63.0%
mul-1-neg63.0%
exp-neg63.0%
log-rec63.0%
distribute-lft-neg-in63.0%
rec-exp63.0%
exp-to-pow97.1%
Simplified97.1%
associate-/r/99.0%
*-commutative99.0%
remove-double-div99.0%
Applied egg-rr99.0%
if -1.05e-34 < m < 4.9999999999999998e-8Initial program 95.7%
associate-/l*95.7%
associate-+l+95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in m around 0 94.6%
+-commutative94.6%
unpow294.6%
distribute-rgt-in94.6%
fma-udef94.6%
Simplified94.6%
if 4.9999999999999998e-8 < m Initial program 72.2%
*-commutative72.2%
associate-*r/65.8%
associate-+l+65.8%
+-commutative65.8%
distribute-rgt-out65.8%
fma-def65.8%
+-commutative65.8%
Simplified65.8%
Taylor expanded in k around 0 100.0%
Final simplification97.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 1e+164)
(* (pow k m) (/ a (fma k (+ k 10.0) 1.0)))
t_0)))
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))) <= 1e+164) {
tmp = pow(k, m) * (a / fma(k, (k + 10.0), 1.0));
} else {
tmp = t_0;
}
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))) <= 1e+164) tmp = Float64((k ^ m) * Float64(a / fma(k, Float64(k + 10.0), 1.0))); else tmp = t_0; end return 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], 1e+164], N[(N[Power[k, m], $MachinePrecision] * N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\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 10^{+164}:\\
\;\;\;\;{k}^{m} \cdot \frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\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))) < 1e164Initial program 97.4%
*-commutative97.4%
associate-*r/97.4%
associate-+l+97.4%
+-commutative97.4%
distribute-rgt-out97.4%
fma-def97.4%
+-commutative97.4%
Simplified97.4%
if 1e164 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 58.5%
*-commutative58.5%
associate-*r/49.1%
associate-+l+49.1%
+-commutative49.1%
distribute-rgt-out49.1%
fma-def49.1%
+-commutative49.1%
Simplified49.1%
Taylor expanded in k around 0 100.0%
Final simplification97.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 1e+164)
(/ a (/ (+ 1.0 (+ (* k k) (* k 10.0))) (pow k m)))
t_0)))
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))) <= 1e+164) {
tmp = a / ((1.0 + ((k * k) + (k * 10.0))) / pow(k, m));
} 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 ((t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))) <= 1d+164) then
tmp = a / ((1.0d0 + ((k * k) + (k * 10.0d0))) / (k ** m))
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 ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+164) {
tmp = a / ((1.0 + ((k * k) + (k * 10.0))) / Math.pow(k, m));
} else {
tmp = t_0;
}
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))) <= 1e+164: tmp = a / ((1.0 + ((k * k) + (k * 10.0))) / math.pow(k, m)) else: tmp = t_0 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))) <= 1e+164) tmp = Float64(a / Float64(Float64(1.0 + Float64(Float64(k * k) + Float64(k * 10.0))) / (k ^ m))); else tmp = t_0; 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))) <= 1e+164) tmp = a / ((1.0 + ((k * k) + (k * 10.0))) / (k ^ m)); 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[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+164], N[(a / N[(N[(1.0 + N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\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 10^{+164}:\\
\;\;\;\;\frac{a}{\frac{1 + \left(k \cdot k + k \cdot 10\right)}{{k}^{m}}}\\
\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))) < 1e164Initial program 97.4%
associate-/l*97.4%
associate-+l+97.4%
*-commutative97.4%
Simplified97.4%
if 1e164 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 58.5%
*-commutative58.5%
associate-*r/49.1%
associate-+l+49.1%
+-commutative49.1%
distribute-rgt-out49.1%
fma-def49.1%
+-commutative49.1%
Simplified49.1%
Taylor expanded in k around 0 100.0%
Final simplification97.9%
(FPCore (a k m) :precision binary64 (if (<= k 1.0) (* a (pow k m)) (/ a (/ k (/ (/ 1.0 (/ 1.0 (pow k m))) k)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = a * pow(k, m);
} else {
tmp = a / (k / ((1.0 / (1.0 / pow(k, m))) / 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 <= 1.0d0) then
tmp = a * (k ** m)
else
tmp = a / (k / ((1.0d0 / (1.0d0 / (k ** m))) / k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / (k / ((1.0 / (1.0 / Math.pow(k, m))) / k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = a * math.pow(k, m) else: tmp = a / (k / ((1.0 / (1.0 / math.pow(k, m))) / k)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(k / Float64(Float64(1.0 / Float64(1.0 / (k ^ m))) / k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.0) tmp = a * (k ^ m); else tmp = a / (k / ((1.0 / (1.0 / (k ^ m))) / k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.0], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(k / N[(N[(1.0 / N[(1.0 / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{k}{\frac{\frac{1}{\frac{1}{{k}^{m}}}}{k}}}\\
\end{array}
\end{array}
if k < 1Initial program 96.4%
*-commutative96.4%
associate-*r/94.6%
associate-+l+94.6%
+-commutative94.6%
distribute-rgt-out94.6%
fma-def94.6%
+-commutative94.6%
Simplified94.6%
Taylor expanded in k around 0 98.7%
if 1 < k Initial program 75.8%
associate-/l*75.8%
associate-+l+75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in k around inf 74.3%
unpow274.3%
associate-/l*92.5%
mul-1-neg92.5%
exp-neg92.5%
log-rec92.5%
distribute-lft-neg-in92.5%
rec-exp92.5%
exp-to-pow92.5%
Simplified92.5%
Final simplification96.6%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.025) (not (<= m 8.2e-8))) (* a (pow k m)) (/ a (fma k (+ k 10.0) 1.0))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.025) || !(m <= 8.2e-8)) {
tmp = a * pow(k, m);
} else {
tmp = a / fma(k, (k + 10.0), 1.0);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if ((m <= -0.025) || !(m <= 8.2e-8)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / fma(k, Float64(k + 10.0), 1.0)); end return tmp end
code[a_, k_, m_] := If[Or[LessEqual[m, -0.025], N[Not[LessEqual[m, 8.2e-8]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.025 \lor \neg \left(m \leq 8.2 \cdot 10^{-8}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\end{array}
\end{array}
if m < -0.025000000000000001 or 8.20000000000000063e-8 < m Initial program 87.1%
*-commutative87.1%
associate-*r/84.1%
associate-+l+84.1%
+-commutative84.1%
distribute-rgt-out84.1%
fma-def84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in k around 0 100.0%
if -0.025000000000000001 < m < 8.20000000000000063e-8Initial program 93.8%
associate-/l*93.8%
associate-+l+93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in m around 0 92.2%
+-commutative92.2%
unpow292.2%
distribute-rgt-in92.2%
fma-udef92.2%
Simplified92.2%
Final simplification97.4%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.00025) (not (<= m 2.15e-7))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.00025) || !(m <= 2.15e-7)) {
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.00025d0)) .or. (.not. (m <= 2.15d-7))) 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.00025) || !(m <= 2.15e-7)) {
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.00025) or not (m <= 2.15e-7): 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.00025) || !(m <= 2.15e-7)) 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.00025) || ~((m <= 2.15e-7))) 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.00025], N[Not[LessEqual[m, 2.15e-7]], $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.00025 \lor \neg \left(m \leq 2.15 \cdot 10^{-7}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.5000000000000001e-4 or 2.1500000000000001e-7 < m Initial program 87.1%
*-commutative87.1%
associate-*r/84.1%
associate-+l+84.1%
+-commutative84.1%
distribute-rgt-out84.1%
fma-def84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in k around 0 100.0%
if -2.5000000000000001e-4 < m < 2.1500000000000001e-7Initial program 93.8%
associate-/l*93.8%
associate-+l+93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in m around 0 92.2%
+-commutative92.2%
unpow292.2%
distribute-rgt-in92.2%
fma-udef92.2%
Simplified92.2%
Taylor expanded in a around 0 92.2%
Final simplification97.4%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k -5e-310)
t_0
(if (<= k 1.0) a (if (<= k 1.7e+196) t_0 (* (/ a k) (/ 1.0 k)))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= -5e-310) {
tmp = t_0;
} else if (k <= 1.0) {
tmp = a;
} else if (k <= 1.7e+196) {
tmp = t_0;
} else {
tmp = (a / k) * (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = a / (k * k)
if (k <= (-5d-310)) then
tmp = t_0
else if (k <= 1.0d0) then
tmp = a
else if (k <= 1.7d+196) then
tmp = t_0
else
tmp = (a / k) * (1.0d0 / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= -5e-310) {
tmp = t_0;
} else if (k <= 1.0) {
tmp = a;
} else if (k <= 1.7e+196) {
tmp = t_0;
} else {
tmp = (a / k) * (1.0 / k);
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= -5e-310: tmp = t_0 elif k <= 1.0: tmp = a elif k <= 1.7e+196: tmp = t_0 else: tmp = (a / k) * (1.0 / k) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= -5e-310) tmp = t_0; elseif (k <= 1.0) tmp = a; elseif (k <= 1.7e+196) tmp = t_0; else tmp = Float64(Float64(a / k) * Float64(1.0 / k)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (k <= -5e-310) tmp = t_0; elseif (k <= 1.0) tmp = a; elseif (k <= 1.7e+196) tmp = t_0; else tmp = (a / k) * (1.0 / k); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -5e-310], t$95$0, If[LessEqual[k, 1.0], a, If[LessEqual[k, 1.7e+196], t$95$0, N[(N[(a / k), $MachinePrecision] * N[(1.0 / k), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{elif}\;k \leq 1.7 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{1}{k}\\
\end{array}
\end{array}
if k < -4.999999999999985e-310 or 1 < k < 1.7e196Initial program 90.9%
associate-/l*91.0%
associate-+l+91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in k around inf 37.4%
unpow237.4%
associate-/l*41.5%
mul-1-neg41.5%
exp-neg41.5%
log-rec41.5%
distribute-lft-neg-in41.5%
rec-exp41.5%
exp-to-pow98.9%
Simplified98.9%
Taylor expanded in m around 0 40.6%
unpow240.6%
Simplified40.6%
if -4.999999999999985e-310 < k < 1Initial program 100.0%
*-commutative100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 97.8%
Taylor expanded in m around 0 49.8%
if 1.7e196 < k Initial program 54.9%
associate-/l*54.9%
associate-+l+54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in k around inf 54.9%
unpow254.9%
associate-/l*85.4%
mul-1-neg85.4%
exp-neg85.4%
log-rec85.4%
distribute-lft-neg-in85.4%
rec-exp85.4%
exp-to-pow85.4%
Simplified85.4%
Taylor expanded in m around 0 55.3%
unpow255.3%
Simplified55.3%
associate-/r*66.9%
div-inv66.9%
Applied egg-rr66.9%
Final simplification47.8%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k 1.4e-302)
t_0
(if (<= k 0.082)
(+ a (* -10.0 (* a k)))
(if (<= k 1.55e+196) t_0 (* (/ a k) (/ 1.0 k)))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 1.4e-302) {
tmp = t_0;
} else if (k <= 0.082) {
tmp = a + (-10.0 * (a * k));
} else if (k <= 1.55e+196) {
tmp = t_0;
} else {
tmp = (a / k) * (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = a / (k * k)
if (k <= 1.4d-302) then
tmp = t_0
else if (k <= 0.082d0) then
tmp = a + ((-10.0d0) * (a * k))
else if (k <= 1.55d+196) then
tmp = t_0
else
tmp = (a / k) * (1.0d0 / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 1.4e-302) {
tmp = t_0;
} else if (k <= 0.082) {
tmp = a + (-10.0 * (a * k));
} else if (k <= 1.55e+196) {
tmp = t_0;
} else {
tmp = (a / k) * (1.0 / k);
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= 1.4e-302: tmp = t_0 elif k <= 0.082: tmp = a + (-10.0 * (a * k)) elif k <= 1.55e+196: tmp = t_0 else: tmp = (a / k) * (1.0 / k) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= 1.4e-302) tmp = t_0; elseif (k <= 0.082) tmp = Float64(a + Float64(-10.0 * Float64(a * k))); elseif (k <= 1.55e+196) tmp = t_0; else tmp = Float64(Float64(a / k) * Float64(1.0 / k)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (k <= 1.4e-302) tmp = t_0; elseif (k <= 0.082) tmp = a + (-10.0 * (a * k)); elseif (k <= 1.55e+196) tmp = t_0; else tmp = (a / k) * (1.0 / k); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.4e-302], t$95$0, If[LessEqual[k, 0.082], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.55e+196], t$95$0, N[(N[(a / k), $MachinePrecision] * N[(1.0 / k), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 0.082:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\mathbf{elif}\;k \leq 1.55 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{1}{k}\\
\end{array}
\end{array}
if k < 1.4e-302 or 0.0820000000000000034 < k < 1.55000000000000005e196Initial program 90.9%
associate-/l*91.0%
associate-+l+91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in k around inf 37.4%
unpow237.4%
associate-/l*41.5%
mul-1-neg41.5%
exp-neg41.5%
log-rec41.5%
distribute-lft-neg-in41.5%
rec-exp41.5%
exp-to-pow98.9%
Simplified98.9%
Taylor expanded in m around 0 40.6%
unpow240.6%
Simplified40.6%
if 1.4e-302 < k < 0.0820000000000000034Initial program 100.0%
*-commutative100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 98.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in m around 0 50.8%
if 1.55000000000000005e196 < k Initial program 54.9%
associate-/l*54.9%
associate-+l+54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in k around inf 54.9%
unpow254.9%
associate-/l*85.4%
mul-1-neg85.4%
exp-neg85.4%
log-rec85.4%
distribute-lft-neg-in85.4%
rec-exp85.4%
exp-to-pow85.4%
Simplified85.4%
Taylor expanded in m around 0 55.3%
unpow255.3%
Simplified55.3%
associate-/r*66.9%
div-inv66.9%
Applied egg-rr66.9%
Final simplification48.2%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k 6.6e-308)
t_0
(if (<= k 1.0) a (if (<= k 2.6e+196) t_0 (/ (/ a k) k))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 6.6e-308) {
tmp = t_0;
} else if (k <= 1.0) {
tmp = a;
} else if (k <= 2.6e+196) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = a / (k * k)
if (k <= 6.6d-308) then
tmp = t_0
else if (k <= 1.0d0) then
tmp = a
else if (k <= 2.6d+196) then
tmp = t_0
else
tmp = (a / k) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 6.6e-308) {
tmp = t_0;
} else if (k <= 1.0) {
tmp = a;
} else if (k <= 2.6e+196) {
tmp = t_0;
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= 6.6e-308: tmp = t_0 elif k <= 1.0: tmp = a elif k <= 2.6e+196: tmp = t_0 else: tmp = (a / k) / k return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= 6.6e-308) tmp = t_0; elseif (k <= 1.0) tmp = a; elseif (k <= 2.6e+196) tmp = t_0; else tmp = Float64(Float64(a / k) / k); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (k <= 6.6e-308) tmp = t_0; elseif (k <= 1.0) tmp = a; elseif (k <= 2.6e+196) tmp = t_0; else tmp = (a / k) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 6.6e-308], t$95$0, If[LessEqual[k, 1.0], a, If[LessEqual[k, 2.6e+196], t$95$0, N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq 6.6 \cdot 10^{-308}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{elif}\;k \leq 2.6 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < 6.5999999999999996e-308 or 1 < k < 2.60000000000000012e196Initial program 90.9%
associate-/l*91.0%
associate-+l+91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in k around inf 37.4%
unpow237.4%
associate-/l*41.5%
mul-1-neg41.5%
exp-neg41.5%
log-rec41.5%
distribute-lft-neg-in41.5%
rec-exp41.5%
exp-to-pow98.9%
Simplified98.9%
Taylor expanded in m around 0 40.6%
unpow240.6%
Simplified40.6%
if 6.5999999999999996e-308 < k < 1Initial program 100.0%
*-commutative100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 97.8%
Taylor expanded in m around 0 49.8%
if 2.60000000000000012e196 < k Initial program 54.9%
associate-/l*54.9%
associate-+l+54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in k around inf 54.9%
unpow254.9%
associate-/l*85.4%
mul-1-neg85.4%
exp-neg85.4%
log-rec85.4%
distribute-lft-neg-in85.4%
rec-exp85.4%
exp-to-pow85.4%
Simplified85.4%
Taylor expanded in m around 0 55.3%
unpow255.3%
Simplified55.3%
associate-/r*66.9%
div-inv66.9%
Applied egg-rr66.9%
un-div-inv66.9%
Applied egg-rr66.9%
Final simplification47.8%
(FPCore (a k m) :precision binary64 (if (<= m -5.4e-43) (/ a (* k k)) (if (<= m 3.3e+31) (/ a (+ 1.0 (* k 10.0))) (+ a (* -10.0 (* a k))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.4e-43) {
tmp = a / (k * k);
} else if (m <= 3.3e+31) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-10.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 <= (-5.4d-43)) then
tmp = a / (k * k)
else if (m <= 3.3d+31) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a + ((-10.0d0) * (a * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5.4e-43) {
tmp = a / (k * k);
} else if (m <= 3.3e+31) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.4e-43: tmp = a / (k * k) elif m <= 3.3e+31: tmp = a / (1.0 + (k * 10.0)) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.4e-43) tmp = Float64(a / Float64(k * k)); elseif (m <= 3.3e+31) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5.4e-43) tmp = a / (k * k); elseif (m <= 3.3e+31) tmp = a / (1.0 + (k * 10.0)); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.4e-43], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 3.3e+31], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.4 \cdot 10^{-43}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 3.3 \cdot 10^{+31}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -5.39999999999999982e-43Initial program 98.1%
associate-/l*98.1%
associate-+l+98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in k around inf 62.9%
unpow262.9%
associate-/l*62.8%
mul-1-neg62.8%
exp-neg62.8%
log-rec62.8%
distribute-lft-neg-in62.8%
rec-exp62.8%
exp-to-pow96.2%
Simplified96.2%
Taylor expanded in m around 0 64.0%
unpow264.0%
Simplified64.0%
if -5.39999999999999982e-43 < m < 3.29999999999999992e31Initial program 93.6%
associate-/l*93.6%
associate-+l+93.6%
*-commutative93.6%
Simplified93.6%
Taylor expanded in m around 0 87.3%
+-commutative87.3%
unpow287.3%
distribute-rgt-in87.3%
fma-udef87.4%
Simplified87.4%
Taylor expanded in a around 0 87.3%
Taylor expanded in k around 0 68.7%
*-commutative68.7%
Simplified68.7%
if 3.29999999999999992e31 < m Initial program 72.2%
*-commutative72.2%
associate-*r/65.3%
associate-+l+65.3%
+-commutative65.3%
distribute-rgt-out65.3%
fma-def65.3%
+-commutative65.3%
Simplified65.3%
Taylor expanded in k around 0 76.4%
associate-*r*76.4%
Simplified76.4%
Taylor expanded in m around 0 8.4%
Final simplification49.9%
(FPCore (a k m) :precision binary64 (if (<= m -0.14) (/ a (* k k)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.14) {
tmp = a / (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.14d0)) then
tmp = a / (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.14) {
tmp = a / (k * k);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.14: tmp = a / (k * k) else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.14) tmp = Float64(a / Float64(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.14) tmp = a / (k * k); else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.14], N[(a / N[(k * 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.14:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -0.14000000000000001Initial program 100.0%
associate-/l*100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 63.7%
unpow263.7%
associate-/l*63.7%
mul-1-neg63.7%
exp-neg63.7%
log-rec63.7%
distribute-lft-neg-in63.7%
rec-exp63.7%
exp-to-pow100.0%
Simplified100.0%
Taylor expanded in m around 0 65.2%
unpow265.2%
Simplified65.2%
if -0.14000000000000001 < m Initial program 83.4%
associate-/l*83.4%
associate-+l+83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in m around 0 49.7%
+-commutative49.7%
unpow249.7%
distribute-rgt-in49.7%
fma-udef49.7%
Simplified49.7%
Taylor expanded in a around 0 49.7%
Final simplification55.2%
(FPCore (a k m) :precision binary64 (if (or (<= k 1.3e-303) (not (<= k 1.0))) (/ a (* k k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= 1.3e-303) || !(k <= 1.0)) {
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 <= 1.3d-303) .or. (.not. (k <= 1.0d0))) 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 <= 1.3e-303) || !(k <= 1.0)) {
tmp = a / (k * k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 1.3e-303) or not (k <= 1.0): tmp = a / (k * k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 1.3e-303) || !(k <= 1.0)) 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 <= 1.3e-303) || ~((k <= 1.0))) tmp = a / (k * k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 1.3e-303], N[Not[LessEqual[k, 1.0]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.3 \cdot 10^{-303} \lor \neg \left(k \leq 1\right):\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < 1.30000000000000002e-303 or 1 < k Initial program 82.7%
associate-/l*82.7%
associate-+l+82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in k around inf 41.4%
unpow241.4%
associate-/l*51.5%
mul-1-neg51.5%
exp-neg51.5%
log-rec51.5%
distribute-lft-neg-in51.5%
rec-exp51.5%
exp-to-pow95.8%
Simplified95.8%
Taylor expanded in m around 0 44.0%
unpow244.0%
Simplified44.0%
if 1.30000000000000002e-303 < k < 1Initial program 100.0%
*-commutative100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 97.8%
Taylor expanded in m around 0 49.8%
Final simplification46.2%
(FPCore (a k m) :precision binary64 (if (<= m -0.6) (/ a (* k k)) (/ a (+ 1.0 (* k k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.6) {
tmp = a / (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.6d0)) then
tmp = a / (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.6) {
tmp = a / (k * k);
} else {
tmp = a / (1.0 + (k * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.6: tmp = a / (k * k) else: tmp = a / (1.0 + (k * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.6) tmp = Float64(a / Float64(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.6) tmp = a / (k * k); else tmp = a / (1.0 + (k * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.6], N[(a / N[(k * 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.6:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\end{array}
\end{array}
if m < -0.599999999999999978Initial program 100.0%
associate-/l*100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 63.7%
unpow263.7%
associate-/l*63.7%
mul-1-neg63.7%
exp-neg63.7%
log-rec63.7%
distribute-lft-neg-in63.7%
rec-exp63.7%
exp-to-pow100.0%
Simplified100.0%
Taylor expanded in m around 0 65.2%
unpow265.2%
Simplified65.2%
if -0.599999999999999978 < m Initial program 83.4%
associate-/l*83.4%
associate-+l+83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in m around 0 49.7%
+-commutative49.7%
unpow249.7%
distribute-rgt-in49.7%
fma-udef49.7%
Simplified49.7%
Taylor expanded in a around 0 49.7%
Taylor expanded in k around inf 47.6%
unpow247.6%
Simplified47.6%
Final simplification53.9%
(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 89.3%
*-commutative89.3%
associate-*r/87.4%
associate-+l+87.4%
+-commutative87.4%
distribute-rgt-out87.4%
fma-def87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in k around 0 85.5%
Taylor expanded in m around 0 21.6%
Final simplification21.6%
herbie shell --seed 2023185
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))