
(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 17 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 0.86) (* a (/ (pow k m) (fma k (+ k 10.0) 1.0))) (* a (pow k (- m 2.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.86) {
tmp = a * (pow(k, m) / fma(k, (k + 10.0), 1.0));
} else {
tmp = a * pow(k, (m - 2.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= 0.86) tmp = Float64(a * Float64((k ^ m) / fma(k, Float64(k + 10.0), 1.0))); else tmp = Float64(a * (k ^ Float64(m - 2.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, 0.86], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m - 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.86:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\
\end{array}
\end{array}
if m < 0.859999999999999987Initial program 97.6%
associate-*r/97.6%
associate-+l+97.6%
+-commutative97.6%
distribute-rgt-out97.7%
fma-def97.7%
+-commutative97.7%
Simplified97.7%
if 0.859999999999999987 < m Initial program 82.5%
associate-*r/82.5%
associate-+l+82.5%
+-commutative82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in k around inf 28.4%
mul-1-neg28.4%
exp-neg28.4%
log-rec28.4%
distribute-lft-neg-in28.4%
rec-exp28.4%
exp-to-pow55.4%
unpow255.4%
Simplified55.4%
remove-double-div55.4%
pow255.4%
pow-div99.4%
Applied egg-rr99.4%
Final simplification98.2%
(FPCore (a k m) :precision binary64 (if (<= m 0.85) (/ a (/ (+ 1.0 (* k (+ k 10.0))) (pow k m))) (* a (pow k (- m 2.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.85) {
tmp = a / ((1.0 + (k * (k + 10.0))) / pow(k, m));
} else {
tmp = a * pow(k, (m - 2.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.85d0) then
tmp = a / ((1.0d0 + (k * (k + 10.0d0))) / (k ** m))
else
tmp = a * (k ** (m - 2.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.85) {
tmp = a / ((1.0 + (k * (k + 10.0))) / Math.pow(k, m));
} else {
tmp = a * Math.pow(k, (m - 2.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.85: tmp = a / ((1.0 + (k * (k + 10.0))) / math.pow(k, m)) else: tmp = a * math.pow(k, (m - 2.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.85) tmp = Float64(a / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / (k ^ m))); else tmp = Float64(a * (k ^ Float64(m - 2.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.85) tmp = a / ((1.0 + (k * (k + 10.0))) / (k ^ m)); else tmp = a * (k ^ (m - 2.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.85], N[(a / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m - 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.85:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\
\end{array}
\end{array}
if m < 0.849999999999999978Initial program 97.6%
associate-/l*97.6%
associate-+l+97.6%
*-commutative97.6%
Simplified97.6%
distribute-lft-out97.6%
+-commutative97.6%
*-commutative97.6%
Applied egg-rr97.6%
if 0.849999999999999978 < m Initial program 82.5%
associate-*r/82.5%
associate-+l+82.5%
+-commutative82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in k around inf 28.4%
mul-1-neg28.4%
exp-neg28.4%
log-rec28.4%
distribute-lft-neg-in28.4%
rec-exp28.4%
exp-to-pow55.4%
unpow255.4%
Simplified55.4%
remove-double-div55.4%
pow255.4%
pow-div99.4%
Applied egg-rr99.4%
Final simplification98.2%
(FPCore (a k m) :precision binary64 (if (<= m 0.86) (/ (* a (pow k m)) (+ 1.0 (* k k))) (* a (pow k (- m 2.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.86) {
tmp = (a * pow(k, m)) / (1.0 + (k * k));
} else {
tmp = a * pow(k, (m - 2.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.86d0) then
tmp = (a * (k ** m)) / (1.0d0 + (k * k))
else
tmp = a * (k ** (m - 2.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.86) {
tmp = (a * Math.pow(k, m)) / (1.0 + (k * k));
} else {
tmp = a * Math.pow(k, (m - 2.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.86: tmp = (a * math.pow(k, m)) / (1.0 + (k * k)) else: tmp = a * math.pow(k, (m - 2.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.86) tmp = Float64(Float64(a * (k ^ m)) / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * (k ^ Float64(m - 2.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.86) tmp = (a * (k ^ m)) / (1.0 + (k * k)); else tmp = a * (k ^ (m - 2.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.86], N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m - 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.86:\\
\;\;\;\;\frac{a \cdot {k}^{m}}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\
\end{array}
\end{array}
if m < 0.859999999999999987Initial program 97.6%
Taylor expanded in k around 0 96.5%
if 0.859999999999999987 < m Initial program 82.5%
associate-*r/82.5%
associate-+l+82.5%
+-commutative82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in k around inf 28.4%
mul-1-neg28.4%
exp-neg28.4%
log-rec28.4%
distribute-lft-neg-in28.4%
rec-exp28.4%
exp-to-pow55.4%
unpow255.4%
Simplified55.4%
remove-double-div55.4%
pow255.4%
pow-div99.4%
Applied egg-rr99.4%
Final simplification97.4%
(FPCore (a k m) :precision binary64 (if (or (<= m -8.6e-10) (not (<= m 0.9))) (* a (pow k m)) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -8.6e-10) || !(m <= 0.9)) {
tmp = a * pow(k, m);
} else {
tmp = a * (1.0 / (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 <= (-8.6d-10)) .or. (.not. (m <= 0.9d0))) then
tmp = a * (k ** m)
else
tmp = a * (1.0d0 / (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 <= -8.6e-10) || !(m <= 0.9)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -8.6e-10) or not (m <= 0.9): tmp = a * math.pow(k, m) else: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -8.6e-10) || !(m <= 0.9)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a * Float64(1.0 / 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 <= -8.6e-10) || ~((m <= 0.9))) tmp = a * (k ^ m); else tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -8.6e-10], N[Not[LessEqual[m, 0.9]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -8.6 \cdot 10^{-10} \lor \neg \left(m \leq 0.9\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -8.60000000000000029e-10 or 0.900000000000000022 < m Initial program 91.8%
associate-*r/91.8%
associate-+l+91.8%
+-commutative91.8%
distribute-rgt-out91.8%
fma-def91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in k around 0 52.6%
exp-to-pow99.4%
*-commutative99.4%
Simplified99.4%
if -8.60000000000000029e-10 < m < 0.900000000000000022Initial program 94.2%
associate-*r/94.2%
associate-+l+94.2%
+-commutative94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in m around 0 92.1%
Final simplification97.0%
(FPCore (a k m) :precision binary64 (if (<= k 1.0) (* a (pow k m)) (* a (pow k (- m 2.0)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = a * pow(k, m);
} else {
tmp = a * pow(k, (m - 2.0));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 1.0d0) then
tmp = a * (k ** m)
else
tmp = a * (k ** (m - 2.0d0))
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 * Math.pow(k, (m - 2.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = a * math.pow(k, m) else: tmp = a * math.pow(k, (m - 2.0)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64(a * (k ^ m)); else tmp = Float64(a * (k ^ Float64(m - 2.0))); 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 ^ (m - 2.0)); 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[Power[k, N[(m - 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\
\end{array}
\end{array}
if k < 1Initial program 98.2%
associate-*r/98.2%
associate-+l+98.2%
+-commutative98.2%
distribute-rgt-out98.2%
fma-def98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in k around 0 50.7%
exp-to-pow98.9%
*-commutative98.9%
Simplified98.9%
if 1 < k Initial program 82.3%
associate-*r/82.3%
associate-+l+82.3%
+-commutative82.3%
distribute-rgt-out82.3%
fma-def82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in k around inf 82.2%
mul-1-neg82.2%
exp-neg82.2%
log-rec82.2%
distribute-lft-neg-in82.2%
rec-exp82.2%
exp-to-pow82.2%
unpow282.2%
Simplified82.2%
remove-double-div82.2%
pow282.2%
pow-div94.8%
Applied egg-rr94.8%
Final simplification97.4%
(FPCore (a k m)
:precision binary64
(if (<= m -0.115)
(/ a (* k k))
(if (<= m 2.4)
(* a (/ 1.0 (+ 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 <= -0.115) {
tmp = a / (k * k);
} else if (m <= 2.4) {
tmp = a * (1.0 / (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 <= (-0.115d0)) then
tmp = a / (k * k)
else if (m <= 2.4d0) then
tmp = a * (1.0d0 / (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 <= -0.115) {
tmp = a / (k * k);
} else if (m <= 2.4) {
tmp = a * (1.0 / (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 <= -0.115: tmp = a / (k * k) elif m <= 2.4: tmp = a * (1.0 / (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 <= -0.115) tmp = Float64(a / Float64(k * k)); elseif (m <= 2.4) tmp = Float64(a * Float64(1.0 / 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 <= -0.115) tmp = a / (k * k); elseif (m <= 2.4) tmp = a * (1.0 / (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, -0.115], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.4], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $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 -0.115:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 2.4:\\
\;\;\;\;a \cdot \frac{1}{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 < -0.115000000000000005Initial 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 36.2%
Taylor expanded in k around inf 62.7%
unpow262.7%
Simplified62.7%
if -0.115000000000000005 < m < 2.39999999999999991Initial program 94.2%
associate-*r/94.2%
associate-+l+94.2%
+-commutative94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in m around 0 92.1%
if 2.39999999999999991 < m Initial program 83.3%
Taylor expanded in k around 0 79.8%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 16.2%
+-commutative16.2%
unpow216.2%
associate-*r*16.2%
associate-*r*16.2%
*-commutative16.2%
distribute-rgt-out24.5%
*-commutative24.5%
associate-*l*24.5%
*-commutative24.5%
Simplified24.5%
Final simplification60.0%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k 1.8e-265)
t_0
(if (<= k 6.6e-216)
a
(if (or (<= k 1.05e-179) (not (<= k 0.1)))
t_0
(* a (+ 1.0 (* k -10.0))))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 1.8e-265) {
tmp = t_0;
} else if (k <= 6.6e-216) {
tmp = a;
} else if ((k <= 1.05e-179) || !(k <= 0.1)) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a / (k * k)
if (k <= 1.8d-265) then
tmp = t_0
else if (k <= 6.6d-216) then
tmp = a
else if ((k <= 1.05d-179) .or. (.not. (k <= 0.1d0))) then
tmp = t_0
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 1.8e-265) {
tmp = t_0;
} else if (k <= 6.6e-216) {
tmp = a;
} else if ((k <= 1.05e-179) || !(k <= 0.1)) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= 1.8e-265: tmp = t_0 elif k <= 6.6e-216: tmp = a elif (k <= 1.05e-179) or not (k <= 0.1): tmp = t_0 else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= 1.8e-265) tmp = t_0; elseif (k <= 6.6e-216) tmp = a; elseif ((k <= 1.05e-179) || !(k <= 0.1)) tmp = t_0; else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (k <= 1.8e-265) tmp = t_0; elseif (k <= 6.6e-216) tmp = a; elseif ((k <= 1.05e-179) || ~((k <= 0.1))) tmp = t_0; else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.8e-265], t$95$0, If[LessEqual[k, 6.6e-216], a, If[Or[LessEqual[k, 1.05e-179], N[Not[LessEqual[k, 0.1]], $MachinePrecision]], t$95$0, N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq 1.8 \cdot 10^{-265}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 6.6 \cdot 10^{-216}:\\
\;\;\;\;a\\
\mathbf{elif}\;k \leq 1.05 \cdot 10^{-179} \lor \neg \left(k \leq 0.1\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if k < 1.8000000000000001e-265 or 6.59999999999999937e-216 < k < 1.0499999999999999e-179 or 0.10000000000000001 < k Initial program 90.2%
associate-*r/90.2%
associate-+l+90.2%
+-commutative90.2%
distribute-rgt-out90.2%
fma-def90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in m around 0 38.9%
Taylor expanded in k around inf 47.4%
unpow247.4%
Simplified47.4%
if 1.8000000000000001e-265 < k < 6.59999999999999937e-216Initial 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 74.5%
Taylor expanded in k around 0 74.5%
if 1.0499999999999999e-179 < k < 0.10000000000000001Initial program 99.9%
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 55.6%
Taylor expanded in k around 0 55.6%
Taylor expanded in a around 0 55.6%
*-commutative55.6%
Simplified55.6%
Final simplification50.2%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k 1.9e-265)
t_0
(if (<= k 3.3e-214)
a
(if (<= k 8.2e-180)
t_0
(if (<= k 0.1) (* a (+ 1.0 (* k -10.0))) (* (/ 1.0 k) (/ a k))))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 1.9e-265) {
tmp = t_0;
} else if (k <= 3.3e-214) {
tmp = a;
} else if (k <= 8.2e-180) {
tmp = t_0;
} else if (k <= 0.1) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = (1.0 / k) * (a / k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a / (k * k)
if (k <= 1.9d-265) then
tmp = t_0
else if (k <= 3.3d-214) then
tmp = a
else if (k <= 8.2d-180) then
tmp = t_0
else if (k <= 0.1d0) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = (1.0d0 / k) * (a / 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.9e-265) {
tmp = t_0;
} else if (k <= 3.3e-214) {
tmp = a;
} else if (k <= 8.2e-180) {
tmp = t_0;
} else if (k <= 0.1) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = (1.0 / k) * (a / k);
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= 1.9e-265: tmp = t_0 elif k <= 3.3e-214: tmp = a elif k <= 8.2e-180: tmp = t_0 elif k <= 0.1: tmp = a * (1.0 + (k * -10.0)) else: tmp = (1.0 / k) * (a / k) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= 1.9e-265) tmp = t_0; elseif (k <= 3.3e-214) tmp = a; elseif (k <= 8.2e-180) tmp = t_0; elseif (k <= 0.1) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(Float64(1.0 / k) * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (k <= 1.9e-265) tmp = t_0; elseif (k <= 3.3e-214) tmp = a; elseif (k <= 8.2e-180) tmp = t_0; elseif (k <= 0.1) tmp = a * (1.0 + (k * -10.0)); else tmp = (1.0 / k) * (a / 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.9e-265], t$95$0, If[LessEqual[k, 3.3e-214], a, If[LessEqual[k, 8.2e-180], t$95$0, If[LessEqual[k, 0.1], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq 1.9 \cdot 10^{-265}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 3.3 \cdot 10^{-214}:\\
\;\;\;\;a\\
\mathbf{elif}\;k \leq 8.2 \cdot 10^{-180}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 1.8999999999999999e-265 or 3.2999999999999998e-214 < k < 8.2e-180Initial program 97.1%
associate-*r/97.1%
associate-+l+97.1%
+-commutative97.1%
distribute-rgt-out97.1%
fma-def97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in m around 0 20.1%
Taylor expanded in k around inf 35.9%
unpow235.9%
Simplified35.9%
if 1.8999999999999999e-265 < k < 3.2999999999999998e-214Initial 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 74.5%
Taylor expanded in k around 0 74.5%
if 8.2e-180 < k < 0.10000000000000001Initial program 99.9%
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 55.6%
Taylor expanded in k around 0 55.6%
Taylor expanded in a around 0 55.6%
*-commutative55.6%
Simplified55.6%
if 0.10000000000000001 < k Initial program 82.3%
associate-*r/82.3%
associate-+l+82.3%
+-commutative82.3%
distribute-rgt-out82.3%
fma-def82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in m around 0 60.5%
Taylor expanded in k around inf 60.5%
unpow260.5%
Simplified60.5%
*-un-lft-identity60.5%
times-frac64.8%
Applied egg-rr64.8%
Final simplification51.7%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k))))
(if (<= k 1.75e-265)
t_0
(if (<= k 4e-218)
a
(if (<= k 1.25e-179)
t_0
(if (<= k 0.1) (+ a (* -10.0 (* a k))) (* (/ 1.0 k) (/ a k))))))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= 1.75e-265) {
tmp = t_0;
} else if (k <= 4e-218) {
tmp = a;
} else if (k <= 1.25e-179) {
tmp = t_0;
} else if (k <= 0.1) {
tmp = a + (-10.0 * (a * k));
} else {
tmp = (1.0 / k) * (a / k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a / (k * k)
if (k <= 1.75d-265) then
tmp = t_0
else if (k <= 4d-218) then
tmp = a
else if (k <= 1.25d-179) then
tmp = t_0
else if (k <= 0.1d0) then
tmp = a + ((-10.0d0) * (a * k))
else
tmp = (1.0d0 / k) * (a / 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-265) {
tmp = t_0;
} else if (k <= 4e-218) {
tmp = a;
} else if (k <= 1.25e-179) {
tmp = t_0;
} else if (k <= 0.1) {
tmp = a + (-10.0 * (a * k));
} else {
tmp = (1.0 / k) * (a / k);
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * k) tmp = 0 if k <= 1.75e-265: tmp = t_0 elif k <= 4e-218: tmp = a elif k <= 1.25e-179: tmp = t_0 elif k <= 0.1: tmp = a + (-10.0 * (a * k)) else: tmp = (1.0 / k) * (a / k) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= 1.75e-265) tmp = t_0; elseif (k <= 4e-218) tmp = a; elseif (k <= 1.25e-179) tmp = t_0; elseif (k <= 0.1) tmp = Float64(a + Float64(-10.0 * Float64(a * k))); else tmp = Float64(Float64(1.0 / k) * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * k); tmp = 0.0; if (k <= 1.75e-265) tmp = t_0; elseif (k <= 4e-218) tmp = a; elseif (k <= 1.25e-179) tmp = t_0; elseif (k <= 0.1) tmp = a + (-10.0 * (a * k)); else tmp = (1.0 / k) * (a / 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-265], t$95$0, If[LessEqual[k, 4e-218], a, If[LessEqual[k, 1.25e-179], t$95$0, If[LessEqual[k, 0.1], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq 1.75 \cdot 10^{-265}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 4 \cdot 10^{-218}:\\
\;\;\;\;a\\
\mathbf{elif}\;k \leq 1.25 \cdot 10^{-179}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 1.75000000000000008e-265 or 4.0000000000000001e-218 < k < 1.2499999999999999e-179Initial program 97.1%
associate-*r/97.1%
associate-+l+97.1%
+-commutative97.1%
distribute-rgt-out97.1%
fma-def97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in m around 0 20.1%
Taylor expanded in k around inf 35.9%
unpow235.9%
Simplified35.9%
if 1.75000000000000008e-265 < k < 4.0000000000000001e-218Initial 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 74.5%
Taylor expanded in k around 0 74.5%
if 1.2499999999999999e-179 < k < 0.10000000000000001Initial program 99.9%
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 55.6%
Taylor expanded in k around 0 55.6%
if 0.10000000000000001 < k Initial program 82.3%
associate-*r/82.3%
associate-+l+82.3%
+-commutative82.3%
distribute-rgt-out82.3%
fma-def82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in m around 0 60.5%
Taylor expanded in k around inf 60.5%
unpow260.5%
Simplified60.5%
*-un-lft-identity60.5%
times-frac64.8%
Applied egg-rr64.8%
Final simplification51.7%
(FPCore (a k m) :precision binary64 (if (<= m -0.115) (/ a (* k k)) (if (<= m 1.15) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0))))) (* k (* a 10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.115) {
tmp = a / (k * k);
} else if (m <= 1.15) {
tmp = a * (1.0 / (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 <= (-0.115d0)) then
tmp = a / (k * k)
else if (m <= 1.15d0) then
tmp = a * (1.0d0 / (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 <= -0.115) {
tmp = a / (k * k);
} else if (m <= 1.15) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = k * (a * 10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.115: tmp = a / (k * k) elif m <= 1.15: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) else: tmp = k * (a * 10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.115) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.15) tmp = Float64(a * Float64(1.0 / 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 <= -0.115) tmp = a / (k * k); elseif (m <= 1.15) tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); else tmp = k * (a * 10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.115], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.15], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * 10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.115:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.15:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot 10\right)\\
\end{array}
\end{array}
if m < -0.115000000000000005Initial 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 36.2%
Taylor expanded in k around inf 62.7%
unpow262.7%
Simplified62.7%
if -0.115000000000000005 < m < 1.1499999999999999Initial program 94.2%
associate-*r/94.2%
associate-+l+94.2%
+-commutative94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in m around 0 92.1%
if 1.1499999999999999 < m Initial program 83.3%
associate-*r/83.3%
associate-+l+83.3%
+-commutative83.3%
distribute-rgt-out83.3%
fma-def83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 6.2%
Taylor expanded in a around 0 6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in k around inf 18.1%
*-commutative18.1%
*-commutative18.1%
associate-*r*18.1%
rem-square-sqrt13.4%
fabs-sqr13.4%
rem-square-sqrt27.1%
*-lft-identity27.1%
fabs-mul27.1%
*-lft-identity27.1%
rem-square-sqrt13.7%
fabs-sqr13.7%
rem-square-sqrt23.0%
metadata-eval23.0%
associate-*l*23.0%
*-commutative23.0%
associate-*l*23.0%
Simplified23.0%
Final simplification59.5%
(FPCore (a k m)
:precision binary64
(if (or (<= k 1.95e-265)
(and (not (<= k 4.4e-214))
(or (<= k 3.3e-180) (not (<= k 32500000.0)))))
(/ a (* k k))
a))
double code(double a, double k, double m) {
double tmp;
if ((k <= 1.95e-265) || (!(k <= 4.4e-214) && ((k <= 3.3e-180) || !(k <= 32500000.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.95d-265) .or. (.not. (k <= 4.4d-214)) .and. (k <= 3.3d-180) .or. (.not. (k <= 32500000.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.95e-265) || (!(k <= 4.4e-214) && ((k <= 3.3e-180) || !(k <= 32500000.0)))) {
tmp = a / (k * k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 1.95e-265) or (not (k <= 4.4e-214) and ((k <= 3.3e-180) or not (k <= 32500000.0))): tmp = a / (k * k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 1.95e-265) || (!(k <= 4.4e-214) && ((k <= 3.3e-180) || !(k <= 32500000.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.95e-265) || (~((k <= 4.4e-214)) && ((k <= 3.3e-180) || ~((k <= 32500000.0))))) tmp = a / (k * k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 1.95e-265], And[N[Not[LessEqual[k, 4.4e-214]], $MachinePrecision], Or[LessEqual[k, 3.3e-180], N[Not[LessEqual[k, 32500000.0]], $MachinePrecision]]]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.95 \cdot 10^{-265} \lor \neg \left(k \leq 4.4 \cdot 10^{-214}\right) \land \left(k \leq 3.3 \cdot 10^{-180} \lor \neg \left(k \leq 32500000\right)\right):\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < 1.9499999999999999e-265 or 4.40000000000000003e-214 < k < 3.29999999999999998e-180 or 3.25e7 < k Initial program 90.1%
associate-*r/90.1%
associate-+l+90.1%
+-commutative90.1%
distribute-rgt-out90.1%
fma-def90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in m around 0 39.3%
Taylor expanded in k around inf 47.8%
unpow247.8%
Simplified47.8%
if 1.9499999999999999e-265 < k < 4.40000000000000003e-214 or 3.29999999999999998e-180 < k < 3.25e7Initial 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 57.1%
Taylor expanded in k around 0 55.8%
Final simplification49.9%
(FPCore (a k m) :precision binary64 (if (<= m -0.115) (/ a (* k k)) (if (<= m 1.4) (/ a (+ 1.0 (* k (+ k 10.0)))) (* k (* a 10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.115) {
tmp = a / (k * k);
} else if (m <= 1.4) {
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 <= (-0.115d0)) then
tmp = a / (k * k)
else if (m <= 1.4d0) 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 <= -0.115) {
tmp = a / (k * k);
} else if (m <= 1.4) {
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 <= -0.115: tmp = a / (k * k) elif m <= 1.4: 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 <= -0.115) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.4) 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 <= -0.115) tmp = a / (k * k); elseif (m <= 1.4) 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, -0.115], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.4], 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 -0.115:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.4:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot 10\right)\\
\end{array}
\end{array}
if m < -0.115000000000000005Initial 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 36.2%
Taylor expanded in k around inf 62.7%
unpow262.7%
Simplified62.7%
if -0.115000000000000005 < m < 1.3999999999999999Initial program 94.2%
associate-*r/94.2%
associate-+l+94.2%
+-commutative94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in m around 0 92.1%
if 1.3999999999999999 < m Initial program 83.3%
associate-*r/83.3%
associate-+l+83.3%
+-commutative83.3%
distribute-rgt-out83.3%
fma-def83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 6.2%
Taylor expanded in a around 0 6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in k around inf 18.1%
*-commutative18.1%
*-commutative18.1%
associate-*r*18.1%
rem-square-sqrt13.4%
fabs-sqr13.4%
rem-square-sqrt27.1%
*-lft-identity27.1%
fabs-mul27.1%
*-lft-identity27.1%
rem-square-sqrt13.7%
fabs-sqr13.7%
rem-square-sqrt23.0%
metadata-eval23.0%
associate-*l*23.0%
*-commutative23.0%
associate-*l*23.0%
Simplified23.0%
Final simplification59.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (/ a k) 0.1)))
(if (<= k -1.75e+183)
t_0
(if (<= k 3e-276) (* -10.0 (* a k)) (if (<= k 32500000.0) a t_0)))))
double code(double a, double k, double m) {
double t_0 = (a / k) * 0.1;
double tmp;
if (k <= -1.75e+183) {
tmp = t_0;
} else if (k <= 3e-276) {
tmp = -10.0 * (a * k);
} else if (k <= 32500000.0) {
tmp = a;
} 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) * 0.1d0
if (k <= (-1.75d+183)) then
tmp = t_0
else if (k <= 3d-276) then
tmp = (-10.0d0) * (a * k)
else if (k <= 32500000.0d0) then
tmp = a
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = (a / k) * 0.1;
double tmp;
if (k <= -1.75e+183) {
tmp = t_0;
} else if (k <= 3e-276) {
tmp = -10.0 * (a * k);
} else if (k <= 32500000.0) {
tmp = a;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = (a / k) * 0.1 tmp = 0 if k <= -1.75e+183: tmp = t_0 elif k <= 3e-276: tmp = -10.0 * (a * k) elif k <= 32500000.0: tmp = a else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(Float64(a / k) * 0.1) tmp = 0.0 if (k <= -1.75e+183) tmp = t_0; elseif (k <= 3e-276) tmp = Float64(-10.0 * Float64(a * k)); elseif (k <= 32500000.0) tmp = a; else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (a / k) * 0.1; tmp = 0.0; if (k <= -1.75e+183) tmp = t_0; elseif (k <= 3e-276) tmp = -10.0 * (a * k); elseif (k <= 32500000.0) tmp = a; else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision]}, If[LessEqual[k, -1.75e+183], t$95$0, If[LessEqual[k, 3e-276], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 32500000.0], a, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k} \cdot 0.1\\
\mathbf{if}\;k \leq -1.75 \cdot 10^{+183}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 3 \cdot 10^{-276}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\mathbf{elif}\;k \leq 32500000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if k < -1.74999999999999994e183 or 3.25e7 < k Initial program 82.1%
Taylor expanded in k around 0 71.6%
Taylor expanded in k around inf 57.5%
*-commutative57.5%
log-rec57.5%
distribute-lft-neg-in57.5%
distribute-rgt-neg-out57.5%
*-commutative57.5%
*-commutative57.5%
distribute-rgt-neg-out57.5%
distribute-lft-neg-out57.5%
*-commutative57.5%
mul-1-neg57.5%
distribute-rgt-neg-out57.5%
distribute-rgt-neg-out57.5%
remove-double-neg57.5%
exp-to-pow71.6%
Simplified71.6%
Taylor expanded in m around 0 32.6%
if -1.74999999999999994e183 < k < 2.99999999999999988e-276Initial 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 3.7%
Taylor expanded in k around 0 4.8%
Taylor expanded in k around inf 15.9%
if 2.99999999999999988e-276 < k < 3.25e7Initial 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 50.2%
Taylor expanded in k around 0 49.2%
Final simplification33.2%
(FPCore (a k m) :precision binary64 (if (<= m -8.2e-12) (/ a (* k k)) (if (<= m 1.75) (/ a (+ 1.0 (* k 10.0))) (* k (* a 10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -8.2e-12) {
tmp = a / (k * k);
} else if (m <= 1.75) {
tmp = a / (1.0 + (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 <= (-8.2d-12)) then
tmp = a / (k * k)
else if (m <= 1.75d0) then
tmp = a / (1.0d0 + (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 <= -8.2e-12) {
tmp = a / (k * k);
} else if (m <= 1.75) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = k * (a * 10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -8.2e-12: tmp = a / (k * k) elif m <= 1.75: tmp = a / (1.0 + (k * 10.0)) else: tmp = k * (a * 10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -8.2e-12) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.75) tmp = Float64(a / Float64(1.0 + 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 <= -8.2e-12) tmp = a / (k * k); elseif (m <= 1.75) tmp = a / (1.0 + (k * 10.0)); else tmp = k * (a * 10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -8.2e-12], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.75], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * 10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -8.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.75:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot 10\right)\\
\end{array}
\end{array}
if m < -8.19999999999999979e-12Initial 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 36.2%
Taylor expanded in k around inf 62.7%
unpow262.7%
Simplified62.7%
if -8.19999999999999979e-12 < m < 1.75Initial program 94.2%
Taylor expanded in k around 0 68.1%
Taylor expanded in m around 0 67.8%
if 1.75 < m Initial program 83.3%
associate-*r/83.3%
associate-+l+83.3%
+-commutative83.3%
distribute-rgt-out83.3%
fma-def83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 6.2%
Taylor expanded in a around 0 6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in k around inf 18.1%
*-commutative18.1%
*-commutative18.1%
associate-*r*18.1%
rem-square-sqrt13.4%
fabs-sqr13.4%
rem-square-sqrt27.1%
*-lft-identity27.1%
fabs-mul27.1%
*-lft-identity27.1%
rem-square-sqrt13.7%
fabs-sqr13.7%
rem-square-sqrt23.0%
metadata-eval23.0%
associate-*l*23.0%
*-commutative23.0%
associate-*l*23.0%
Simplified23.0%
Final simplification51.4%
(FPCore (a k m) :precision binary64 (if (<= m -8.2e-26) (* (/ a k) 0.1) (if (<= m 0.9) a (* k (* a 10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -8.2e-26) {
tmp = (a / k) * 0.1;
} else if (m <= 0.9) {
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 <= (-8.2d-26)) then
tmp = (a / k) * 0.1d0
else if (m <= 0.9d0) 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 <= -8.2e-26) {
tmp = (a / k) * 0.1;
} else if (m <= 0.9) {
tmp = a;
} else {
tmp = k * (a * 10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -8.2e-26: tmp = (a / k) * 0.1 elif m <= 0.9: tmp = a else: tmp = k * (a * 10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -8.2e-26) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 0.9) 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 <= -8.2e-26) tmp = (a / k) * 0.1; elseif (m <= 0.9) tmp = a; else tmp = k * (a * 10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -8.2e-26], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 0.9], a, N[(k * N[(a * 10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -8.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 0.9:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot 10\right)\\
\end{array}
\end{array}
if m < -8.1999999999999997e-26Initial program 100.0%
Taylor expanded in k around 0 98.9%
Taylor expanded in k around inf 52.3%
*-commutative52.3%
log-rec52.3%
distribute-lft-neg-in52.3%
distribute-rgt-neg-out52.3%
*-commutative52.3%
*-commutative52.3%
distribute-rgt-neg-out52.3%
distribute-lft-neg-out52.3%
*-commutative52.3%
mul-1-neg52.3%
distribute-rgt-neg-out52.3%
distribute-rgt-neg-out52.3%
remove-double-neg52.3%
exp-to-pow82.3%
Simplified82.3%
Taylor expanded in m around 0 27.2%
if -8.1999999999999997e-26 < m < 0.900000000000000022Initial program 93.9%
associate-*r/94.0%
associate-+l+94.0%
+-commutative94.0%
distribute-rgt-out94.0%
fma-def94.0%
+-commutative94.0%
Simplified94.0%
Taylor expanded in m around 0 91.8%
Taylor expanded in k around 0 47.9%
if 0.900000000000000022 < m Initial program 83.3%
associate-*r/83.3%
associate-+l+83.3%
+-commutative83.3%
distribute-rgt-out83.3%
fma-def83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 6.2%
Taylor expanded in a around 0 6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in k around inf 18.1%
*-commutative18.1%
*-commutative18.1%
associate-*r*18.1%
rem-square-sqrt13.4%
fabs-sqr13.4%
rem-square-sqrt27.1%
*-lft-identity27.1%
fabs-mul27.1%
*-lft-identity27.1%
rem-square-sqrt13.7%
fabs-sqr13.7%
rem-square-sqrt23.0%
metadata-eval23.0%
associate-*l*23.0%
*-commutative23.0%
associate-*l*23.0%
Simplified23.0%
Final simplification32.5%
(FPCore (a k m) :precision binary64 (if (<= m 5.6e+14) a (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 5.6e+14) {
tmp = a;
} else {
tmp = -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.6d+14) then
tmp = a
else
tmp = (-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.6e+14) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 5.6e+14: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 5.6e+14) tmp = a; else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 5.6e+14) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 5.6e+14], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 5.6 \cdot 10^{+14}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 5.6e14Initial program 96.6%
associate-*r/96.6%
associate-+l+96.6%
+-commutative96.6%
distribute-rgt-out96.6%
fma-def96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in m around 0 63.1%
Taylor expanded in k around 0 25.2%
if 5.6e14 < m Initial program 84.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 m around 0 2.9%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 18.6%
Final simplification23.1%
(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 92.6%
associate-*r/92.6%
associate-+l+92.6%
+-commutative92.6%
distribute-rgt-out92.6%
fma-def92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in m around 0 43.8%
Taylor expanded in k around 0 18.4%
Final simplification18.4%
herbie shell --seed 2023192
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))