
(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 16 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 (/ (* (pow k m) a) (+ (+ 1.0 (* k 10.0)) (* k k))))) (if (<= t_0 INFINITY) t_0 (+ a (* a (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double t_0 = (pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = (Math.pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): t_0 = (math.pow(k, m) * a) / ((1.0 + (k * 10.0)) + (k * k)) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) t_0 = Float64(Float64((k ^ m) * a) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 99.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = ((k ^ m) * a) / ((1.0 + (k * 10.0)) + (k * k)); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{k}^{m} \cdot a}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0Initial program 99.1%
if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 0.0%
associate-/l*0.0%
remove-double-neg0.0%
distribute-frac-neg20.0%
distribute-neg-frac20.0%
remove-double-neg0.0%
sqr-neg0.0%
associate-+l+0.0%
sqr-neg0.0%
distribute-rgt-out0.0%
Simplified0.0%
Taylor expanded in m around 0 1.6%
Taylor expanded in k around 0 93.7%
cancel-sign-sub-inv93.7%
metadata-eval93.7%
mul-1-neg93.7%
distribute-rgt-neg-in93.7%
distribute-rgt1-in93.7%
distribute-lft-neg-in93.7%
metadata-eval93.7%
metadata-eval93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in a around 0 100.0%
Final simplification99.2%
(FPCore (a k m) :precision binary64 (pow (/ (* (sqrt (pow k m)) (sqrt a)) (hypot 1.0 k)) 2.0))
double code(double a, double k, double m) {
return pow(((sqrt(pow(k, m)) * sqrt(a)) / hypot(1.0, k)), 2.0);
}
public static double code(double a, double k, double m) {
return Math.pow(((Math.sqrt(Math.pow(k, m)) * Math.sqrt(a)) / Math.hypot(1.0, k)), 2.0);
}
def code(a, k, m): return math.pow(((math.sqrt(math.pow(k, m)) * math.sqrt(a)) / math.hypot(1.0, k)), 2.0)
function code(a, k, m) return Float64(Float64(sqrt((k ^ m)) * sqrt(a)) / hypot(1.0, k)) ^ 2.0 end
function tmp = code(a, k, m) tmp = ((sqrt((k ^ m)) * sqrt(a)) / hypot(1.0, k)) ^ 2.0; end
code[a_, k_, m_] := N[Power[N[(N[(N[Sqrt[N[Power[k, m], $MachinePrecision]], $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{\sqrt{{k}^{m}} \cdot \sqrt{a}}{\mathsf{hypot}\left(1, k\right)}\right)}^{2}
\end{array}
Initial program 93.7%
associate-/l*93.7%
remove-double-neg93.7%
distribute-frac-neg293.7%
distribute-neg-frac293.7%
remove-double-neg93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out93.7%
Simplified93.7%
Taylor expanded in k around inf 92.8%
add-sqr-sqrt71.1%
pow271.1%
associate-*r/71.1%
sqrt-div68.0%
hypot-1-def71.8%
Applied egg-rr71.8%
*-commutative71.8%
sqrt-prod53.9%
Applied egg-rr53.9%
(FPCore (a k m) :precision binary64 (pow (/ (sqrt (* (pow k m) a)) (hypot 1.0 k)) 2.0))
double code(double a, double k, double m) {
return pow((sqrt((pow(k, m) * a)) / hypot(1.0, k)), 2.0);
}
public static double code(double a, double k, double m) {
return Math.pow((Math.sqrt((Math.pow(k, m) * a)) / Math.hypot(1.0, k)), 2.0);
}
def code(a, k, m): return math.pow((math.sqrt((math.pow(k, m) * a)) / math.hypot(1.0, k)), 2.0)
function code(a, k, m) return Float64(sqrt(Float64((k ^ m) * a)) / hypot(1.0, k)) ^ 2.0 end
function tmp = code(a, k, m) tmp = (sqrt(((k ^ m) * a)) / hypot(1.0, k)) ^ 2.0; end
code[a_, k_, m_] := N[Power[N[(N[Sqrt[N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{\sqrt{{k}^{m} \cdot a}}{\mathsf{hypot}\left(1, k\right)}\right)}^{2}
\end{array}
Initial program 93.7%
associate-/l*93.7%
remove-double-neg93.7%
distribute-frac-neg293.7%
distribute-neg-frac293.7%
remove-double-neg93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out93.7%
Simplified93.7%
Taylor expanded in k around inf 92.8%
add-sqr-sqrt71.1%
pow271.1%
associate-*r/71.1%
sqrt-div68.0%
hypot-1-def71.8%
Applied egg-rr71.8%
Final simplification71.8%
(FPCore (a k m) :precision binary64 (* a (/ (/ (pow k m) (hypot 1.0 k)) (hypot 1.0 k))))
double code(double a, double k, double m) {
return a * ((pow(k, m) / hypot(1.0, k)) / hypot(1.0, k));
}
public static double code(double a, double k, double m) {
return a * ((Math.pow(k, m) / Math.hypot(1.0, k)) / Math.hypot(1.0, k));
}
def code(a, k, m): return a * ((math.pow(k, m) / math.hypot(1.0, k)) / math.hypot(1.0, k))
function code(a, k, m) return Float64(a * Float64(Float64((k ^ m) / hypot(1.0, k)) / hypot(1.0, k))) end
function tmp = code(a, k, m) tmp = a * (((k ^ m) / hypot(1.0, k)) / hypot(1.0, k)); end
code[a_, k_, m_] := N[(a * N[(N[(N[Power[k, m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \frac{\frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right)}}{\mathsf{hypot}\left(1, k\right)}
\end{array}
Initial program 93.7%
associate-/l*93.7%
remove-double-neg93.7%
distribute-frac-neg293.7%
distribute-neg-frac293.7%
remove-double-neg93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out93.7%
Simplified93.7%
Taylor expanded in k around inf 92.8%
*-un-lft-identity92.8%
add-sqr-sqrt92.8%
times-frac92.7%
hypot-1-def92.7%
hypot-1-def98.2%
Applied egg-rr98.2%
associate-*l/98.2%
*-lft-identity98.2%
Simplified98.2%
(FPCore (a k m) :precision binary64 (if (<= m 0.23) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.23) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = pow(k, m) * 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.23d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.23) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.23: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.23) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.23) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.23], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.23:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 0.23000000000000001Initial program 98.8%
associate-/l*98.7%
remove-double-neg98.7%
distribute-frac-neg298.7%
distribute-neg-frac298.7%
remove-double-neg98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out98.7%
Simplified98.7%
if 0.23000000000000001 < m Initial program 82.9%
associate-/l*82.9%
remove-double-neg82.9%
distribute-frac-neg282.9%
distribute-neg-frac282.9%
remove-double-neg82.9%
sqr-neg82.9%
associate-+l+82.9%
sqr-neg82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in k around 0 100.0%
Final simplification99.1%
(FPCore (a k m) :precision binary64 (if (<= m 0.23) (* a (/ (pow k m) (+ 1.0 (* k k)))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.23) {
tmp = a * (pow(k, m) / (1.0 + (k * k)));
} else {
tmp = pow(k, m) * 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.23d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * k)))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.23) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * k)));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.23: tmp = a * (math.pow(k, m) / (1.0 + (k * k))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.23) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * k)))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.23) tmp = a * ((k ^ m) / (1.0 + (k * k))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.23], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.23:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 0.23000000000000001Initial program 98.8%
associate-/l*98.7%
remove-double-neg98.7%
distribute-frac-neg298.7%
distribute-neg-frac298.7%
remove-double-neg98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out98.7%
Simplified98.7%
Taylor expanded in k around inf 97.4%
if 0.23000000000000001 < m Initial program 82.9%
associate-/l*82.9%
remove-double-neg82.9%
distribute-frac-neg282.9%
distribute-neg-frac282.9%
remove-double-neg82.9%
sqr-neg82.9%
associate-+l+82.9%
sqr-neg82.9%
distribute-rgt-out82.9%
Simplified82.9%
Taylor expanded in k around 0 100.0%
Final simplification98.2%
(FPCore (a k m) :precision binary64 (if (or (<= m -2.15e-13) (not (<= m 9.2e-6))) (* (pow k m) a) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -2.15e-13) || !(m <= 9.2e-6)) {
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.15d-13)) .or. (.not. (m <= 9.2d-6))) 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.15e-13) || !(m <= 9.2e-6)) {
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.15e-13) or not (m <= 9.2e-6): 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.15e-13) || !(m <= 9.2e-6)) 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.15e-13) || ~((m <= 9.2e-6))) 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.15e-13], N[Not[LessEqual[m, 9.2e-6]], $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.15 \cdot 10^{-13} \lor \neg \left(m \leq 9.2 \cdot 10^{-6}\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.1499999999999999e-13 or 9.2e-6 < m Initial program 91.7%
associate-/l*91.7%
remove-double-neg91.7%
distribute-frac-neg291.7%
distribute-neg-frac291.7%
remove-double-neg91.7%
sqr-neg91.7%
associate-+l+91.7%
sqr-neg91.7%
distribute-rgt-out91.7%
Simplified91.7%
Taylor expanded in k around 0 100.0%
if -2.1499999999999999e-13 < m < 9.2e-6Initial program 97.6%
associate-/l*97.5%
remove-double-neg97.5%
distribute-frac-neg297.5%
distribute-neg-frac297.5%
remove-double-neg97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 97.3%
Final simplification99.1%
(FPCore (a k m)
:precision binary64
(if (<= m -550.0)
(/ (/ a k) (+ k (+ 10.0 (/ 1.0 k))))
(if (<= m 0.23)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m 1.8e+51)
(+ a (* a (* k (- (* k 99.0) 10.0))))
(* k (* a -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -550.0) {
tmp = (a / k) / (k + (10.0 + (1.0 / k)));
} else if (m <= 0.23) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 1.8e+51) {
tmp = a + (a * (k * ((k * 99.0) - 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 <= (-550.0d0)) then
tmp = (a / k) / (k + (10.0d0 + (1.0d0 / k)))
else if (m <= 0.23d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= 1.8d+51) then
tmp = a + (a * (k * ((k * 99.0d0) - 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 <= -550.0) {
tmp = (a / k) / (k + (10.0 + (1.0 / k)));
} else if (m <= 0.23) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 1.8e+51) {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -550.0: tmp = (a / k) / (k + (10.0 + (1.0 / k))) elif m <= 0.23: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= 1.8e+51: tmp = a + (a * (k * ((k * 99.0) - 10.0))) else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -550.0) tmp = Float64(Float64(a / k) / Float64(k + Float64(10.0 + Float64(1.0 / k)))); elseif (m <= 0.23) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= 1.8e+51) tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 99.0) - 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 <= -550.0) tmp = (a / k) / (k + (10.0 + (1.0 / k))); elseif (m <= 0.23) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= 1.8e+51) tmp = a + (a * (k * ((k * 99.0) - 10.0))); else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -550.0], N[(N[(a / k), $MachinePrecision] / N[(k + N[(10.0 + N[(1.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.23], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.8e+51], N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -550:\\
\;\;\;\;\frac{\frac{a}{k}}{k + \left(10 + \frac{1}{k}\right)}\\
\mathbf{elif}\;m \leq 0.23:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 1.8 \cdot 10^{+51}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -550Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 34.2%
Taylor expanded in k around inf 34.2%
*-un-lft-identity34.2%
distribute-lft-out34.2%
times-frac30.8%
+-commutative30.8%
associate-+l+30.8%
Applied egg-rr30.8%
associate-*r/42.0%
associate-*l/42.0%
*-lft-identity42.0%
+-commutative42.0%
+-commutative42.0%
associate-+l+42.0%
+-commutative42.0%
Simplified42.0%
if -550 < m < 0.23000000000000001Initial program 97.6%
associate-/l*97.5%
remove-double-neg97.5%
distribute-frac-neg297.5%
distribute-neg-frac297.5%
remove-double-neg97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 95.9%
if 0.23000000000000001 < m < 1.80000000000000005e51Initial program 57.8%
associate-/l*57.8%
remove-double-neg57.8%
distribute-frac-neg257.8%
distribute-neg-frac257.8%
remove-double-neg57.8%
sqr-neg57.8%
associate-+l+57.8%
sqr-neg57.8%
distribute-rgt-out57.8%
Simplified57.8%
Taylor expanded in m around 0 2.5%
Taylor expanded in k around 0 59.7%
cancel-sign-sub-inv59.7%
metadata-eval59.7%
mul-1-neg59.7%
distribute-rgt-neg-in59.7%
distribute-rgt1-in59.7%
distribute-lft-neg-in59.7%
metadata-eval59.7%
metadata-eval59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in a around 0 59.8%
if 1.80000000000000005e51 < m Initial program 90.5%
associate-/l*90.5%
remove-double-neg90.5%
distribute-frac-neg290.5%
distribute-neg-frac290.5%
remove-double-neg90.5%
sqr-neg90.5%
associate-+l+90.5%
sqr-neg90.5%
distribute-rgt-out90.5%
Simplified90.5%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 12.8%
Taylor expanded in k around inf 30.8%
*-commutative30.8%
*-commutative30.8%
associate-*r*30.8%
Simplified30.8%
Final simplification59.3%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* k (+ k 10.0))))
(if (<= m -0.37)
(/ a t_0)
(if (<= m 0.23)
(/ a (+ 1.0 t_0))
(if (<= m 1.35e+51)
(+ a (* a (* k (- (* k 99.0) 10.0))))
(* k (* a -10.0)))))))
double code(double a, double k, double m) {
double t_0 = k * (k + 10.0);
double tmp;
if (m <= -0.37) {
tmp = a / t_0;
} else if (m <= 0.23) {
tmp = a / (1.0 + t_0);
} else if (m <= 1.35e+51) {
tmp = a + (a * (k * ((k * 99.0) - 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) :: t_0
real(8) :: tmp
t_0 = k * (k + 10.0d0)
if (m <= (-0.37d0)) then
tmp = a / t_0
else if (m <= 0.23d0) then
tmp = a / (1.0d0 + t_0)
else if (m <= 1.35d+51) then
tmp = a + (a * (k * ((k * 99.0d0) - 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 t_0 = k * (k + 10.0);
double tmp;
if (m <= -0.37) {
tmp = a / t_0;
} else if (m <= 0.23) {
tmp = a / (1.0 + t_0);
} else if (m <= 1.35e+51) {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): t_0 = k * (k + 10.0) tmp = 0 if m <= -0.37: tmp = a / t_0 elif m <= 0.23: tmp = a / (1.0 + t_0) elif m <= 1.35e+51: tmp = a + (a * (k * ((k * 99.0) - 10.0))) else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) t_0 = Float64(k * Float64(k + 10.0)) tmp = 0.0 if (m <= -0.37) tmp = Float64(a / t_0); elseif (m <= 0.23) tmp = Float64(a / Float64(1.0 + t_0)); elseif (m <= 1.35e+51) tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 99.0) - 10.0)))); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = k * (k + 10.0); tmp = 0.0; if (m <= -0.37) tmp = a / t_0; elseif (m <= 0.23) tmp = a / (1.0 + t_0); elseif (m <= 1.35e+51) tmp = a + (a * (k * ((k * 99.0) - 10.0))); else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -0.37], N[(a / t$95$0), $MachinePrecision], If[LessEqual[m, 0.23], N[(a / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.35e+51], N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := k \cdot \left(k + 10\right)\\
\mathbf{if}\;m \leq -0.37:\\
\;\;\;\;\frac{a}{t\_0}\\
\mathbf{elif}\;m \leq 0.23:\\
\;\;\;\;\frac{a}{1 + t\_0}\\
\mathbf{elif}\;m \leq 1.35 \cdot 10^{+51}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -0.37Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 33.8%
Taylor expanded in k around inf 33.8%
Taylor expanded in k around inf 39.1%
distribute-lft-out39.1%
*-commutative39.1%
+-commutative39.1%
Applied egg-rr39.1%
if -0.37 < m < 0.23000000000000001Initial program 97.6%
associate-/l*97.5%
remove-double-neg97.5%
distribute-frac-neg297.5%
distribute-neg-frac297.5%
remove-double-neg97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 96.9%
if 0.23000000000000001 < m < 1.34999999999999996e51Initial program 57.8%
associate-/l*57.8%
remove-double-neg57.8%
distribute-frac-neg257.8%
distribute-neg-frac257.8%
remove-double-neg57.8%
sqr-neg57.8%
associate-+l+57.8%
sqr-neg57.8%
distribute-rgt-out57.8%
Simplified57.8%
Taylor expanded in m around 0 2.5%
Taylor expanded in k around 0 59.7%
cancel-sign-sub-inv59.7%
metadata-eval59.7%
mul-1-neg59.7%
distribute-rgt-neg-in59.7%
distribute-rgt1-in59.7%
distribute-lft-neg-in59.7%
metadata-eval59.7%
metadata-eval59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in a around 0 59.8%
if 1.34999999999999996e51 < m Initial program 90.5%
associate-/l*90.5%
remove-double-neg90.5%
distribute-frac-neg290.5%
distribute-neg-frac290.5%
remove-double-neg90.5%
sqr-neg90.5%
associate-+l+90.5%
sqr-neg90.5%
distribute-rgt-out90.5%
Simplified90.5%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 12.8%
Taylor expanded in k around inf 30.8%
*-commutative30.8%
*-commutative30.8%
associate-*r*30.8%
Simplified30.8%
Final simplification58.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k (+ k 10.0)))))
(if (<= k -2.05e+136)
t_0
(if (<= k -3.05e-298)
(* -10.0 (* k a))
(if (<= k 0.00082) (/ a (+ 1.0 (* k 10.0))) t_0)))))
double code(double a, double k, double m) {
double t_0 = a / (k * (k + 10.0));
double tmp;
if (k <= -2.05e+136) {
tmp = t_0;
} else if (k <= -3.05e-298) {
tmp = -10.0 * (k * a);
} else if (k <= 0.00082) {
tmp = a / (1.0 + (k * 10.0));
} 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 * (k + 10.0d0))
if (k <= (-2.05d+136)) then
tmp = t_0
else if (k <= (-3.05d-298)) then
tmp = (-10.0d0) * (k * a)
else if (k <= 0.00082d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
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 * (k + 10.0));
double tmp;
if (k <= -2.05e+136) {
tmp = t_0;
} else if (k <= -3.05e-298) {
tmp = -10.0 * (k * a);
} else if (k <= 0.00082) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * (k + 10.0)) tmp = 0 if k <= -2.05e+136: tmp = t_0 elif k <= -3.05e-298: tmp = -10.0 * (k * a) elif k <= 0.00082: tmp = a / (1.0 + (k * 10.0)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * Float64(k + 10.0))) tmp = 0.0 if (k <= -2.05e+136) tmp = t_0; elseif (k <= -3.05e-298) tmp = Float64(-10.0 * Float64(k * a)); elseif (k <= 0.00082) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * (k + 10.0)); tmp = 0.0; if (k <= -2.05e+136) tmp = t_0; elseif (k <= -3.05e-298) tmp = -10.0 * (k * a); elseif (k <= 0.00082) tmp = a / (1.0 + (k * 10.0)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -2.05e+136], t$95$0, If[LessEqual[k, -3.05e-298], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.00082], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot \left(k + 10\right)}\\
\mathbf{if}\;k \leq -2.05 \cdot 10^{+136}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;k \leq -3.05 \cdot 10^{-298}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\mathbf{elif}\;k \leq 0.00082:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if k < -2.0499999999999999e136 or 8.1999999999999998e-4 < k Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in m around 0 64.8%
Taylor expanded in k around inf 64.8%
Taylor expanded in k around inf 63.6%
distribute-lft-out63.6%
*-commutative63.6%
+-commutative63.6%
Applied egg-rr63.6%
if -2.0499999999999999e136 < k < -3.05000000000000006e-298Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 8.1%
Taylor expanded in k around 0 11.2%
Taylor expanded in k around inf 24.0%
if -3.05000000000000006e-298 < k < 8.1999999999999998e-4Initial program 99.9%
associate-/l*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac299.9%
remove-double-neg99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 51.7%
Taylor expanded in k around 0 51.4%
*-commutative51.4%
Simplified51.4%
Final simplification49.3%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k (+ k 10.0)))))
(if (<= k -5.4e+136)
t_0
(if (<= k -3.05e-298)
(* -10.0 (* k a))
(if (<= k 0.00082) (* a (+ 1.0 (* k -10.0))) t_0)))))
double code(double a, double k, double m) {
double t_0 = a / (k * (k + 10.0));
double tmp;
if (k <= -5.4e+136) {
tmp = t_0;
} else if (k <= -3.05e-298) {
tmp = -10.0 * (k * a);
} else if (k <= 0.00082) {
tmp = a * (1.0 + (k * -10.0));
} 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 * (k + 10.0d0))
if (k <= (-5.4d+136)) then
tmp = t_0
else if (k <= (-3.05d-298)) then
tmp = (-10.0d0) * (k * a)
else if (k <= 0.00082d0) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
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 * (k + 10.0));
double tmp;
if (k <= -5.4e+136) {
tmp = t_0;
} else if (k <= -3.05e-298) {
tmp = -10.0 * (k * a);
} else if (k <= 0.00082) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * (k + 10.0)) tmp = 0 if k <= -5.4e+136: tmp = t_0 elif k <= -3.05e-298: tmp = -10.0 * (k * a) elif k <= 0.00082: tmp = a * (1.0 + (k * -10.0)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * Float64(k + 10.0))) tmp = 0.0 if (k <= -5.4e+136) tmp = t_0; elseif (k <= -3.05e-298) tmp = Float64(-10.0 * Float64(k * a)); elseif (k <= 0.00082) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * (k + 10.0)); tmp = 0.0; if (k <= -5.4e+136) tmp = t_0; elseif (k <= -3.05e-298) tmp = -10.0 * (k * a); elseif (k <= 0.00082) tmp = a * (1.0 + (k * -10.0)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -5.4e+136], t$95$0, If[LessEqual[k, -3.05e-298], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.00082], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot \left(k + 10\right)}\\
\mathbf{if}\;k \leq -5.4 \cdot 10^{+136}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;k \leq -3.05 \cdot 10^{-298}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\mathbf{elif}\;k \leq 0.00082:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if k < -5.4000000000000003e136 or 8.1999999999999998e-4 < k Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in m around 0 64.8%
Taylor expanded in k around inf 64.8%
Taylor expanded in k around inf 63.6%
distribute-lft-out63.6%
*-commutative63.6%
+-commutative63.6%
Applied egg-rr63.6%
if -5.4000000000000003e136 < k < -3.05000000000000006e-298Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 8.1%
Taylor expanded in k around 0 11.2%
Taylor expanded in k around inf 24.0%
if -3.05000000000000006e-298 < k < 8.1999999999999998e-4Initial program 99.9%
associate-/l*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac299.9%
remove-double-neg99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 51.7%
Taylor expanded in k around 0 51.3%
Taylor expanded in a around 0 51.3%
*-commutative51.3%
Simplified51.3%
Final simplification49.2%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* k (+ k 10.0))))
(if (<= m -0.37)
(/ a t_0)
(if (<= m 2.8) (/ a (+ 1.0 t_0)) (* -10.0 (* k a))))))
double code(double a, double k, double m) {
double t_0 = k * (k + 10.0);
double tmp;
if (m <= -0.37) {
tmp = a / t_0;
} else if (m <= 2.8) {
tmp = a / (1.0 + t_0);
} 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) :: t_0
real(8) :: tmp
t_0 = k * (k + 10.0d0)
if (m <= (-0.37d0)) then
tmp = a / t_0
else if (m <= 2.8d0) then
tmp = a / (1.0d0 + t_0)
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = k * (k + 10.0);
double tmp;
if (m <= -0.37) {
tmp = a / t_0;
} else if (m <= 2.8) {
tmp = a / (1.0 + t_0);
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): t_0 = k * (k + 10.0) tmp = 0 if m <= -0.37: tmp = a / t_0 elif m <= 2.8: tmp = a / (1.0 + t_0) else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) t_0 = Float64(k * Float64(k + 10.0)) tmp = 0.0 if (m <= -0.37) tmp = Float64(a / t_0); elseif (m <= 2.8) tmp = Float64(a / Float64(1.0 + t_0)); else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = k * (k + 10.0); tmp = 0.0; if (m <= -0.37) tmp = a / t_0; elseif (m <= 2.8) tmp = a / (1.0 + t_0); else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -0.37], N[(a / t$95$0), $MachinePrecision], If[LessEqual[m, 2.8], N[(a / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := k \cdot \left(k + 10\right)\\
\mathbf{if}\;m \leq -0.37:\\
\;\;\;\;\frac{a}{t\_0}\\
\mathbf{elif}\;m \leq 2.8:\\
\;\;\;\;\frac{a}{1 + t\_0}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -0.37Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 33.8%
Taylor expanded in k around inf 33.8%
Taylor expanded in k around inf 39.1%
distribute-lft-out39.1%
*-commutative39.1%
+-commutative39.1%
Applied egg-rr39.1%
if -0.37 < m < 2.7999999999999998Initial program 97.6%
associate-/l*97.5%
remove-double-neg97.5%
distribute-frac-neg297.5%
distribute-neg-frac297.5%
remove-double-neg97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 95.9%
if 2.7999999999999998 < m Initial program 82.7%
associate-/l*82.7%
remove-double-neg82.7%
distribute-frac-neg282.7%
distribute-neg-frac282.7%
remove-double-neg82.7%
sqr-neg82.7%
associate-+l+82.7%
sqr-neg82.7%
distribute-rgt-out82.7%
Simplified82.7%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 12.8%
Taylor expanded in k around inf 28.0%
Final simplification55.3%
(FPCore (a k m) :precision binary64 (if (<= m -0.25) (/ a (* k (+ k 10.0))) (if (<= m 1.95) (/ a (+ 1.0 (* k k))) (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.25) {
tmp = a / (k * (k + 10.0));
} else if (m <= 1.95) {
tmp = a / (1.0 + (k * k));
} 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 <= (-0.25d0)) then
tmp = a / (k * (k + 10.0d0))
else if (m <= 1.95d0) then
tmp = a / (1.0d0 + (k * k))
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 <= -0.25) {
tmp = a / (k * (k + 10.0));
} else if (m <= 1.95) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.25: tmp = a / (k * (k + 10.0)) elif m <= 1.95: tmp = a / (1.0 + (k * k)) else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.25) tmp = Float64(a / Float64(k * Float64(k + 10.0))); elseif (m <= 1.95) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.25) tmp = a / (k * (k + 10.0)); elseif (m <= 1.95) tmp = a / (1.0 + (k * k)); else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.25], N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.95], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.25:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 1.95:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -0.25Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 33.8%
Taylor expanded in k around inf 33.8%
Taylor expanded in k around inf 39.1%
distribute-lft-out39.1%
*-commutative39.1%
+-commutative39.1%
Applied egg-rr39.1%
if -0.25 < m < 1.94999999999999996Initial program 97.6%
associate-/l*97.5%
remove-double-neg97.5%
distribute-frac-neg297.5%
distribute-neg-frac297.5%
remove-double-neg97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 95.9%
Taylor expanded in k around inf 93.4%
if 1.94999999999999996 < m Initial program 82.7%
associate-/l*82.7%
remove-double-neg82.7%
distribute-frac-neg282.7%
distribute-neg-frac282.7%
remove-double-neg82.7%
sqr-neg82.7%
associate-+l+82.7%
sqr-neg82.7%
distribute-rgt-out82.7%
Simplified82.7%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 12.8%
Taylor expanded in k around inf 28.0%
Final simplification54.5%
(FPCore (a k m) :precision binary64 (if (<= m -1.08e-60) (* (/ a k) 0.1) (if (<= m 0.45) a (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.08e-60) {
tmp = (a / k) * 0.1;
} else if (m <= 0.45) {
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 <= (-1.08d-60)) then
tmp = (a / k) * 0.1d0
else if (m <= 0.45d0) 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 <= -1.08e-60) {
tmp = (a / k) * 0.1;
} else if (m <= 0.45) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.08e-60: tmp = (a / k) * 0.1 elif m <= 0.45: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.08e-60) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 0.45) 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 <= -1.08e-60) tmp = (a / k) * 0.1; elseif (m <= 0.45) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.08e-60], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 0.45], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.08 \cdot 10^{-60}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 0.45:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -1.07999999999999997e-60Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.8%
Taylor expanded in k around inf 37.8%
Taylor expanded in k around inf 41.0%
Taylor expanded in k around 0 24.8%
*-commutative24.8%
Simplified24.8%
if -1.07999999999999997e-60 < m < 0.450000000000000011Initial program 97.4%
associate-/l*97.4%
remove-double-neg97.4%
distribute-frac-neg297.4%
distribute-neg-frac297.4%
remove-double-neg97.4%
sqr-neg97.4%
associate-+l+97.4%
sqr-neg97.4%
distribute-rgt-out97.4%
Simplified97.4%
Taylor expanded in m around 0 96.0%
Taylor expanded in k around 0 52.0%
if 0.450000000000000011 < m Initial program 82.7%
associate-/l*82.7%
remove-double-neg82.7%
distribute-frac-neg282.7%
distribute-neg-frac282.7%
remove-double-neg82.7%
sqr-neg82.7%
associate-+l+82.7%
sqr-neg82.7%
distribute-rgt-out82.7%
Simplified82.7%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 12.8%
Taylor expanded in k around inf 28.0%
Final simplification34.6%
(FPCore (a k m) :precision binary64 (if (<= m 0.45) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.45) {
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 <= 0.45d0) 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 <= 0.45) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.45: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.45) 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 <= 0.45) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.45], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.45:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 0.450000000000000011Initial program 98.8%
associate-/l*98.7%
remove-double-neg98.7%
distribute-frac-neg298.7%
distribute-neg-frac298.7%
remove-double-neg98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out98.7%
Simplified98.7%
Taylor expanded in m around 0 65.4%
Taylor expanded in k around 0 27.5%
if 0.450000000000000011 < m Initial program 82.7%
associate-/l*82.7%
remove-double-neg82.7%
distribute-frac-neg282.7%
distribute-neg-frac282.7%
remove-double-neg82.7%
sqr-neg82.7%
associate-+l+82.7%
sqr-neg82.7%
distribute-rgt-out82.7%
Simplified82.7%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 12.8%
Taylor expanded in k around inf 28.0%
Final simplification27.7%
(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 93.7%
associate-/l*93.7%
remove-double-neg93.7%
distribute-frac-neg293.7%
distribute-neg-frac293.7%
remove-double-neg93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out93.7%
Simplified93.7%
Taylor expanded in m around 0 45.7%
Taylor expanded in k around 0 20.1%
herbie shell --seed 2024165
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))