
(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 (<= k 1.0) (* (pow k m) a) (/ (* a (/ (pow k m) k)) k)))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = pow(k, m) * a;
} else {
tmp = (a * (pow(k, m) / 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 <= 1.0d0) then
tmp = (k ** m) * a
else
tmp = (a * ((k ** m) / k)) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = Math.pow(k, m) * a;
} else {
tmp = (a * (Math.pow(k, m) / k)) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = math.pow(k, m) * a else: tmp = (a * (math.pow(k, m) / k)) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64((k ^ m) * a); else tmp = Float64(Float64(a * Float64((k ^ m) / k)) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.0) tmp = (k ^ m) * a; else tmp = (a * ((k ^ m) / k)) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.0], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(N[(a * N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \frac{{k}^{m}}{k}}{k}\\
\end{array}
\end{array}
if k < 1Initial program 95.6%
associate-*r/95.6%
*-commutative95.6%
sqr-neg95.6%
associate-+l+95.6%
+-commutative95.6%
sqr-neg95.6%
distribute-rgt-out95.6%
fma-def95.6%
+-commutative95.6%
Simplified95.6%
Taylor expanded in k around 0 98.8%
if 1 < k Initial program 83.4%
associate-*r/83.4%
*-commutative83.4%
sqr-neg83.4%
associate-+l+83.4%
+-commutative83.4%
sqr-neg83.4%
distribute-rgt-out83.4%
fma-def83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in k around inf 82.7%
unpow282.7%
Simplified82.7%
*-commutative82.7%
associate-/r*95.3%
associate-*r/99.2%
Applied egg-rr99.2%
Final simplification99.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -2.8e-9) (not (<= m 1.75e-7))) (* (pow k m) a) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -2.8e-9) || !(m <= 1.75e-7)) {
tmp = pow(k, m) * a;
} 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 <= (-2.8d-9)) .or. (.not. (m <= 1.75d-7))) then
tmp = (k ** m) * a
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 <= -2.8e-9) || !(m <= 1.75e-7)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -2.8e-9) or not (m <= 1.75e-7): tmp = math.pow(k, m) * a else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -2.8e-9) || !(m <= 1.75e-7)) tmp = Float64((k ^ m) * a); 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 <= -2.8e-9) || ~((m <= 1.75e-7))) tmp = (k ^ m) * a; else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -2.8e-9], N[Not[LessEqual[m, 1.75e-7]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $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 -2.8 \cdot 10^{-9} \lor \neg \left(m \leq 1.75 \cdot 10^{-7}\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.79999999999999984e-9 or 1.74999999999999992e-7 < m Initial program 89.2%
associate-*r/89.2%
*-commutative89.2%
sqr-neg89.2%
associate-+l+89.2%
+-commutative89.2%
sqr-neg89.2%
distribute-rgt-out89.2%
fma-def89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in k around 0 99.6%
if -2.79999999999999984e-9 < m < 1.74999999999999992e-7Initial program 95.2%
associate-*r/95.2%
*-commutative95.2%
sqr-neg95.2%
associate-+l+95.2%
+-commutative95.2%
sqr-neg95.2%
distribute-rgt-out95.2%
fma-def95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in m around 0 94.5%
Final simplification98.0%
(FPCore (a k m) :precision binary64 (if (<= k 1.0) (* (pow k m) a) (/ a (pow k (- 2.0 m)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = pow(k, m) * a;
} 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 <= 1.0d0) then
tmp = (k ** m) * a
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 <= 1.0) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a / Math.pow(k, (2.0 - m));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = math.pow(k, m) * a else: tmp = a / math.pow(k, (2.0 - m)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64((k ^ m) * a); 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 <= 1.0) tmp = (k ^ m) * a; else tmp = a / (k ^ (2.0 - m)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.0], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[Power[k, N[(2.0 - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(2 - m\right)}}\\
\end{array}
\end{array}
if k < 1Initial program 95.6%
associate-*r/95.6%
*-commutative95.6%
sqr-neg95.6%
associate-+l+95.6%
+-commutative95.6%
sqr-neg95.6%
distribute-rgt-out95.6%
fma-def95.6%
+-commutative95.6%
Simplified95.6%
Taylor expanded in k around 0 98.8%
if 1 < k Initial program 83.4%
associate-*r/83.4%
*-commutative83.4%
sqr-neg83.4%
associate-+l+83.4%
+-commutative83.4%
sqr-neg83.4%
distribute-rgt-out83.4%
fma-def83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in k around inf 82.7%
unpow282.7%
Simplified82.7%
expm1-log1p-u70.1%
expm1-udef58.5%
*-commutative58.5%
clear-num58.5%
un-div-inv58.5%
pow258.5%
pow-div65.8%
Applied egg-rr65.8%
expm1-def77.3%
expm1-log1p95.2%
Simplified95.2%
Final simplification97.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (+ 1.0 (* k 10.0)))))
(if (<= m -0.0245)
(/ a (* k k))
(if (<= m 1.8e-191)
t_0
(if (<= m 2.5e-73)
(/ 1.0 (/ k (/ a k)))
(if (<= m 2900000000000.0) t_0 (* k (* a -10.0))))))))
double code(double a, double k, double m) {
double t_0 = a / (1.0 + (k * 10.0));
double tmp;
if (m <= -0.0245) {
tmp = a / (k * k);
} else if (m <= 1.8e-191) {
tmp = t_0;
} else if (m <= 2.5e-73) {
tmp = 1.0 / (k / (a / k));
} else if (m <= 2900000000000.0) {
tmp = t_0;
} else {
tmp = k * (a * -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) :: t_0
real(8) :: tmp
t_0 = a / (1.0d0 + (k * 10.0d0))
if (m <= (-0.0245d0)) then
tmp = a / (k * k)
else if (m <= 1.8d-191) then
tmp = t_0
else if (m <= 2.5d-73) then
tmp = 1.0d0 / (k / (a / k))
else if (m <= 2900000000000.0d0) then
tmp = t_0
else
tmp = k * (a * (-10.0d0))
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 <= -0.0245) {
tmp = a / (k * k);
} else if (m <= 1.8e-191) {
tmp = t_0;
} else if (m <= 2.5e-73) {
tmp = 1.0 / (k / (a / k));
} else if (m <= 2900000000000.0) {
tmp = t_0;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): t_0 = a / (1.0 + (k * 10.0)) tmp = 0 if m <= -0.0245: tmp = a / (k * k) elif m <= 1.8e-191: tmp = t_0 elif m <= 2.5e-73: tmp = 1.0 / (k / (a / k)) elif m <= 2900000000000.0: tmp = t_0 else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(1.0 + Float64(k * 10.0))) tmp = 0.0 if (m <= -0.0245) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.8e-191) tmp = t_0; elseif (m <= 2.5e-73) tmp = Float64(1.0 / Float64(k / Float64(a / k))); elseif (m <= 2900000000000.0) tmp = t_0; else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (1.0 + (k * 10.0)); tmp = 0.0; if (m <= -0.0245) tmp = a / (k * k); elseif (m <= 1.8e-191) tmp = t_0; elseif (m <= 2.5e-73) tmp = 1.0 / (k / (a / k)); elseif (m <= 2900000000000.0) tmp = t_0; else tmp = k * (a * -10.0); 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, -0.0245], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.8e-191], t$95$0, If[LessEqual[m, 2.5e-73], N[(1.0 / N[(k / N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2900000000000.0], t$95$0, N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{1 + k \cdot 10}\\
\mathbf{if}\;m \leq -0.0245:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.8 \cdot 10^{-191}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;m \leq 2.5 \cdot 10^{-73}:\\
\;\;\;\;\frac{1}{\frac{k}{\frac{a}{k}}}\\
\mathbf{elif}\;m \leq 2900000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -0.024500000000000001Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 28.4%
Taylor expanded in k around inf 60.2%
unpow260.2%
Simplified60.2%
if -0.024500000000000001 < m < 1.8000000000000001e-191 or 2.4999999999999999e-73 < m < 2.9e12Initial program 95.6%
associate-*r/95.6%
*-commutative95.6%
sqr-neg95.6%
associate-+l+95.6%
+-commutative95.6%
sqr-neg95.6%
distribute-rgt-out95.6%
fma-def95.6%
+-commutative95.6%
Simplified95.6%
Taylor expanded in m around 0 90.7%
Taylor expanded in k around 0 66.7%
*-commutative66.7%
Simplified66.7%
if 1.8000000000000001e-191 < m < 2.4999999999999999e-73Initial program 88.4%
associate-*r/88.2%
*-commutative88.2%
sqr-neg88.2%
associate-+l+88.2%
+-commutative88.2%
sqr-neg88.2%
distribute-rgt-out88.3%
fma-def88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in m around 0 88.4%
Taylor expanded in k around inf 66.7%
unpow266.7%
Simplified66.7%
clear-num66.6%
inv-pow66.6%
Applied egg-rr66.6%
unpow-166.6%
associate-/l*78.2%
Simplified78.2%
if 2.9e12 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification46.9%
(FPCore (a k m)
:precision binary64
(if (<= m -5.5e-240)
(* a (/ 1.0 (* k k)))
(if (<= m 9.5e-244)
a
(if (<= m 240000000000.0) (/ 1.0 (/ k (/ a k))) (* k (* a -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.5e-240) {
tmp = a * (1.0 / (k * k));
} else if (m <= 9.5e-244) {
tmp = a;
} else if (m <= 240000000000.0) {
tmp = 1.0 / (k / (a / k));
} else {
tmp = k * (a * -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 <= (-5.5d-240)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 9.5d-244) then
tmp = a
else if (m <= 240000000000.0d0) then
tmp = 1.0d0 / (k / (a / k))
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5.5e-240) {
tmp = a * (1.0 / (k * k));
} else if (m <= 9.5e-244) {
tmp = a;
} else if (m <= 240000000000.0) {
tmp = 1.0 / (k / (a / k));
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.5e-240: tmp = a * (1.0 / (k * k)) elif m <= 9.5e-244: tmp = a elif m <= 240000000000.0: tmp = 1.0 / (k / (a / k)) else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.5e-240) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 9.5e-244) tmp = a; elseif (m <= 240000000000.0) tmp = Float64(1.0 / Float64(k / Float64(a / k))); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5.5e-240) tmp = a * (1.0 / (k * k)); elseif (m <= 9.5e-244) tmp = a; elseif (m <= 240000000000.0) tmp = 1.0 / (k / (a / k)); else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.5e-240], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 9.5e-244], a, If[LessEqual[m, 240000000000.0], N[(1.0 / N[(k / N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.5 \cdot 10^{-240}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 9.5 \cdot 10^{-244}:\\
\;\;\;\;a\\
\mathbf{elif}\;m \leq 240000000000:\\
\;\;\;\;\frac{1}{\frac{k}{\frac{a}{k}}}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -5.49999999999999957e-240Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 89.1%
unpow289.1%
Simplified89.1%
Taylor expanded in m around 0 58.9%
unpow258.9%
Simplified58.9%
if -5.49999999999999957e-240 < m < 9.4999999999999995e-244Initial program 96.1%
associate-*r/96.0%
*-commutative96.0%
sqr-neg96.0%
associate-+l+96.0%
+-commutative96.0%
sqr-neg96.0%
distribute-rgt-out96.0%
fma-def96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in m around 0 96.1%
Taylor expanded in k around 0 60.9%
if 9.4999999999999995e-244 < m < 2.4e11Initial program 88.7%
associate-*r/88.6%
*-commutative88.6%
sqr-neg88.6%
associate-+l+88.6%
+-commutative88.6%
sqr-neg88.6%
distribute-rgt-out88.7%
fma-def88.7%
+-commutative88.7%
Simplified88.7%
Taylor expanded in m around 0 81.6%
Taylor expanded in k around inf 49.6%
unpow249.6%
Simplified49.6%
clear-num49.6%
inv-pow49.6%
Applied egg-rr49.6%
unpow-149.6%
associate-/l*57.8%
Simplified57.8%
if 2.4e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification43.3%
(FPCore (a k m)
:precision binary64
(if (<= m -6.8)
(/ a (* k k))
(if (<= m 240000000000.0)
(/ a (+ 1.0 (* k (+ k 10.0))))
(* k (* a -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -6.8) {
tmp = a / (k * k);
} else if (m <= 240000000000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = k * (a * -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 <= (-6.8d0)) then
tmp = a / (k * k)
else if (m <= 240000000000.0d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -6.8) {
tmp = a / (k * k);
} else if (m <= 240000000000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -6.8: tmp = a / (k * k) elif m <= 240000000000.0: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -6.8) tmp = Float64(a / Float64(k * k)); elseif (m <= 240000000000.0) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -6.8) tmp = a / (k * k); elseif (m <= 240000000000.0) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -6.8], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 240000000000.0], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6.8:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 240000000000:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -6.79999999999999982Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 28.7%
Taylor expanded in k around inf 60.9%
unpow260.9%
Simplified60.9%
if -6.79999999999999982 < m < 2.4e11Initial program 94.3%
associate-*r/94.2%
*-commutative94.2%
sqr-neg94.2%
associate-+l+94.2%
+-commutative94.2%
sqr-neg94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in m around 0 89.3%
if 2.4e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification53.8%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= m -1.4e-238)
t_0
(if (<= m 1.75e-191)
a
(if (<= m 330000000000.0) t_0 (* k (* a -10.0)))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (m <= -1.4e-238) {
tmp = t_0;
} else if (m <= 1.75e-191) {
tmp = a;
} else if (m <= 330000000000.0) {
tmp = t_0;
} else {
tmp = k * (a * -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) :: t_0
real(8) :: tmp
t_0 = a / (k * k)
if (m <= (-1.4d-238)) then
tmp = t_0
else if (m <= 1.75d-191) then
tmp = a
else if (m <= 330000000000.0d0) then
tmp = t_0
else
tmp = k * (a * (-10.0d0))
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 (m <= -1.4e-238) {
tmp = t_0;
} else if (m <= 1.75e-191) {
tmp = a;
} else if (m <= 330000000000.0) {
tmp = t_0;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if m <= -1.4e-238: tmp = t_0 elif m <= 1.75e-191: tmp = a elif m <= 330000000000.0: tmp = t_0 else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (m <= -1.4e-238) tmp = t_0; elseif (m <= 1.75e-191) tmp = a; elseif (m <= 330000000000.0) tmp = t_0; else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (m <= -1.4e-238) tmp = t_0; elseif (m <= 1.75e-191) tmp = a; elseif (m <= 330000000000.0) tmp = t_0; else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.4e-238], t$95$0, If[LessEqual[m, 1.75e-191], a, If[LessEqual[m, 330000000000.0], t$95$0, N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;m \leq -1.4 \cdot 10^{-238}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;m \leq 1.75 \cdot 10^{-191}:\\
\;\;\;\;a\\
\mathbf{elif}\;m \leq 330000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -1.40000000000000002e-238 or 1.75000000000000003e-191 < m < 3.3e11Initial program 97.8%
associate-*r/97.7%
*-commutative97.7%
sqr-neg97.7%
associate-+l+97.7%
+-commutative97.7%
sqr-neg97.7%
distribute-rgt-out97.8%
fma-def97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in m around 0 51.8%
Taylor expanded in k around inf 57.5%
unpow257.5%
Simplified57.5%
if -1.40000000000000002e-238 < m < 1.75000000000000003e-191Initial program 94.1%
associate-*r/94.0%
*-commutative94.0%
sqr-neg94.0%
associate-+l+94.0%
+-commutative94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
fma-def94.0%
+-commutative94.0%
Simplified94.0%
Taylor expanded in m around 0 94.1%
Taylor expanded in k around 0 58.7%
if 3.3e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification42.5%
(FPCore (a k m)
:precision binary64
(if (<= m -1.3e-230)
(/ a (* k k))
(if (<= m 1.6e-248)
a
(if (<= m 240000000000.0) (/ (/ a k) k) (* k (* a -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.3e-230) {
tmp = a / (k * k);
} else if (m <= 1.6e-248) {
tmp = a;
} else if (m <= 240000000000.0) {
tmp = (a / k) / k;
} else {
tmp = k * (a * -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 <= (-1.3d-230)) then
tmp = a / (k * k)
else if (m <= 1.6d-248) then
tmp = a
else if (m <= 240000000000.0d0) then
tmp = (a / k) / k
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.3e-230) {
tmp = a / (k * k);
} else if (m <= 1.6e-248) {
tmp = a;
} else if (m <= 240000000000.0) {
tmp = (a / k) / k;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.3e-230: tmp = a / (k * k) elif m <= 1.6e-248: tmp = a elif m <= 240000000000.0: tmp = (a / k) / k else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.3e-230) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.6e-248) tmp = a; elseif (m <= 240000000000.0) tmp = Float64(Float64(a / k) / k); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.3e-230) tmp = a / (k * k); elseif (m <= 1.6e-248) tmp = a; elseif (m <= 240000000000.0) tmp = (a / k) / k; else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.3e-230], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.6e-248], a, If[LessEqual[m, 240000000000.0], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.3 \cdot 10^{-230}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.6 \cdot 10^{-248}:\\
\;\;\;\;a\\
\mathbf{elif}\;m \leq 240000000000:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -1.3000000000000001e-230Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 44.8%
Taylor expanded in k around inf 58.9%
unpow258.9%
Simplified58.9%
if -1.3000000000000001e-230 < m < 1.60000000000000009e-248Initial program 96.1%
associate-*r/96.0%
*-commutative96.0%
sqr-neg96.0%
associate-+l+96.0%
+-commutative96.0%
sqr-neg96.0%
distribute-rgt-out96.0%
fma-def96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in m around 0 96.1%
Taylor expanded in k around 0 60.9%
if 1.60000000000000009e-248 < m < 2.4e11Initial program 88.7%
associate-*r/88.6%
*-commutative88.6%
sqr-neg88.6%
associate-+l+88.6%
+-commutative88.6%
sqr-neg88.6%
distribute-rgt-out88.7%
fma-def88.7%
+-commutative88.7%
Simplified88.7%
Taylor expanded in m around 0 81.6%
Taylor expanded in k around inf 49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in a around 0 49.6%
unpow249.6%
associate-/l/57.7%
Simplified57.7%
if 2.4e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification43.3%
(FPCore (a k m)
:precision binary64
(if (<= m -4.9e-229)
(* a (/ 1.0 (* k k)))
(if (<= m 5.4e-246)
a
(if (<= m 270000000000.0) (/ (/ a k) k) (* k (* a -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4.9e-229) {
tmp = a * (1.0 / (k * k));
} else if (m <= 5.4e-246) {
tmp = a;
} else if (m <= 270000000000.0) {
tmp = (a / k) / k;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-4.9d-229)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 5.4d-246) then
tmp = a
else if (m <= 270000000000.0d0) then
tmp = (a / k) / k
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -4.9e-229) {
tmp = a * (1.0 / (k * k));
} else if (m <= 5.4e-246) {
tmp = a;
} else if (m <= 270000000000.0) {
tmp = (a / k) / k;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4.9e-229: tmp = a * (1.0 / (k * k)) elif m <= 5.4e-246: tmp = a elif m <= 270000000000.0: tmp = (a / k) / k else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4.9e-229) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 5.4e-246) tmp = a; elseif (m <= 270000000000.0) tmp = Float64(Float64(a / k) / k); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -4.9e-229) tmp = a * (1.0 / (k * k)); elseif (m <= 5.4e-246) tmp = a; elseif (m <= 270000000000.0) tmp = (a / k) / k; else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4.9e-229], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5.4e-246], a, If[LessEqual[m, 270000000000.0], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.9 \cdot 10^{-229}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 5.4 \cdot 10^{-246}:\\
\;\;\;\;a\\
\mathbf{elif}\;m \leq 270000000000:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -4.89999999999999974e-229Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 89.1%
unpow289.1%
Simplified89.1%
Taylor expanded in m around 0 58.9%
unpow258.9%
Simplified58.9%
if -4.89999999999999974e-229 < m < 5.3999999999999998e-246Initial program 96.1%
associate-*r/96.0%
*-commutative96.0%
sqr-neg96.0%
associate-+l+96.0%
+-commutative96.0%
sqr-neg96.0%
distribute-rgt-out96.0%
fma-def96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in m around 0 96.1%
Taylor expanded in k around 0 60.9%
if 5.3999999999999998e-246 < m < 2.7e11Initial program 88.7%
associate-*r/88.6%
*-commutative88.6%
sqr-neg88.6%
associate-+l+88.6%
+-commutative88.6%
sqr-neg88.6%
distribute-rgt-out88.7%
fma-def88.7%
+-commutative88.7%
Simplified88.7%
Taylor expanded in m around 0 81.6%
Taylor expanded in k around inf 49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in a around 0 49.6%
unpow249.6%
associate-/l/57.7%
Simplified57.7%
if 2.7e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification43.3%
(FPCore (a k m) :precision binary64 (if (<= m -6.8) (/ a (* k k)) (if (<= m 3100000000000.0) (/ a (+ 1.0 (* k k))) (* k (* a -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -6.8) {
tmp = a / (k * k);
} else if (m <= 3100000000000.0) {
tmp = a / (1.0 + (k * k));
} else {
tmp = k * (a * -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 <= (-6.8d0)) then
tmp = a / (k * k)
else if (m <= 3100000000000.0d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -6.8) {
tmp = a / (k * k);
} else if (m <= 3100000000000.0) {
tmp = a / (1.0 + (k * k));
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -6.8: tmp = a / (k * k) elif m <= 3100000000000.0: tmp = a / (1.0 + (k * k)) else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -6.8) tmp = Float64(a / Float64(k * k)); elseif (m <= 3100000000000.0) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -6.8) tmp = a / (k * k); elseif (m <= 3100000000000.0) tmp = a / (1.0 + (k * k)); else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -6.8], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 3100000000000.0], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6.8:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 3100000000000:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -6.79999999999999982Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 28.7%
Taylor expanded in k around inf 60.9%
unpow260.9%
Simplified60.9%
if -6.79999999999999982 < m < 3.1e12Initial program 94.3%
associate-*r/94.2%
*-commutative94.2%
sqr-neg94.2%
associate-+l+94.2%
+-commutative94.2%
sqr-neg94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in m around 0 89.3%
Taylor expanded in k around inf 87.2%
unpow287.2%
Simplified87.2%
if 3.1e12 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification53.2%
(FPCore (a k m) :precision binary64 (if (<= m -5.9e-36) (/ a (* k 10.0)) (if (<= m 240000000000.0) a (* k (* a -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.9e-36) {
tmp = a / (k * 10.0);
} else if (m <= 240000000000.0) {
tmp = a;
} else {
tmp = k * (a * -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 <= (-5.9d-36)) then
tmp = a / (k * 10.0d0)
else if (m <= 240000000000.0d0) then
tmp = a
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5.9e-36) {
tmp = a / (k * 10.0);
} else if (m <= 240000000000.0) {
tmp = a;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.9e-36: tmp = a / (k * 10.0) elif m <= 240000000000.0: tmp = a else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.9e-36) tmp = Float64(a / Float64(k * 10.0)); elseif (m <= 240000000000.0) tmp = a; else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5.9e-36) tmp = a / (k * 10.0); elseif (m <= 240000000000.0) tmp = a; else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.9e-36], N[(a / N[(k * 10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 240000000000.0], a, N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.9 \cdot 10^{-36}:\\
\;\;\;\;\frac{a}{k \cdot 10}\\
\mathbf{elif}\;m \leq 240000000000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -5.89999999999999995e-36Initial program 100.0%
associate-*r/100.0%
*-commutative100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 30.0%
Taylor expanded in k around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in k around inf 22.4%
*-commutative22.4%
Simplified22.4%
if -5.89999999999999995e-36 < m < 2.4e11Initial program 94.0%
associate-*r/94.0%
*-commutative94.0%
sqr-neg94.0%
associate-+l+94.0%
+-commutative94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
fma-def94.0%
+-commutative94.0%
Simplified94.0%
Taylor expanded in m around 0 91.0%
Taylor expanded in k around 0 47.3%
if 2.4e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification27.9%
(FPCore (a k m) :precision binary64 (if (<= m 255000000000.0) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 255000000000.0) {
tmp = a;
} else {
tmp = -10.0 * (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 <= 255000000000.0d0) then
tmp = a
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 255000000000.0) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 255000000000.0: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 255000000000.0) tmp = a; else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 255000000000.0) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 255000000000.0], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 255000000000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 2.55e11Initial program 97.0%
associate-*r/97.0%
*-commutative97.0%
sqr-neg97.0%
associate-+l+97.0%
+-commutative97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
fma-def97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in m around 0 60.1%
Taylor expanded in k around 0 25.4%
if 2.55e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
Final simplification22.0%
(FPCore (a k m) :precision binary64 (if (<= m 240000000000.0) a (* k (* a -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 240000000000.0) {
tmp = a;
} else {
tmp = k * (a * -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 <= 240000000000.0d0) then
tmp = a
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 240000000000.0) {
tmp = a;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 240000000000.0: tmp = a else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 240000000000.0) tmp = a; else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 240000000000.0) tmp = a; else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 240000000000.0], a, N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 240000000000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < 2.4e11Initial program 97.0%
associate-*r/97.0%
*-commutative97.0%
sqr-neg97.0%
associate-+l+97.0%
+-commutative97.0%
sqr-neg97.0%
distribute-rgt-out97.0%
fma-def97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in m around 0 60.1%
Taylor expanded in k around 0 25.4%
if 2.4e11 < m Initial program 80.9%
associate-*r/80.9%
*-commutative80.9%
sqr-neg80.9%
associate-+l+80.9%
+-commutative80.9%
sqr-neg80.9%
distribute-rgt-out80.9%
fma-def80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 5.1%
Taylor expanded in k around inf 16.3%
*-commutative16.3%
*-commutative16.3%
associate-*l*16.3%
Simplified16.3%
Final simplification22.0%
(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.1%
associate-*r/91.1%
*-commutative91.1%
sqr-neg91.1%
associate-+l+91.1%
+-commutative91.1%
sqr-neg91.1%
distribute-rgt-out91.1%
fma-def91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in m around 0 39.2%
Taylor expanded in k around 0 17.6%
Final simplification17.6%
herbie shell --seed 2023292
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))