
(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 (<= (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0)))) INFINITY) (* a (/ (sqrt (pow k (* m 2.0))) (+ 1.0 (* k (+ k 10.0))))) (+ a (* a (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (((a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= ((double) INFINITY)) {
tmp = a * (sqrt(pow(k, (m * 2.0))) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (((a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= Double.POSITIVE_INFINITY) {
tmp = a * (Math.sqrt(Math.pow(k, (m * 2.0))) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if ((a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= math.inf: tmp = a * (math.sqrt(math.pow(k, (m * 2.0))) / (1.0 + (k * (k + 10.0)))) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) <= Inf) tmp = Float64(a * Float64(sqrt((k ^ Float64(m * 2.0))) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (((a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0)))) <= Inf) tmp = a * (sqrt((k ^ (m * 2.0))) / (1.0 + (k * (k + 10.0)))); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(a * N[(N[Sqrt[N[Power[k, N[(m * 2.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)} \leq \infty:\\
\;\;\;\;a \cdot \frac{\sqrt{{k}^{\left(m \cdot 2\right)}}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\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 98.3%
associate-/l*98.3%
remove-double-neg98.3%
distribute-frac-neg298.3%
distribute-neg-frac298.3%
remove-double-neg98.3%
sqr-neg98.3%
associate-+l+98.3%
sqr-neg98.3%
distribute-rgt-out98.3%
Simplified98.3%
add-sqr-sqrt98.3%
sqrt-unprod98.3%
pow-sqr98.3%
Applied egg-rr98.3%
*-commutative98.3%
Simplified98.3%
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 72.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0))))))
(if (<= t_0 0.0)
(/ (/ a (+ k (+ 10.0 (/ 1.0 k)))) k)
(if (<= t_0 2e+294)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= t_0 INFINITY)
(-
a
(*
k
(+ (* k (/ (* (* a -99.0) (* a 101.0)) (* a 101.0))) (* a 10.0))))
(+ a (* a (* k (* k 99.0)))))))))
double code(double a, double k, double m) {
double t_0 = (a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 0.0) {
tmp = (a / (k + (10.0 + (1.0 / k)))) / k;
} else if (t_0 <= 2e+294) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = a - (k * ((k * (((a * -99.0) * (a * 101.0)) / (a * 101.0))) + (a * 10.0)));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = (a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 0.0) {
tmp = (a / (k + (10.0 + (1.0 / k)))) / k;
} else if (t_0 <= 2e+294) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = a - (k * ((k * (((a * -99.0) * (a * 101.0)) / (a * 101.0))) + (a * 10.0)));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): t_0 = (a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_0 <= 0.0: tmp = (a / (k + (10.0 + (1.0 / k)))) / k elif t_0 <= 2e+294: tmp = a / (1.0 + (k * (k + 10.0))) elif t_0 <= math.inf: tmp = a - (k * ((k * (((a * -99.0) * (a * 101.0)) / (a * 101.0))) + (a * 10.0))) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(a / Float64(k + Float64(10.0 + Float64(1.0 / k)))) / k); elseif (t_0 <= 2e+294) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (t_0 <= Inf) tmp = Float64(a - Float64(k * Float64(Float64(k * Float64(Float64(Float64(a * -99.0) * Float64(a * 101.0)) / Float64(a * 101.0))) + Float64(a * 10.0)))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_0 <= 0.0) tmp = (a / (k + (10.0 + (1.0 / k)))) / k; elseif (t_0 <= 2e+294) tmp = a / (1.0 + (k * (k + 10.0))); elseif (t_0 <= Inf) tmp = a - (k * ((k * (((a * -99.0) * (a * 101.0)) / (a * 101.0))) + (a * 10.0))); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(a / N[(k + N[(10.0 + N[(1.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[t$95$0, 2e+294], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a - N[(k * N[(N[(k * N[(N[(N[(a * -99.0), $MachinePrecision] * N[(a * 101.0), $MachinePrecision]), $MachinePrecision] / N[(a * 101.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\frac{a}{k + \left(10 + \frac{1}{k}\right)}}{k}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;a - k \cdot \left(k \cdot \frac{\left(a \cdot -99\right) \cdot \left(a \cdot 101\right)}{a \cdot 101} + a \cdot 10\right)\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\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))) < 0.0Initial program 97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in m around 0 40.6%
Taylor expanded in k around inf 40.5%
*-un-lft-identity40.5%
distribute-lft-out40.5%
times-frac43.7%
associate-+l+43.7%
Applied egg-rr43.7%
associate-*l/43.7%
*-lft-identity43.7%
associate-+r+43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 2.00000000000000013e294Initial 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 93.0%
if 2.00000000000000013e294 < (/.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 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 2.9%
Taylor expanded in k around 0 12.2%
flip-+2.5%
div-sub2.5%
pow22.5%
*-commutative2.5%
pow22.5%
*-commutative2.5%
*-commutative2.5%
Applied egg-rr2.5%
div-sub2.5%
unpow22.5%
unpow22.5%
difference-of-squares20.6%
*-rgt-identity20.6%
distribute-lft-out20.6%
metadata-eval20.6%
*-rgt-identity20.6%
distribute-lft-out--20.6%
metadata-eval20.6%
*-rgt-identity20.6%
distribute-lft-out--20.6%
metadata-eval20.6%
Simplified20.6%
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 72.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification52.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0))))))
(if (<= t_0 0.0)
(/ (/ a (+ k (+ 10.0 (/ 1.0 k)))) k)
(if (<= t_0 2e+294)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= t_0 INFINITY)
(* k (+ (* a -10.0) (/ a k)))
(+ a (* a (* k (* k 99.0)))))))))
double code(double a, double k, double m) {
double t_0 = (a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 0.0) {
tmp = (a / (k + (10.0 + (1.0 / k)))) / k;
} else if (t_0 <= 2e+294) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = k * ((a * -10.0) + (a / k));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = (a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 0.0) {
tmp = (a / (k + (10.0 + (1.0 / k)))) / k;
} else if (t_0 <= 2e+294) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = k * ((a * -10.0) + (a / k));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): t_0 = (a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_0 <= 0.0: tmp = (a / (k + (10.0 + (1.0 / k)))) / k elif t_0 <= 2e+294: tmp = a / (1.0 + (k * (k + 10.0))) elif t_0 <= math.inf: tmp = k * ((a * -10.0) + (a / k)) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(a / Float64(k + Float64(10.0 + Float64(1.0 / k)))) / k); elseif (t_0 <= 2e+294) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (t_0 <= Inf) tmp = Float64(k * Float64(Float64(a * -10.0) + Float64(a / k))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_0 <= 0.0) tmp = (a / (k + (10.0 + (1.0 / k)))) / k; elseif (t_0 <= 2e+294) tmp = a / (1.0 + (k * (k + 10.0))); elseif (t_0 <= Inf) tmp = k * ((a * -10.0) + (a / k)); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(a / N[(k + N[(10.0 + N[(1.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[t$95$0, 2e+294], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(N[(a * -10.0), $MachinePrecision] + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\frac{a}{k + \left(10 + \frac{1}{k}\right)}}{k}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;k \cdot \left(a \cdot -10 + \frac{a}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\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))) < 0.0Initial program 97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in m around 0 40.6%
Taylor expanded in k around inf 40.5%
*-un-lft-identity40.5%
distribute-lft-out40.5%
times-frac43.7%
associate-+l+43.7%
Applied egg-rr43.7%
associate-*l/43.7%
*-lft-identity43.7%
associate-+r+43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 2.00000000000000013e294Initial 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 93.0%
if 2.00000000000000013e294 < (/.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 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 2.9%
Taylor expanded in k around 0 2.7%
*-commutative2.7%
Simplified2.7%
Taylor expanded in k around inf 8.4%
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 72.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification50.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0))))))
(if (<= t_0 2e+294)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= t_0 INFINITY)
(* k (+ (* a -10.0) (/ a k)))
(+ a (* a (* k (* k 99.0))))))))
double code(double a, double k, double m) {
double t_0 = (a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 2e+294) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = k * ((a * -10.0) + (a / k));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = (a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 2e+294) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = k * ((a * -10.0) + (a / k));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): t_0 = (a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_0 <= 2e+294: tmp = a / (1.0 + (k * (k + 10.0))) elif t_0 <= math.inf: tmp = k * ((a * -10.0) + (a / k)) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_0 <= 2e+294) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (t_0 <= Inf) tmp = Float64(k * Float64(Float64(a * -10.0) + Float64(a / k))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_0 <= 2e+294) tmp = a / (1.0 + (k * (k + 10.0))); elseif (t_0 <= Inf) tmp = k * ((a * -10.0) + (a / k)); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+294], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(N[(a * -10.0), $MachinePrecision] + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;k \cdot \left(a \cdot -10 + \frac{a}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\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))) < 2.00000000000000013e294Initial program 98.0%
associate-/l*98.1%
remove-double-neg98.1%
distribute-frac-neg298.1%
distribute-neg-frac298.1%
remove-double-neg98.1%
sqr-neg98.1%
associate-+l+98.1%
sqr-neg98.1%
distribute-rgt-out98.1%
Simplified98.1%
Taylor expanded in m around 0 49.7%
if 2.00000000000000013e294 < (/.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 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 2.9%
Taylor expanded in k around 0 2.7%
*-commutative2.7%
Simplified2.7%
Taylor expanded in k around inf 8.4%
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 72.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification48.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0))))))
(if (<= t_0 2e+294)
(* a (/ 1.0 (+ 1.0 (* k k))))
(if (<= t_0 INFINITY)
(* k (+ (* a -10.0) (/ a k)))
(+ a (* a (* k (* k 99.0))))))))
double code(double a, double k, double m) {
double t_0 = (a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 2e+294) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = k * ((a * -10.0) + (a / k));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = (a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_0 <= 2e+294) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = k * ((a * -10.0) + (a / k));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): t_0 = (a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_0 <= 2e+294: tmp = a * (1.0 / (1.0 + (k * k))) elif t_0 <= math.inf: tmp = k * ((a * -10.0) + (a / k)) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_0 <= 2e+294) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * k)))); elseif (t_0 <= Inf) tmp = Float64(k * Float64(Float64(a * -10.0) + Float64(a / k))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_0 <= 2e+294) tmp = a * (1.0 / (1.0 + (k * k))); elseif (t_0 <= Inf) tmp = k * ((a * -10.0) + (a / k)); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+294], N[(a * N[(1.0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(N[(a * -10.0), $MachinePrecision] + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;k \cdot \left(a \cdot -10 + \frac{a}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\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))) < 2.00000000000000013e294Initial program 98.0%
associate-/l*98.1%
remove-double-neg98.1%
distribute-frac-neg298.1%
distribute-neg-frac298.1%
remove-double-neg98.1%
sqr-neg98.1%
associate-+l+98.1%
sqr-neg98.1%
distribute-rgt-out98.1%
Simplified98.1%
Taylor expanded in m around 0 49.7%
Taylor expanded in k around inf 49.2%
if 2.00000000000000013e294 < (/.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 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 2.9%
Taylor expanded in k around 0 2.7%
*-commutative2.7%
Simplified2.7%
Taylor expanded in k around inf 8.4%
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 72.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification48.5%
(FPCore (a k m) :precision binary64 (if (<= (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0)))) INFINITY) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (+ a (* a (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (((a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= ((double) INFINITY)) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (((a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= Double.POSITIVE_INFINITY) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if ((a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= math.inf: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) <= Inf) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (((a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0)))) <= Inf) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)} \leq \infty:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\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 98.3%
associate-/l*98.3%
remove-double-neg98.3%
distribute-frac-neg298.3%
distribute-neg-frac298.3%
remove-double-neg98.3%
sqr-neg98.3%
associate-+l+98.3%
sqr-neg98.3%
distribute-rgt-out98.3%
Simplified98.3%
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 72.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (a k m) :precision binary64 (if (<= (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0)))) INFINITY) (* a (/ (pow k m) (+ 1.0 (* k k)))) (+ a (* a (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (((a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= ((double) INFINITY)) {
tmp = a * (pow(k, m) / (1.0 + (k * k)));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (((a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= Double.POSITIVE_INFINITY) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * k)));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if ((a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= math.inf: tmp = a * (math.pow(k, m) / (1.0 + (k * k))) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) <= Inf) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * k)))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (((a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0)))) <= Inf) tmp = a * ((k ^ m) / (1.0 + (k * k))); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)} \leq \infty:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\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 98.3%
associate-/l*98.3%
remove-double-neg98.3%
distribute-frac-neg298.3%
distribute-neg-frac298.3%
remove-double-neg98.3%
sqr-neg98.3%
associate-+l+98.3%
sqr-neg98.3%
distribute-rgt-out98.3%
Simplified98.3%
Taylor expanded in k around inf 97.9%
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 72.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.1%
(FPCore (a k m) :precision binary64 (if (<= (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0)))) 2e+294) (* a (/ 1.0 (+ 1.0 (* k k)))) (* k (+ (* a -10.0) (/ a k)))))
double code(double a, double k, double m) {
double tmp;
if (((a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= 2e+294) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = k * ((a * -10.0) + (a / k));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (((a * (k ** m)) / ((k * k) + (1.0d0 + (k * 10.0d0)))) <= 2d+294) then
tmp = a * (1.0d0 / (1.0d0 + (k * k)))
else
tmp = k * ((a * (-10.0d0)) + (a / k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (((a * Math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= 2e+294) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = k * ((a * -10.0) + (a / k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if ((a * math.pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)))) <= 2e+294: tmp = a * (1.0 / (1.0 + (k * k))) else: tmp = k * ((a * -10.0) + (a / k)) return tmp
function code(a, k, m) tmp = 0.0 if (Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) <= 2e+294) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * k)))); else tmp = Float64(k * Float64(Float64(a * -10.0) + Float64(a / k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (((a * (k ^ m)) / ((k * k) + (1.0 + (k * 10.0)))) <= 2e+294) tmp = a * (1.0 / (1.0 + (k * k))); else tmp = k * ((a * -10.0) + (a / k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+294], N[(a * N[(1.0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(N[(a * -10.0), $MachinePrecision] + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)} \leq 2 \cdot 10^{+294}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10 + \frac{a}{k}\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))) < 2.00000000000000013e294Initial program 98.0%
associate-/l*98.1%
remove-double-neg98.1%
distribute-frac-neg298.1%
distribute-neg-frac298.1%
remove-double-neg98.1%
sqr-neg98.1%
associate-+l+98.1%
sqr-neg98.1%
distribute-rgt-out98.1%
Simplified98.1%
Taylor expanded in m around 0 49.7%
Taylor expanded in k around inf 49.2%
if 2.00000000000000013e294 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 58.9%
associate-/l*58.9%
remove-double-neg58.9%
distribute-frac-neg258.9%
distribute-neg-frac258.9%
remove-double-neg58.9%
sqr-neg58.9%
associate-+l+58.9%
sqr-neg58.9%
distribute-rgt-out58.9%
Simplified58.9%
Taylor expanded in m around 0 2.3%
Taylor expanded in k around 0 9.5%
*-commutative9.5%
Simplified9.5%
Taylor expanded in k around inf 12.8%
Final simplification41.2%
(FPCore (a k m) :precision binary64 (if (<= m -3e-10) (* a (/ (pow k m) (+ 1.0 (* k 10.0)))) (if (<= m 2.2e-15) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3e-10) {
tmp = a * (pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 2.2e-15) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-3d-10)) then
tmp = a * ((k ** m) / (1.0d0 + (k * 10.0d0)))
else if (m <= 2.2d-15) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -3e-10) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 2.2e-15) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3e-10: tmp = a * (math.pow(k, m) / (1.0 + (k * 10.0))) elif m <= 2.2e-15: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3e-10) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * 10.0)))); elseif (m <= 2.2e-15) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3e-10) tmp = a * ((k ^ m) / (1.0 + (k * 10.0))); elseif (m <= 2.2e-15) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3e-10], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.2e-15], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3 \cdot 10^{-10}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot 10}\\
\mathbf{elif}\;m \leq 2.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -3e-10Initial 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 k around 0 98.8%
*-commutative98.8%
Simplified98.8%
if -3e-10 < m < 2.19999999999999986e-15Initial program 94.3%
associate-/l*94.3%
remove-double-neg94.3%
distribute-frac-neg294.3%
distribute-neg-frac294.3%
remove-double-neg94.3%
sqr-neg94.3%
associate-+l+94.3%
sqr-neg94.3%
distribute-rgt-out94.3%
Simplified94.3%
Taylor expanded in m around 0 93.7%
if 2.19999999999999986e-15 < m Initial program 75.3%
associate-/l*75.3%
remove-double-neg75.3%
distribute-frac-neg275.3%
distribute-neg-frac275.3%
remove-double-neg75.3%
sqr-neg75.3%
associate-+l+75.3%
sqr-neg75.3%
distribute-rgt-out75.3%
Simplified75.3%
Taylor expanded in k around 0 99.0%
Final simplification97.5%
(FPCore (a k m) :precision binary64 (if (or (<= m -2.15e-10) (not (<= m 2.2e-15))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -2.15e-10) || !(m <= 2.2e-15)) {
tmp = a * pow(k, m);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-2.15d-10)) .or. (.not. (m <= 2.2d-15))) then
tmp = a * (k ** m)
else
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -2.15e-10) || !(m <= 2.2e-15)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -2.15e-10) or not (m <= 2.2e-15): tmp = a * math.pow(k, m) else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -2.15e-10) || !(m <= 2.2e-15)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -2.15e-10) || ~((m <= 2.2e-15))) tmp = a * (k ^ m); else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -2.15e-10], N[Not[LessEqual[m, 2.2e-15]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.15 \cdot 10^{-10} \lor \neg \left(m \leq 2.2 \cdot 10^{-15}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.15000000000000007e-10 or 2.19999999999999986e-15 < m Initial program 87.8%
associate-/l*87.8%
remove-double-neg87.8%
distribute-frac-neg287.8%
distribute-neg-frac287.8%
remove-double-neg87.8%
sqr-neg87.8%
associate-+l+87.8%
sqr-neg87.8%
distribute-rgt-out87.8%
Simplified87.8%
Taylor expanded in k around 0 98.5%
if -2.15000000000000007e-10 < m < 2.19999999999999986e-15Initial program 94.3%
associate-/l*94.3%
remove-double-neg94.3%
distribute-frac-neg294.3%
distribute-neg-frac294.3%
remove-double-neg94.3%
sqr-neg94.3%
associate-+l+94.3%
sqr-neg94.3%
distribute-rgt-out94.3%
Simplified94.3%
Taylor expanded in m around 0 93.7%
Final simplification97.2%
(FPCore (a k m)
:precision binary64
(if (<= m -1e+141)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 0.086)
(/ a (+ 1.0 (* k (+ k 10.0))))
(+ a (* a (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1e+141) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 0.086) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * ((k * 99.0) - 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 <= (-1d+141)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 0.086d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (a * (k * ((k * 99.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1e+141) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 0.086) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1e+141: tmp = a / ((k * k) + (k * 10.0)) elif m <= 0.086: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1e+141) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 0.086) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.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) tmp = 0.0; if (m <= -1e+141) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 0.086) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1e+141], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.086], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1 \cdot 10^{+141}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 0.086:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -1.00000000000000002e141Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 32.4%
Taylor expanded in k around inf 32.4%
Taylor expanded in k around inf 40.9%
if -1.00000000000000002e141 < m < 0.085999999999999993Initial program 96.4%
associate-/l*96.4%
remove-double-neg96.4%
distribute-frac-neg296.4%
distribute-neg-frac296.4%
remove-double-neg96.4%
sqr-neg96.4%
associate-+l+96.4%
sqr-neg96.4%
distribute-rgt-out96.4%
Simplified96.4%
Taylor expanded in m around 0 73.7%
if 0.085999999999999993 < m Initial program 74.7%
associate-/l*74.7%
remove-double-neg74.7%
distribute-frac-neg274.7%
distribute-neg-frac274.7%
remove-double-neg74.7%
sqr-neg74.7%
associate-+l+74.7%
sqr-neg74.7%
distribute-rgt-out74.7%
Simplified74.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 25.3%
Taylor expanded in a around 0 32.4%
Final simplification51.7%
(FPCore (a k m)
:precision binary64
(if (<= m -1.25e+141)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 0.086)
(/ a (+ 1.0 (* k (+ k 10.0))))
(+ a (* a (* k (* k 99.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.25e+141) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 0.086) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-1.25d+141)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 0.086d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (a * (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.25e+141) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 0.086) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.25e+141: tmp = a / ((k * k) + (k * 10.0)) elif m <= 0.086: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.25e+141) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 0.086) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(a * Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.25e+141) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 0.086) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.25e+141], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.086], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.25 \cdot 10^{+141}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 0.086:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < -1.25000000000000006e141Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 32.4%
Taylor expanded in k around inf 32.4%
Taylor expanded in k around inf 40.9%
if -1.25000000000000006e141 < m < 0.085999999999999993Initial program 96.4%
associate-/l*96.4%
remove-double-neg96.4%
distribute-frac-neg296.4%
distribute-neg-frac296.4%
remove-double-neg96.4%
sqr-neg96.4%
associate-+l+96.4%
sqr-neg96.4%
distribute-rgt-out96.4%
Simplified96.4%
Taylor expanded in m around 0 73.7%
if 0.085999999999999993 < m Initial program 74.7%
associate-/l*74.7%
remove-double-neg74.7%
distribute-frac-neg274.7%
distribute-neg-frac274.7%
remove-double-neg74.7%
sqr-neg74.7%
associate-+l+74.7%
sqr-neg74.7%
distribute-rgt-out74.7%
Simplified74.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 25.3%
Taylor expanded in a around 0 32.4%
Taylor expanded in k around inf 32.4%
*-commutative32.4%
Simplified32.4%
Final simplification51.7%
(FPCore (a k m) :precision binary64 (if (<= m 1.35e+18) (* a (/ 1.0 (+ 1.0 (* k k)))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.35e+18) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.35d+18) then
tmp = a * (1.0d0 / (1.0d0 + (k * k)))
else
tmp = a + ((-10.0d0) * (a * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.35e+18) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.35e+18: tmp = a * (1.0 / (1.0 + (k * k))) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.35e+18) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * k)))); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.35e+18) tmp = a * (1.0 / (1.0 + (k * k))); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.35e+18], N[(a * N[(1.0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.35 \cdot 10^{+18}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 1.35e18Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 58.8%
Taylor expanded in k around inf 58.2%
if 1.35e18 < m Initial program 74.2%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.5%
*-commutative7.5%
Simplified7.5%
Final simplification40.5%
(FPCore (a k m) :precision binary64 (if (<= m 4e+18) (/ a (+ 1.0 (* k k))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4e+18) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 4d+18) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a + ((-10.0d0) * (a * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 4e+18) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4e+18: tmp = a / (1.0 + (k * k)) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4e+18) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 4e+18) tmp = a / (1.0 + (k * k)); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4e+18], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4 \cdot 10^{+18}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 4e18Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 58.8%
Taylor expanded in k around inf 58.1%
if 4e18 < m Initial program 74.2%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.5%
*-commutative7.5%
Simplified7.5%
Final simplification40.5%
(FPCore (a k m) :precision binary64 (if (<= m 4.1e+18) (/ a (+ 1.0 (* k 10.0))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.1e+18) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 4.1d+18) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a + ((-10.0d0) * (a * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 4.1e+18) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4.1e+18: tmp = a / (1.0 + (k * 10.0)) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4.1e+18) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 4.1e+18) tmp = a / (1.0 + (k * 10.0)); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4.1e+18], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.1 \cdot 10^{+18}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 4.1e18Initial program 97.7%
associate-/l*97.7%
remove-double-neg97.7%
distribute-frac-neg297.7%
distribute-neg-frac297.7%
remove-double-neg97.7%
sqr-neg97.7%
associate-+l+97.7%
sqr-neg97.7%
distribute-rgt-out97.7%
Simplified97.7%
Taylor expanded in m around 0 58.8%
Taylor expanded in k around 0 35.7%
*-commutative81.3%
Simplified35.7%
if 4.1e18 < m Initial program 74.2%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.5%
*-commutative7.5%
Simplified7.5%
Final simplification25.9%
(FPCore (a k m) :precision binary64 (+ a (* -10.0 (* a k))))
double code(double a, double k, double m) {
return a + (-10.0 * (a * 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 + ((-10.0d0) * (a * k))
end function
public static double code(double a, double k, double m) {
return a + (-10.0 * (a * k));
}
def code(a, k, m): return a + (-10.0 * (a * k))
function code(a, k, m) return Float64(a + Float64(-10.0 * Float64(a * k))) end
function tmp = code(a, k, m) tmp = a + (-10.0 * (a * k)); end
code[a_, k_, m_] := N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + -10 \cdot \left(a \cdot k\right)
\end{array}
Initial program 89.5%
associate-/l*89.5%
remove-double-neg89.5%
distribute-frac-neg289.5%
distribute-neg-frac289.5%
remove-double-neg89.5%
sqr-neg89.5%
associate-+l+89.5%
sqr-neg89.5%
distribute-rgt-out89.5%
Simplified89.5%
Taylor expanded in m around 0 39.4%
Taylor expanded in k around 0 17.3%
*-commutative17.3%
Simplified17.3%
Final simplification17.3%
(FPCore (a k m) :precision binary64 a)
double code(double a, double k, double m) {
return a;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a
end function
public static double code(double a, double k, double m) {
return a;
}
def code(a, k, m): return a
function code(a, k, m) return a end
function tmp = code(a, k, m) tmp = a; end
code[a_, k_, m_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 89.5%
associate-/l*89.5%
remove-double-neg89.5%
distribute-frac-neg289.5%
distribute-neg-frac289.5%
remove-double-neg89.5%
sqr-neg89.5%
associate-+l+89.5%
sqr-neg89.5%
distribute-rgt-out89.5%
Simplified89.5%
Taylor expanded in m around 0 39.4%
Taylor expanded in k around 0 16.7%
herbie shell --seed 2024191
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))