
(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 15 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 (sqrt (pow k m)))) (if (<= k 1.0) (* a (pow k m)) (/ (* t_0 (* a (/ t_0 k))) k))))
double code(double a, double k, double m) {
double t_0 = sqrt(pow(k, m));
double tmp;
if (k <= 1.0) {
tmp = a * pow(k, m);
} else {
tmp = (t_0 * (a * (t_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) :: t_0
real(8) :: tmp
t_0 = sqrt((k ** m))
if (k <= 1.0d0) then
tmp = a * (k ** m)
else
tmp = (t_0 * (a * (t_0 / k))) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.sqrt(Math.pow(k, m));
double tmp;
if (k <= 1.0) {
tmp = a * Math.pow(k, m);
} else {
tmp = (t_0 * (a * (t_0 / k))) / k;
}
return tmp;
}
def code(a, k, m): t_0 = math.sqrt(math.pow(k, m)) tmp = 0 if k <= 1.0: tmp = a * math.pow(k, m) else: tmp = (t_0 * (a * (t_0 / k))) / k return tmp
function code(a, k, m) t_0 = sqrt((k ^ m)) tmp = 0.0 if (k <= 1.0) tmp = Float64(a * (k ^ m)); else tmp = Float64(Float64(t_0 * Float64(a * Float64(t_0 / k))) / k); end return tmp end
function tmp_2 = code(a, k, m) t_0 = sqrt((k ^ m)); tmp = 0.0; if (k <= 1.0) tmp = a * (k ^ m); else tmp = (t_0 * (a * (t_0 / k))) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[Sqrt[N[Power[k, m], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[k, 1.0], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(a * N[(t$95$0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{k}^{m}}\\
\mathbf{if}\;k \leq 1:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot \left(a \cdot \frac{t_0}{k}\right)}{k}\\
\end{array}
\end{array}
if k < 1Initial program 95.6%
associate-*r/95.6%
associate-+l+95.6%
+-commutative95.6%
distribute-rgt-out95.6%
fma-def95.6%
+-commutative95.6%
Simplified95.6%
Taylor expanded in k around 0 57.4%
exp-to-pow99.2%
Simplified99.2%
if 1 < k Initial program 78.3%
associate-*r/78.3%
associate-+l+78.3%
+-commutative78.3%
distribute-rgt-out78.3%
fma-def78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in k around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-/l*77.2%
associate-*r*77.2%
exp-prod77.2%
mul-1-neg77.2%
log-rec77.2%
associate-/l*87.9%
Simplified87.9%
pow-exp87.9%
remove-double-neg87.9%
pow-to-exp87.9%
add-sqr-sqrt87.9%
associate-/r/87.9%
times-frac93.6%
Applied egg-rr93.6%
associate-*r/93.6%
associate-/r/98.7%
Applied egg-rr98.7%
Final simplification99.0%
(FPCore (a k m) :precision binary64 (if (<= m 0.05) (* (pow k m) (/ a (fma k k (fma k 10.0 1.0)))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.05) {
tmp = pow(k, m) * (a / fma(k, k, fma(k, 10.0, 1.0)));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= 0.05) tmp = Float64((k ^ m) * Float64(a / fma(k, k, fma(k, 10.0, 1.0)))); else tmp = Float64(a * (k ^ m)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, 0.05], N[(N[Power[k, m], $MachinePrecision] * N[(a / N[(k * k + N[(k * 10.0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.05:\\
\;\;\;\;{k}^{m} \cdot \frac{a}{\mathsf{fma}\left(k, k, \mathsf{fma}\left(k, 10, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 0.050000000000000003Initial program 95.8%
associate-*l/95.8%
+-commutative95.8%
fma-def95.8%
+-commutative95.8%
*-commutative95.8%
fma-def95.8%
Simplified95.8%
if 0.050000000000000003 < m Initial program 75.3%
associate-*r/75.3%
associate-+l+75.3%
+-commutative75.3%
distribute-rgt-out75.3%
fma-def75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in k around 0 56.4%
exp-to-pow100.0%
Simplified100.0%
Final simplification97.2%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 0.05) (/ 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 <= 0.05) {
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 <= 0.05d0) 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 <= 0.05) {
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 <= 0.05: 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 <= 0.05) 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 <= 0.05) 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, 0.05], 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 0.05:\\
\;\;\;\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if m < 0.050000000000000003Initial program 95.8%
if 0.050000000000000003 < m Initial program 75.3%
associate-*r/75.3%
associate-+l+75.3%
+-commutative75.3%
distribute-rgt-out75.3%
fma-def75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in k around 0 56.4%
exp-to-pow100.0%
Simplified100.0%
Final simplification97.2%
(FPCore (a k m) :precision binary64 (if (<= m -2.05e-21) (* (/ a k) (/ (pow k m) k)) (if (<= m 0.012) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.05e-21) {
tmp = (a / k) * (pow(k, m) / k);
} else if (m <= 0.012) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-2.05d-21)) then
tmp = (a / k) * ((k ** m) / k)
else if (m <= 0.012d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.05e-21) {
tmp = (a / k) * (Math.pow(k, m) / k);
} else if (m <= 0.012) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.05e-21: tmp = (a / k) * (math.pow(k, m) / k) elif m <= 0.012: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.05e-21) tmp = Float64(Float64(a / k) * Float64((k ^ m) / k)); elseif (m <= 0.012) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.05e-21) tmp = (a / k) * ((k ^ m) / k); elseif (m <= 0.012) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.05e-21], N[(N[(a / k), $MachinePrecision] * N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.012], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.05 \cdot 10^{-21}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{{k}^{m}}{k}\\
\mathbf{elif}\;m \leq 0.012:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -2.04999999999999997e-21Initial program 97.8%
associate-*r/97.8%
associate-+l+97.8%
+-commutative97.8%
distribute-rgt-out97.8%
fma-def97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in k around inf 62.5%
*-commutative62.5%
unpow262.5%
associate-/l*62.5%
associate-*r*62.5%
exp-prod62.5%
mul-1-neg62.5%
log-rec62.5%
associate-/l*64.7%
Simplified64.7%
pow-exp64.7%
remove-double-neg64.7%
pow-to-exp98.8%
add-sqr-sqrt98.8%
associate-/r/98.8%
times-frac98.8%
Applied egg-rr98.8%
Taylor expanded in k around 0 62.5%
exp-to-pow96.6%
*-commutative96.6%
unpow296.6%
times-frac98.8%
Simplified98.8%
if -2.04999999999999997e-21 < m < 0.012Initial program 93.8%
associate-*r/93.7%
associate-+l+93.7%
+-commutative93.7%
distribute-rgt-out93.7%
fma-def93.7%
+-commutative93.7%
Simplified93.7%
Taylor expanded in m around 0 93.1%
if 0.012 < m Initial program 75.3%
associate-*r/75.3%
associate-+l+75.3%
+-commutative75.3%
distribute-rgt-out75.3%
fma-def75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in k around 0 56.4%
exp-to-pow100.0%
Simplified100.0%
Final simplification97.3%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.0058) (not (<= m 0.0116))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.0058) || !(m <= 0.0116)) {
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.0058d0)) .or. (.not. (m <= 0.0116d0))) 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.0058) || !(m <= 0.0116)) {
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.0058) or not (m <= 0.0116): 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.0058) || !(m <= 0.0116)) 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.0058) || ~((m <= 0.0116))) 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.0058], N[Not[LessEqual[m, 0.0116]], $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.0058 \lor \neg \left(m \leq 0.0116\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -0.0058 or 0.0116 < m Initial program 87.3%
associate-*r/87.3%
associate-+l+87.3%
+-commutative87.3%
distribute-rgt-out87.3%
fma-def87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in k around 0 60.2%
exp-to-pow100.0%
Simplified100.0%
if -0.0058 < m < 0.0116Initial program 91.9%
associate-*r/91.9%
associate-+l+91.9%
+-commutative91.9%
distribute-rgt-out91.9%
fma-def91.9%
+-commutative91.9%
Simplified91.9%
Taylor expanded in m around 0 90.8%
Final simplification96.8%
(FPCore (a k m)
:precision binary64
(if (<= m -3.3e+19)
(/ a (* k k))
(if (<= m 0.05)
(/ a (+ 1.0 (* k (+ k 10.0))))
(+ a (* a (+ (* k (* k 100.0)) (* k -10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.3e+19) {
tmp = a / (k * k);
} else if (m <= 0.05) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * ((k * (k * 100.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 <= (-3.3d+19)) then
tmp = a / (k * k)
else if (m <= 0.05d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (a * ((k * (k * 100.0d0)) + (k * (-10.0d0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -3.3e+19) {
tmp = a / (k * k);
} else if (m <= 0.05) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * ((k * (k * 100.0)) + (k * -10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.3e+19: tmp = a / (k * k) elif m <= 0.05: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (a * ((k * (k * 100.0)) + (k * -10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.3e+19) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.05) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(a * Float64(Float64(k * Float64(k * 100.0)) + Float64(k * -10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.3e+19) tmp = a / (k * k); elseif (m <= 0.05) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (a * ((k * (k * 100.0)) + (k * -10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.3e+19], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.05], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(N[(k * N[(k * 100.0), $MachinePrecision]), $MachinePrecision] + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.05:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 100\right) + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -3.3e19Initial program 100.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 m around 0 42.7%
Taylor expanded in k around inf 66.4%
unpow266.4%
Simplified66.4%
if -3.3e19 < m < 0.050000000000000003Initial program 92.3%
associate-*r/92.2%
associate-+l+92.2%
+-commutative92.2%
distribute-rgt-out92.2%
fma-def92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in m around 0 90.2%
if 0.050000000000000003 < m Initial program 75.3%
associate-*r/75.3%
associate-+l+75.3%
+-commutative75.3%
distribute-rgt-out75.3%
fma-def75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 3.0%
*-commutative3.0%
Simplified3.0%
Taylor expanded in k around 0 23.8%
associate-*r*23.8%
metadata-eval23.8%
distribute-lft-neg-in23.8%
*-commutative23.8%
unpow223.8%
associate-*r*23.8%
associate-*l*23.8%
distribute-rgt-out33.2%
+-commutative33.2%
*-commutative33.2%
*-commutative33.2%
distribute-rgt-neg-in33.2%
metadata-eval33.2%
Simplified33.2%
Final simplification64.1%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k 1.75e-298)
t_0
(if (<= k 9.5e-288)
a
(if (<= k 2.35e-253)
t_0
(if (<= k 0.1) (+ a (* -10.0 (* k a))) (/ (/ a k) k)))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 1.75e-298) {
tmp = t_0;
} else if (k <= 9.5e-288) {
tmp = a;
} else if (k <= 2.35e-253) {
tmp = t_0;
} else if (k <= 0.1) {
tmp = a + (-10.0 * (k * a));
} 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 <= 1.75d-298) then
tmp = t_0
else if (k <= 9.5d-288) then
tmp = a
else if (k <= 2.35d-253) then
tmp = t_0
else if (k <= 0.1d0) then
tmp = a + ((-10.0d0) * (k * a))
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 <= 1.75e-298) {
tmp = t_0;
} else if (k <= 9.5e-288) {
tmp = a;
} else if (k <= 2.35e-253) {
tmp = t_0;
} else if (k <= 0.1) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= 1.75e-298: tmp = t_0 elif k <= 9.5e-288: tmp = a elif k <= 2.35e-253: tmp = t_0 elif k <= 0.1: tmp = a + (-10.0 * (k * a)) else: tmp = (a / k) / k return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= 1.75e-298) tmp = t_0; elseif (k <= 9.5e-288) tmp = a; elseif (k <= 2.35e-253) tmp = t_0; elseif (k <= 0.1) tmp = Float64(a + Float64(-10.0 * Float64(k * a))); 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 <= 1.75e-298) tmp = t_0; elseif (k <= 9.5e-288) tmp = a; elseif (k <= 2.35e-253) tmp = t_0; elseif (k <= 0.1) tmp = a + (-10.0 * (k * a)); 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, 1.75e-298], t$95$0, If[LessEqual[k, 9.5e-288], a, If[LessEqual[k, 2.35e-253], t$95$0, If[LessEqual[k, 0.1], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq 1.75 \cdot 10^{-298}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 9.5 \cdot 10^{-288}:\\
\;\;\;\;a\\
\mathbf{elif}\;k \leq 2.35 \cdot 10^{-253}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < 1.7499999999999999e-298 or 9.49999999999999955e-288 < k < 2.34999999999999991e-253Initial program 90.9%
associate-*r/90.9%
associate-+l+90.9%
+-commutative90.9%
distribute-rgt-out90.9%
fma-def90.9%
+-commutative90.9%
Simplified90.9%
Taylor expanded in m around 0 24.6%
Taylor expanded in k around inf 37.6%
unpow237.6%
Simplified37.6%
if 1.7499999999999999e-298 < k < 9.49999999999999955e-288Initial program 100.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 m around 0 90.5%
Taylor expanded in k around 0 90.5%
if 2.34999999999999991e-253 < k < 0.10000000000000001Initial program 100.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 m around 0 52.5%
Taylor expanded in k around 0 51.5%
if 0.10000000000000001 < k Initial program 78.3%
associate-*r/78.3%
associate-+l+78.3%
+-commutative78.3%
distribute-rgt-out78.3%
fma-def78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in k around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-/l*77.2%
associate-*r*77.2%
exp-prod77.2%
mul-1-neg77.2%
log-rec77.2%
associate-/l*87.9%
Simplified87.9%
pow-exp87.9%
remove-double-neg87.9%
pow-to-exp87.9%
add-sqr-sqrt87.9%
associate-/r/87.9%
times-frac93.6%
Applied egg-rr93.6%
associate-*r/93.6%
associate-/r/98.7%
Applied egg-rr98.7%
Taylor expanded in m around 0 56.7%
unpow256.7%
associate-/r*59.8%
Simplified59.8%
Final simplification51.3%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (+ 1.0 (* k 10.0)))))
(if (<= m -1.05e-61)
(/ a (* k k))
(if (<= m 6e-200)
t_0
(if (<= m 7.5e-157)
(/ (/ a k) k)
(if (<= m 0.85) t_0 (* 0.1 (* k a))))))))
double code(double a, double k, double m) {
double t_0 = a / (1.0 + (k * 10.0));
double tmp;
if (m <= -1.05e-61) {
tmp = a / (k * k);
} else if (m <= 6e-200) {
tmp = t_0;
} else if (m <= 7.5e-157) {
tmp = (a / k) / k;
} else if (m <= 0.85) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = a / (1.0d0 + (k * 10.0d0))
if (m <= (-1.05d-61)) then
tmp = a / (k * k)
else if (m <= 6d-200) then
tmp = t_0
else if (m <= 7.5d-157) then
tmp = (a / k) / k
else if (m <= 0.85d0) then
tmp = t_0
else
tmp = 0.1d0 * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a / (1.0 + (k * 10.0));
double tmp;
if (m <= -1.05e-61) {
tmp = a / (k * k);
} else if (m <= 6e-200) {
tmp = t_0;
} else if (m <= 7.5e-157) {
tmp = (a / k) / k;
} else if (m <= 0.85) {
tmp = t_0;
} else {
tmp = 0.1 * (k * a);
}
return tmp;
}
def code(a, k, m): t_0 = a / (1.0 + (k * 10.0)) tmp = 0 if m <= -1.05e-61: tmp = a / (k * k) elif m <= 6e-200: tmp = t_0 elif m <= 7.5e-157: tmp = (a / k) / k elif m <= 0.85: tmp = t_0 else: tmp = 0.1 * (k * a) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(1.0 + Float64(k * 10.0))) tmp = 0.0 if (m <= -1.05e-61) tmp = Float64(a / Float64(k * k)); elseif (m <= 6e-200) tmp = t_0; elseif (m <= 7.5e-157) tmp = Float64(Float64(a / k) / k); elseif (m <= 0.85) tmp = t_0; else tmp = Float64(0.1 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (1.0 + (k * 10.0)); tmp = 0.0; if (m <= -1.05e-61) tmp = a / (k * k); elseif (m <= 6e-200) tmp = t_0; elseif (m <= 7.5e-157) tmp = (a / k) / k; elseif (m <= 0.85) tmp = t_0; else tmp = 0.1 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.05e-61], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 6e-200], t$95$0, If[LessEqual[m, 7.5e-157], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 0.85], t$95$0, N[(0.1 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{1 + k \cdot 10}\\
\mathbf{if}\;m \leq -1.05 \cdot 10^{-61}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 6 \cdot 10^{-200}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;m \leq 7.5 \cdot 10^{-157}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\mathbf{elif}\;m \leq 0.85:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -1.05e-61Initial program 97.8%
associate-*r/97.8%
associate-+l+97.8%
+-commutative97.8%
distribute-rgt-out97.8%
fma-def97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in m around 0 44.8%
Taylor expanded in k around inf 65.4%
unpow265.4%
Simplified65.4%
if -1.05e-61 < m < 5.99999999999999989e-200 or 7.500000000000001e-157 < m < 0.849999999999999978Initial program 95.1%
associate-*r/95.1%
associate-+l+95.0%
+-commutative95.0%
distribute-rgt-out95.1%
fma-def95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in m around 0 93.3%
Taylor expanded in k around 0 70.5%
*-commutative70.5%
Simplified70.5%
if 5.99999999999999989e-200 < m < 7.500000000000001e-157Initial program 78.5%
associate-*r/78.5%
associate-+l+78.5%
+-commutative78.5%
distribute-rgt-out78.5%
fma-def78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in k around inf 65.4%
*-commutative65.4%
unpow265.4%
associate-/l*65.4%
associate-*r*65.4%
exp-prod65.4%
mul-1-neg65.4%
log-rec65.4%
associate-/l*78.9%
Simplified78.9%
pow-exp78.9%
remove-double-neg78.9%
pow-to-exp78.9%
add-sqr-sqrt78.9%
associate-/r/78.9%
times-frac86.4%
Applied egg-rr86.4%
associate-*r/86.4%
associate-/r/86.4%
Applied egg-rr86.4%
Taylor expanded in m around 0 65.4%
unpow265.4%
associate-/r*86.6%
Simplified86.6%
if 0.849999999999999978 < m Initial program 75.0%
associate-*r/75.0%
associate-+l+75.0%
+-commutative75.0%
distribute-rgt-out75.0%
fma-def75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in m around 0 2.8%
*-commutative2.8%
add-exp-log1.5%
remove-double-neg1.5%
exp-neg1.5%
neg-log1.5%
add-exp-log2.8%
un-div-inv2.8%
add-exp-log1.5%
neg-log1.5%
add-sqr-sqrt0.9%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod1.2%
add-sqr-sqrt5.7%
add-exp-log13.3%
Applied egg-rr13.3%
Taylor expanded in k around 0 22.0%
Final simplification53.3%
(FPCore (a k m)
:precision binary64
(if (or (<= k 1.8e-298)
(not (or (<= k 9.4e-289) (and (not (<= k 2.55e-253)) (<= k 1.0)))))
(/ a (* k k))
a))
double code(double a, double k, double m) {
double tmp;
if ((k <= 1.8e-298) || !((k <= 9.4e-289) || (!(k <= 2.55e-253) && (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.8d-298) .or. (.not. (k <= 9.4d-289) .or. (.not. (k <= 2.55d-253)) .and. (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.8e-298) || !((k <= 9.4e-289) || (!(k <= 2.55e-253) && (k <= 1.0)))) {
tmp = a / (k * k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 1.8e-298) or not ((k <= 9.4e-289) or (not (k <= 2.55e-253) and (k <= 1.0))): tmp = a / (k * k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 1.8e-298) || !((k <= 9.4e-289) || (!(k <= 2.55e-253) && (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.8e-298) || ~(((k <= 9.4e-289) || (~((k <= 2.55e-253)) && (k <= 1.0))))) tmp = a / (k * k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 1.8e-298], N[Not[Or[LessEqual[k, 9.4e-289], And[N[Not[LessEqual[k, 2.55e-253]], $MachinePrecision], LessEqual[k, 1.0]]]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.8 \cdot 10^{-298} \lor \neg \left(k \leq 9.4 \cdot 10^{-289} \lor \neg \left(k \leq 2.55 \cdot 10^{-253}\right) \land k \leq 1\right):\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < 1.80000000000000001e-298 or 9.39999999999999934e-289 < k < 2.55000000000000004e-253 or 1 < k Initial program 83.9%
associate-*r/83.8%
associate-+l+83.8%
+-commutative83.8%
distribute-rgt-out83.8%
fma-def83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in m around 0 43.2%
Taylor expanded in k around inf 48.3%
unpow248.3%
Simplified48.3%
if 1.80000000000000001e-298 < k < 9.39999999999999934e-289 or 2.55000000000000004e-253 < k < 1Initial program 100.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 m around 0 54.8%
Taylor expanded in k around 0 53.2%
Final simplification49.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k 9.5e-299)
t_0
(if (<= k 5.8e-287)
a
(if (<= k 1.2e-253) t_0 (if (<= k 1.0) a (/ (/ a k) k)))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 9.5e-299) {
tmp = t_0;
} else if (k <= 5.8e-287) {
tmp = a;
} else if (k <= 1.2e-253) {
tmp = t_0;
} else if (k <= 1.0) {
tmp = a;
} 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 <= 9.5d-299) then
tmp = t_0
else if (k <= 5.8d-287) then
tmp = a
else if (k <= 1.2d-253) then
tmp = t_0
else if (k <= 1.0d0) then
tmp = a
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 <= 9.5e-299) {
tmp = t_0;
} else if (k <= 5.8e-287) {
tmp = a;
} else if (k <= 1.2e-253) {
tmp = t_0;
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= 9.5e-299: tmp = t_0 elif k <= 5.8e-287: tmp = a elif k <= 1.2e-253: tmp = t_0 elif k <= 1.0: tmp = a else: tmp = (a / k) / k return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= 9.5e-299) tmp = t_0; elseif (k <= 5.8e-287) tmp = a; elseif (k <= 1.2e-253) tmp = t_0; elseif (k <= 1.0) tmp = a; 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 <= 9.5e-299) tmp = t_0; elseif (k <= 5.8e-287) tmp = a; elseif (k <= 1.2e-253) tmp = t_0; elseif (k <= 1.0) tmp = a; 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, 9.5e-299], t$95$0, If[LessEqual[k, 5.8e-287], a, If[LessEqual[k, 1.2e-253], t$95$0, If[LessEqual[k, 1.0], a, N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq 9.5 \cdot 10^{-299}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 5.8 \cdot 10^{-287}:\\
\;\;\;\;a\\
\mathbf{elif}\;k \leq 1.2 \cdot 10^{-253}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < 9.5000000000000001e-299 or 5.7999999999999996e-287 < k < 1.20000000000000005e-253Initial program 90.9%
associate-*r/90.9%
associate-+l+90.9%
+-commutative90.9%
distribute-rgt-out90.9%
fma-def90.9%
+-commutative90.9%
Simplified90.9%
Taylor expanded in m around 0 24.6%
Taylor expanded in k around inf 37.6%
unpow237.6%
Simplified37.6%
if 9.5000000000000001e-299 < k < 5.7999999999999996e-287 or 1.20000000000000005e-253 < k < 1Initial program 100.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 m around 0 54.8%
Taylor expanded in k around 0 53.2%
if 1 < k Initial program 78.3%
associate-*r/78.3%
associate-+l+78.3%
+-commutative78.3%
distribute-rgt-out78.3%
fma-def78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in k around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-/l*77.2%
associate-*r*77.2%
exp-prod77.2%
mul-1-neg77.2%
log-rec77.2%
associate-/l*87.9%
Simplified87.9%
pow-exp87.9%
remove-double-neg87.9%
pow-to-exp87.9%
add-sqr-sqrt87.9%
associate-/r/87.9%
times-frac93.6%
Applied egg-rr93.6%
associate-*r/93.6%
associate-/r/98.7%
Applied egg-rr98.7%
Taylor expanded in m around 0 56.7%
unpow256.7%
associate-/r*59.8%
Simplified59.8%
Final simplification51.1%
(FPCore (a k m) :precision binary64 (if (<= m -3.3e+19) (/ a (* k k)) (if (<= m 0.78) (/ a (+ 1.0 (* k (+ k 10.0)))) (* 0.1 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.3e+19) {
tmp = a / (k * k);
} else if (m <= 0.78) {
tmp = a / (1.0 + (k * (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 (m <= (-3.3d+19)) then
tmp = a / (k * k)
else if (m <= 0.78d0) then
tmp = a / (1.0d0 + (k * (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 (m <= -3.3e+19) {
tmp = a / (k * k);
} else if (m <= 0.78) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = 0.1 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.3e+19: tmp = a / (k * k) elif m <= 0.78: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = 0.1 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.3e+19) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.78) tmp = Float64(a / Float64(1.0 + Float64(k * 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 (m <= -3.3e+19) tmp = a / (k * k); elseif (m <= 0.78) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = 0.1 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.3e+19], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.78], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.78:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -3.3e19Initial program 100.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 m around 0 42.7%
Taylor expanded in k around inf 66.4%
unpow266.4%
Simplified66.4%
if -3.3e19 < m < 0.78000000000000003Initial program 92.4%
associate-*r/92.3%
associate-+l+92.3%
+-commutative92.3%
distribute-rgt-out92.3%
fma-def92.3%
+-commutative92.3%
Simplified92.3%
Taylor expanded in m around 0 89.3%
if 0.78000000000000003 < m Initial program 75.0%
associate-*r/75.0%
associate-+l+75.0%
+-commutative75.0%
distribute-rgt-out75.0%
fma-def75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in m around 0 2.8%
*-commutative2.8%
add-exp-log1.5%
remove-double-neg1.5%
exp-neg1.5%
neg-log1.5%
add-exp-log2.8%
un-div-inv2.8%
add-exp-log1.5%
neg-log1.5%
add-sqr-sqrt0.9%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod1.2%
add-sqr-sqrt5.7%
add-exp-log13.3%
Applied egg-rr13.3%
Taylor expanded in k around 0 22.0%
Final simplification60.3%
(FPCore (a k m) :precision binary64 (if (<= m -3.3e+19) (/ a (* k k)) (if (<= m 0.78) (/ a (+ 1.0 (* k k))) (* 0.1 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.3e+19) {
tmp = a / (k * k);
} else if (m <= 0.78) {
tmp = a / (1.0 + (k * k));
} 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 (m <= (-3.3d+19)) then
tmp = a / (k * k)
else if (m <= 0.78d0) then
tmp = a / (1.0d0 + (k * k))
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 (m <= -3.3e+19) {
tmp = a / (k * k);
} else if (m <= 0.78) {
tmp = a / (1.0 + (k * k));
} else {
tmp = 0.1 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.3e+19: tmp = a / (k * k) elif m <= 0.78: tmp = a / (1.0 + (k * k)) else: tmp = 0.1 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.3e+19) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.78) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(0.1 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.3e+19) tmp = a / (k * k); elseif (m <= 0.78) tmp = a / (1.0 + (k * k)); else tmp = 0.1 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.3e+19], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.78], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.78:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -3.3e19Initial program 100.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 m around 0 42.7%
Taylor expanded in k around inf 66.4%
unpow266.4%
Simplified66.4%
if -3.3e19 < m < 0.78000000000000003Initial program 92.4%
associate-*r/92.3%
associate-+l+92.3%
+-commutative92.3%
distribute-rgt-out92.3%
fma-def92.3%
+-commutative92.3%
Simplified92.3%
Taylor expanded in m around 0 89.3%
Taylor expanded in k around inf 86.8%
unpow286.8%
Simplified86.8%
if 0.78000000000000003 < m Initial program 75.0%
associate-*r/75.0%
associate-+l+75.0%
+-commutative75.0%
distribute-rgt-out75.0%
fma-def75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in m around 0 2.8%
*-commutative2.8%
add-exp-log1.5%
remove-double-neg1.5%
exp-neg1.5%
neg-log1.5%
add-exp-log2.8%
un-div-inv2.8%
add-exp-log1.5%
neg-log1.5%
add-sqr-sqrt0.9%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod1.2%
add-sqr-sqrt5.7%
add-exp-log13.3%
Applied egg-rr13.3%
Taylor expanded in k around 0 22.0%
Final simplification59.4%
(FPCore (a k m) :precision binary64 (if (<= m -8e-8) (/ a (* k 10.0)) (if (<= m 0.58) a (* 0.1 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -8e-8) {
tmp = a / (k * 10.0);
} else if (m <= 0.58) {
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 (m <= (-8d-8)) then
tmp = a / (k * 10.0d0)
else if (m <= 0.58d0) 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 (m <= -8e-8) {
tmp = a / (k * 10.0);
} else if (m <= 0.58) {
tmp = a;
} else {
tmp = 0.1 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -8e-8: tmp = a / (k * 10.0) elif m <= 0.58: tmp = a else: tmp = 0.1 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -8e-8) tmp = Float64(a / Float64(k * 10.0)); elseif (m <= 0.58) 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 (m <= -8e-8) tmp = a / (k * 10.0); elseif (m <= 0.58) tmp = a; else tmp = 0.1 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -8e-8], N[(a / N[(k * 10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.58], a, N[(0.1 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -8 \cdot 10^{-8}:\\
\;\;\;\;\frac{a}{k \cdot 10}\\
\mathbf{elif}\;m \leq 0.58:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -8.0000000000000002e-8Initial program 98.8%
associate-*r/98.8%
associate-+l+98.8%
+-commutative98.8%
distribute-rgt-out98.8%
fma-def98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in m around 0 44.5%
Taylor expanded in k around 0 25.2%
*-commutative25.2%
Simplified25.2%
Taylor expanded in k around inf 33.1%
*-commutative33.1%
Simplified33.1%
if -8.0000000000000002e-8 < m < 0.57999999999999996Initial program 92.9%
associate-*r/92.9%
associate-+l+92.9%
+-commutative92.9%
distribute-rgt-out92.9%
fma-def92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in m around 0 90.8%
Taylor expanded in k around 0 50.7%
if 0.57999999999999996 < m Initial program 75.0%
associate-*r/75.0%
associate-+l+75.0%
+-commutative75.0%
distribute-rgt-out75.0%
fma-def75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in m around 0 2.8%
*-commutative2.8%
add-exp-log1.5%
remove-double-neg1.5%
exp-neg1.5%
neg-log1.5%
add-exp-log2.8%
un-div-inv2.8%
add-exp-log1.5%
neg-log1.5%
add-sqr-sqrt0.9%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod1.2%
add-sqr-sqrt5.7%
add-exp-log13.3%
Applied egg-rr13.3%
Taylor expanded in k around 0 22.0%
Final simplification35.6%
(FPCore (a k m) :precision binary64 (if (<= m 0.34) a (* 0.1 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.34) {
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 (m <= 0.34d0) 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 (m <= 0.34) {
tmp = a;
} else {
tmp = 0.1 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.34: tmp = a else: tmp = 0.1 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.34) 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 (m <= 0.34) tmp = a; else tmp = 0.1 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.34], a, N[(0.1 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.34:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 0.340000000000000024Initial program 95.8%
associate-*r/95.8%
associate-+l+95.7%
+-commutative95.7%
distribute-rgt-out95.8%
fma-def95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in m around 0 68.4%
Taylor expanded in k around 0 28.3%
if 0.340000000000000024 < m Initial program 75.0%
associate-*r/75.0%
associate-+l+75.0%
+-commutative75.0%
distribute-rgt-out75.0%
fma-def75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in m around 0 2.8%
*-commutative2.8%
add-exp-log1.5%
remove-double-neg1.5%
exp-neg1.5%
neg-log1.5%
add-exp-log2.8%
un-div-inv2.8%
add-exp-log1.5%
neg-log1.5%
add-sqr-sqrt0.9%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod1.2%
add-sqr-sqrt5.7%
add-exp-log13.3%
Applied egg-rr13.3%
Taylor expanded in k around 0 22.0%
Final simplification26.3%
(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.0%
associate-*r/88.9%
associate-+l+88.9%
+-commutative88.9%
distribute-rgt-out88.9%
fma-def88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in m around 0 46.9%
Taylor expanded in k around 0 20.3%
Final simplification20.3%
herbie shell --seed 2023182
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))