
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (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 (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 (<= m 0.086) (* a (/ (pow k m) (+ 1.0 (* k k)))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.086) {
tmp = a * (pow(k, m) / (1.0 + (k * k)));
} 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 <= 0.086d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * k)))
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 <= 0.086) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * k)));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.086: tmp = a * (math.pow(k, m) / (1.0 + (k * k))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.086) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * k)))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.086) tmp = a * ((k ^ m) / (1.0 + (k * k))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.086], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.086:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 0.085999999999999993Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.6%
Simplified97.6%
Taylor expanded in k around inf 97.0%
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 k around 0 100.0%
(FPCore (a k m) :precision binary64 (if (<= m -2.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 <= -2.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 <= (-2.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 <= -2.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 <= -2.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 <= -2.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 <= -2.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, -2.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 -2.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 < -2.30000000000000007e-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 -2.30000000000000007e-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 -3.2e-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 <= -3.2e-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 <= (-3.2d-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 <= -3.2e-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 <= -3.2e-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 <= -3.2e-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 <= -3.2e-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, -3.2e-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 -3.2 \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 < -3.19999999999999981e-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 -3.19999999999999981e-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 -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) 10.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) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-1.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) - 10.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) - 10.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) - 10.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(Float64(k * 99.0) - 10.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) - 10.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[(N[(k * 99.0), $MachinePrecision] - 10.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 - 10\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%
Final simplification51.7%
(FPCore (a k m) :precision binary64 (if (<= m 0.086) (/ a (+ 1.0 (/ (* k (- 100.0 (* k k))) (- 10.0 k)))) (+ a (* a (* k (- (* k 99.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.086) {
tmp = a / (1.0 + ((k * (100.0 - (k * k))) / (10.0 - k)));
} 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 <= 0.086d0) then
tmp = a / (1.0d0 + ((k * (100.0d0 - (k * k))) / (10.0d0 - k)))
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 <= 0.086) {
tmp = a / (1.0 + ((k * (100.0 - (k * k))) / (10.0 - k)));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.086: tmp = a / (1.0 + ((k * (100.0 - (k * k))) / (10.0 - k))) else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.086) tmp = Float64(a / Float64(1.0 + Float64(Float64(k * Float64(100.0 - Float64(k * k))) / Float64(10.0 - k)))); 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 <= 0.086) tmp = a / (1.0 + ((k * (100.0 - (k * k))) / (10.0 - k))); else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.086], N[(a / N[(1.0 + N[(N[(k * N[(100.0 - N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(10.0 - k), $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 0.086:\\
\;\;\;\;\frac{a}{1 + \frac{k \cdot \left(100 - k \cdot k\right)}{10 - k}}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < 0.085999999999999993Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.6%
Simplified97.6%
Taylor expanded in m around 0 59.4%
*-commutative59.4%
flip-+59.4%
associate-*l/60.0%
metadata-eval60.0%
pow260.0%
Applied egg-rr60.0%
pow260.0%
Applied egg-rr60.0%
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 simplification50.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)))))))
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)));
}
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)))
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)));
}
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))) 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(k * 99.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))); 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[(k * 99.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\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%
Taylor expanded in k around inf 32.4%
*-commutative32.4%
Simplified32.4%
Final simplification51.7%
(FPCore (a k m) :precision binary64 (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 <= 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 <= 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 <= 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 <= 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 <= 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 <= 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, 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 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 < 0.085999999999999993Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.6%
Simplified97.6%
Taylor expanded in m around 0 59.4%
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 simplification49.8%
(FPCore (a k m) :precision binary64 (if (<= m 0.086) (* a (/ 1.0 (+ 1.0 (* k k)))) (+ a (* a (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.086) {
tmp = a * (1.0 / (1.0 + (k * k)));
} 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 <= 0.086d0) then
tmp = a * (1.0d0 / (1.0d0 + (k * k)))
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 <= 0.086) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.086: tmp = a * (1.0 / (1.0 + (k * k))) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.086) tmp = Float64(a * Float64(1.0 / 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 (m <= 0.086) tmp = a * (1.0 / (1.0 + (k * k))); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.086], N[(a * N[(1.0 / 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}\;m \leq 0.086:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 0.085999999999999993Initial program 97.6%
associate-/l*97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
distribute-neg-frac297.6%
remove-double-neg97.6%
sqr-neg97.6%
associate-+l+97.6%
sqr-neg97.6%
distribute-rgt-out97.6%
Simplified97.6%
Taylor expanded in m around 0 59.4%
Taylor expanded in k around inf 58.8%
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%
(FPCore (a k m) :precision binary64 (if (<= m 9.5e+17) (* a (/ 1.0 (+ 1.0 (* k k)))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 9.5e+17) {
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 <= 9.5d+17) 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 <= 9.5e+17) {
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 <= 9.5e+17: 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 <= 9.5e+17) 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 <= 9.5e+17) 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, 9.5e+17], 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 9.5 \cdot 10^{+17}:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 9.5e17Initial 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 9.5e17 < 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 3.95e+18) (/ a (+ 1.0 (* k k))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.95e+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 <= 3.95d+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 <= 3.95e+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 <= 3.95e+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 <= 3.95e+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 <= 3.95e+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, 3.95e+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 3.95 \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 < 3.95e18Initial 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 3.95e18 < 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 3.5e+18) (/ a (+ 1.0 (* k 10.0))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.5e+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 <= 3.5d+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 <= 3.5e+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 <= 3.5e+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 <= 3.5e+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 <= 3.5e+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, 3.5e+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 3.5 \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 < 3.5e18Initial 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 3.5e18 < 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))))