
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a)) (t_1 (/ 1.0 t_0))) (if (<= k 2e-48) t_0 (/ 1.0 (+ t_1 (* k (+ (* 10.0 t_1) (/ k t_0))))))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 2e-48) {
tmp = t_0;
} else {
tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (k ** m) * a
t_1 = 1.0d0 / t_0
if (k <= 2d-48) then
tmp = t_0
else
tmp = 1.0d0 / (t_1 + (k * ((10.0d0 * t_1) + (k / t_0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 2e-48) {
tmp = t_0;
} else {
tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0))));
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a t_1 = 1.0 / t_0 tmp = 0 if k <= 2e-48: tmp = t_0 else: tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0)))) return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (k <= 2e-48) tmp = t_0; else tmp = Float64(1.0 / Float64(t_1 + Float64(k * Float64(Float64(10.0 * t_1) + Float64(k / t_0))))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; t_1 = 1.0 / t_0; tmp = 0.0; if (k <= 2e-48) tmp = t_0; else tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[k, 2e-48], t$95$0, N[(1.0 / N[(t$95$1 + N[(k * N[(N[(10.0 * t$95$1), $MachinePrecision] + N[(k / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
t_1 := \frac{1}{t\_0}\\
\mathbf{if}\;k \leq 2 \cdot 10^{-48}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + k \cdot \left(10 \cdot t\_1 + \frac{k}{t\_0}\right)}\\
\end{array}
\end{array}
if k < 1.9999999999999999e-48Initial program 96.2%
associate-/l*96.2%
remove-double-neg96.2%
distribute-frac-neg296.2%
distribute-neg-frac296.2%
remove-double-neg96.2%
sqr-neg96.2%
associate-+l+96.2%
sqr-neg96.2%
distribute-rgt-out96.2%
Simplified96.2%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 1.9999999999999999e-48 < k Initial program 82.0%
associate-/l*81.9%
remove-double-neg81.9%
distribute-frac-neg281.9%
distribute-neg-frac281.9%
remove-double-neg81.9%
sqr-neg81.9%
associate-+l+81.9%
sqr-neg81.9%
distribute-rgt-out81.9%
Simplified81.9%
distribute-lft-in81.9%
associate-+l+81.9%
associate-*r/82.0%
clear-num82.0%
associate-+l+82.0%
distribute-lft-in82.0%
+-commutative82.0%
fma-define82.0%
+-commutative82.0%
*-commutative82.0%
Applied egg-rr82.0%
Taylor expanded in k around 0 99.9%
Final simplification100.0%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 2e+278)
(* (/ (pow k m) (hypot 1.0 k)) (/ a (hypot 1.0 k)))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+278) {
tmp = (pow(k, m) / hypot(1.0, k)) * (a / hypot(1.0, k));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+278) {
tmp = (Math.pow(k, m) / Math.hypot(1.0, k)) * (a / Math.hypot(1.0, k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+278: tmp = (math.pow(k, m) / math.hypot(1.0, k)) * (a / math.hypot(1.0, k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 2e+278) tmp = Float64(Float64((k ^ m) / hypot(1.0, k)) * Float64(a / hypot(1.0, k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+278) tmp = ((k ^ m) / hypot(1.0, k)) * (a / hypot(1.0, k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+278], N[(N[(N[Power[k, m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 2 \cdot 10^{+278}:\\
\;\;\;\;\frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right)} \cdot \frac{a}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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))) < 1.99999999999999993e278Initial program 98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in k around 0 97.5%
*-commutative97.5%
add-sqr-sqrt97.5%
times-frac97.0%
hypot-1-def97.0%
hypot-1-def98.3%
Applied egg-rr98.3%
if 1.99999999999999993e278 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 59.6%
associate-/l*59.6%
remove-double-neg59.6%
distribute-frac-neg259.6%
distribute-neg-frac259.6%
remove-double-neg59.6%
sqr-neg59.6%
associate-+l+59.6%
sqr-neg59.6%
distribute-rgt-out59.6%
Simplified59.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.7%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 5e+190)
(/ (pow k m) (* (hypot 1.0 k) (/ (hypot 1.0 k) a)))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+190) {
tmp = pow(k, m) / (hypot(1.0, k) * (hypot(1.0, k) / a));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+190) {
tmp = Math.pow(k, m) / (Math.hypot(1.0, k) * (Math.hypot(1.0, k) / a));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+190: tmp = math.pow(k, m) / (math.hypot(1.0, k) * (math.hypot(1.0, k) / a)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 5e+190) tmp = Float64((k ^ m) / Float64(hypot(1.0, k) * Float64(hypot(1.0, k) / a))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 5e+190) tmp = (k ^ m) / (hypot(1.0, k) * (hypot(1.0, k) / a)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+190], N[(N[Power[k, m], $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 5 \cdot 10^{+190}:\\
\;\;\;\;\frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right) \cdot \frac{\mathsf{hypot}\left(1, k\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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))) < 5.00000000000000036e190Initial program 98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in k around 0 97.7%
*-commutative97.7%
add-sqr-sqrt97.7%
times-frac97.1%
hypot-1-def97.1%
hypot-1-def98.5%
Applied egg-rr98.5%
*-commutative98.5%
clear-num98.5%
frac-times98.0%
*-un-lft-identity98.0%
Applied egg-rr98.0%
if 5.00000000000000036e190 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 61.1%
associate-/l*61.1%
remove-double-neg61.1%
distribute-frac-neg261.1%
distribute-neg-frac261.1%
remove-double-neg61.1%
sqr-neg61.1%
associate-+l+61.1%
sqr-neg61.1%
distribute-rgt-out61.1%
Simplified61.1%
Taylor expanded in k around 0 99.2%
*-commutative99.2%
Simplified99.2%
Final simplification98.3%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a)) (t_1 (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))))) (if (<= t_1 2e+278) t_1 t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 2e+278) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (k ** m) * a
t_1 = t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))
if (t_1 <= 2d+278) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 2e+278) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)) tmp = 0 if t_1 <= 2e+278: tmp = t_1 else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) t_1 = Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) tmp = 0.0 if (t_1 <= 2e+278) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)); tmp = 0.0; if (t_1 <= 2e+278) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+278], t$95$1, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
t_1 := \frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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))) < 1.99999999999999993e278Initial program 98.6%
if 1.99999999999999993e278 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 59.6%
associate-/l*59.6%
remove-double-neg59.6%
distribute-frac-neg259.6%
distribute-neg-frac259.6%
remove-double-neg59.6%
sqr-neg59.6%
associate-+l+59.6%
sqr-neg59.6%
distribute-rgt-out59.6%
Simplified59.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.9%
(FPCore (a k m) :precision binary64 (if (<= m 1.3e-53) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.3e-53) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = pow(k, m) * a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.3d-53) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.3e-53) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.3e-53: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.3e-53) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.3e-53) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.3e-53], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 1.29999999999999998e-53Initial program 98.1%
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%
if 1.29999999999999998e-53 < m Initial program 80.6%
associate-/l*80.6%
remove-double-neg80.6%
distribute-frac-neg280.6%
distribute-neg-frac280.6%
remove-double-neg80.6%
sqr-neg80.6%
associate-+l+80.6%
sqr-neg80.6%
distribute-rgt-out80.6%
Simplified80.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.9%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a))) (if (<= m 1.3e-53) (/ t_0 (+ 1.0 (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 1.3e-53) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (m <= 1.3d-53) then
tmp = t_0 / (1.0d0 + (k * k))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if (m <= 1.3e-53) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 1.3e-53: tmp = t_0 / (1.0 + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 1.3e-53) tmp = Float64(t_0 / Float64(1.0 + Float64(k * k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (m <= 1.3e-53) tmp = t_0 / (1.0 + (k * k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, 1.3e-53], N[(t$95$0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 1.29999999999999998e-53Initial program 98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in k around 0 96.5%
if 1.29999999999999998e-53 < m Initial program 80.6%
associate-/l*80.6%
remove-double-neg80.6%
distribute-frac-neg280.6%
distribute-neg-frac280.6%
remove-double-neg80.6%
sqr-neg80.6%
associate-+l+80.6%
sqr-neg80.6%
distribute-rgt-out80.6%
Simplified80.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -1.66e-15) (not (<= m 1.3e-53))) (* (pow k m) a) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -1.66e-15) || !(m <= 1.3e-53)) {
tmp = pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-1.66d-15)) .or. (.not. (m <= 1.3d-53))) then
tmp = (k ** m) * a
else
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -1.66e-15) || !(m <= 1.3e-53)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -1.66e-15) or not (m <= 1.3e-53): tmp = math.pow(k, m) * a else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -1.66e-15) || !(m <= 1.3e-53)) tmp = Float64((k ^ m) * a); else tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -1.66e-15) || ~((m <= 1.3e-53))) tmp = (k ^ m) * a; else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -1.66e-15], N[Not[LessEqual[m, 1.3e-53]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.66 \cdot 10^{-15} \lor \neg \left(m \leq 1.3 \cdot 10^{-53}\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -1.65999999999999996e-15 or 1.29999999999999998e-53 < m Initial program 88.9%
associate-/l*88.9%
remove-double-neg88.9%
distribute-frac-neg288.9%
distribute-neg-frac288.9%
remove-double-neg88.9%
sqr-neg88.9%
associate-+l+88.9%
sqr-neg88.9%
distribute-rgt-out88.9%
Simplified88.9%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -1.65999999999999996e-15 < m < 1.29999999999999998e-53Initial program 95.8%
associate-/l*95.7%
remove-double-neg95.7%
distribute-frac-neg295.7%
distribute-neg-frac295.7%
remove-double-neg95.7%
sqr-neg95.7%
associate-+l+95.7%
sqr-neg95.7%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 95.7%
Final simplification98.9%
(FPCore (a k m) :precision binary64 (if (<= m -0.46) (/ 0.1 (/ k a)) (if (<= m 1.3e-53) (/ a (+ 1.0 (* k 10.0))) (+ a (* a (* k (* k 99.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.46) {
tmp = 0.1 / (k / a);
} else if (m <= 1.3e-53) {
tmp = a / (1.0 + (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.46d0)) then
tmp = 0.1d0 / (k / a)
else if (m <= 1.3d-53) then
tmp = a / (1.0d0 + (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.46) {
tmp = 0.1 / (k / a);
} else if (m <= 1.3e-53) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (a * (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.46: tmp = 0.1 / (k / a) elif m <= 1.3e-53: tmp = a / (1.0 + (k * 10.0)) else: tmp = a + (a * (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.46) tmp = Float64(0.1 / Float64(k / a)); elseif (m <= 1.3e-53) tmp = Float64(a / Float64(1.0 + 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.46) tmp = 0.1 / (k / a); elseif (m <= 1.3e-53) tmp = a / (1.0 + (k * 10.0)); else tmp = a + (a * (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.46], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.3e-53], N[(a / N[(1.0 + N[(k * 10.0), $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.46:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{elif}\;m \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < -0.46000000000000002Initial 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 39.3%
Taylor expanded in k around 0 16.6%
*-commutative16.6%
Simplified16.6%
Taylor expanded in k around inf 22.4%
clear-num22.5%
un-div-inv22.5%
Applied egg-rr22.5%
if -0.46000000000000002 < m < 1.29999999999999998e-53Initial program 95.9%
associate-/l*95.8%
remove-double-neg95.8%
distribute-frac-neg295.8%
distribute-neg-frac295.8%
remove-double-neg95.8%
sqr-neg95.8%
associate-+l+95.8%
sqr-neg95.8%
distribute-rgt-out95.8%
Simplified95.8%
Taylor expanded in m around 0 94.7%
Taylor expanded in k around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 1.29999999999999998e-53 < m Initial program 80.6%
associate-/l*80.6%
remove-double-neg80.6%
distribute-frac-neg280.6%
distribute-neg-frac280.6%
remove-double-neg80.6%
sqr-neg80.6%
associate-+l+80.6%
sqr-neg80.6%
distribute-rgt-out80.6%
Simplified80.6%
Taylor expanded in m around 0 5.5%
Taylor expanded in k around 0 28.9%
cancel-sign-sub-inv28.9%
mul-1-neg28.9%
distribute-rgt-neg-in28.9%
distribute-rgt1-in28.9%
distribute-lft-neg-in28.9%
metadata-eval28.9%
metadata-eval28.9%
metadata-eval28.9%
*-commutative28.9%
Simplified28.9%
Taylor expanded in a around 0 31.5%
Taylor expanded in k around inf 31.5%
*-commutative31.5%
Simplified31.5%
Final simplification38.4%
(FPCore (a k m) :precision binary64 (if (<= m -0.395) (/ 0.1 (/ k a)) (if (<= m 5.3e+58) (/ a (+ 1.0 (* k 10.0))) (+ a (* -10.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.395) {
tmp = 0.1 / (k / a);
} else if (m <= 5.3e+58) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.395d0)) then
tmp = 0.1d0 / (k / a)
else if (m <= 5.3d+58) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a + ((-10.0d0) * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.395) {
tmp = 0.1 / (k / a);
} else if (m <= 5.3e+58) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-10.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.395: tmp = 0.1 / (k / a) elif m <= 5.3e+58: tmp = a / (1.0 + (k * 10.0)) else: tmp = a + (-10.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.395) tmp = Float64(0.1 / Float64(k / a)); elseif (m <= 5.3e+58) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a + Float64(-10.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.395) tmp = 0.1 / (k / a); elseif (m <= 5.3e+58) tmp = a / (1.0 + (k * 10.0)); else tmp = a + (-10.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.395], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5.3e+58], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.395:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{elif}\;m \leq 5.3 \cdot 10^{+58}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -0.39500000000000002Initial 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 39.3%
Taylor expanded in k around 0 16.6%
*-commutative16.6%
Simplified16.6%
Taylor expanded in k around inf 22.4%
clear-num22.5%
un-div-inv22.5%
Applied egg-rr22.5%
if -0.39500000000000002 < m < 5.3000000000000006e58Initial program 95.4%
associate-/l*95.3%
remove-double-neg95.3%
distribute-frac-neg295.3%
distribute-neg-frac295.3%
remove-double-neg95.3%
sqr-neg95.3%
associate-+l+95.3%
sqr-neg95.3%
distribute-rgt-out95.3%
Simplified95.3%
Taylor expanded in m around 0 82.4%
Taylor expanded in k around 0 60.0%
*-commutative60.0%
Simplified60.0%
if 5.3000000000000006e58 < m Initial program 78.7%
associate-/l*78.7%
remove-double-neg78.7%
distribute-frac-neg278.7%
distribute-neg-frac278.7%
remove-double-neg78.7%
sqr-neg78.7%
associate-+l+78.7%
sqr-neg78.7%
distribute-rgt-out78.7%
Simplified78.7%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 7.9%
Final simplification29.3%
(FPCore (a k m) :precision binary64 (if (<= m 1.92) (/ 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.92) {
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.92d0) 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.92) {
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.92: 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.92) 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.92) 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.92], 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.92:\\
\;\;\;\;\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.9199999999999999Initial program 98.1%
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 65.7%
if 1.9199999999999999 < m Initial program 80.0%
associate-/l*80.0%
remove-double-neg80.0%
distribute-frac-neg280.0%
distribute-neg-frac280.0%
remove-double-neg80.0%
sqr-neg80.0%
associate-+l+80.0%
sqr-neg80.0%
distribute-rgt-out80.0%
Simplified80.0%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 27.0%
cancel-sign-sub-inv27.0%
mul-1-neg27.0%
distribute-rgt-neg-in27.0%
distribute-rgt1-in27.0%
distribute-lft-neg-in27.0%
metadata-eval27.0%
metadata-eval27.0%
metadata-eval27.0%
*-commutative27.0%
Simplified27.0%
Taylor expanded in a around 0 29.7%
Taylor expanded in k around inf 29.7%
*-commutative29.7%
Simplified29.7%
Final simplification50.9%
(FPCore (a k m) :precision binary64 (if (<= k 0.00042) (+ a (* -10.0 (* k a))) (/ 0.1 (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.00042) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 0.00042d0) then
tmp = a + ((-10.0d0) * (k * a))
else
tmp = 0.1d0 / (k / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.00042) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.00042: tmp = a + (-10.0 * (k * a)) else: tmp = 0.1 / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.00042) tmp = Float64(a + Float64(-10.0 * Float64(k * a))); else tmp = Float64(0.1 / Float64(k / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.00042) tmp = a + (-10.0 * (k * a)); else tmp = 0.1 / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.00042], N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00042:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 4.2000000000000002e-4Initial 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 34.0%
Taylor expanded in k around 0 28.8%
if 4.2000000000000002e-4 < k Initial program 79.7%
associate-/l*79.7%
remove-double-neg79.7%
distribute-frac-neg279.7%
distribute-neg-frac279.7%
remove-double-neg79.7%
sqr-neg79.7%
associate-+l+79.7%
sqr-neg79.7%
distribute-rgt-out79.7%
Simplified79.7%
Taylor expanded in m around 0 51.4%
Taylor expanded in k around 0 20.7%
*-commutative20.7%
Simplified20.7%
Taylor expanded in k around inf 20.6%
clear-num21.0%
un-div-inv21.0%
Applied egg-rr21.0%
Final simplification26.1%
(FPCore (a k m) :precision binary64 (if (<= m -6e-72) (* 0.1 (/ a k)) a))
double code(double a, double k, double m) {
double tmp;
if (m <= -6e-72) {
tmp = 0.1 * (a / k);
} else {
tmp = a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-6d-72)) then
tmp = 0.1d0 * (a / k)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -6e-72) {
tmp = 0.1 * (a / k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -6e-72: tmp = 0.1 * (a / k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -6e-72) tmp = Float64(0.1 * Float64(a / k)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -6e-72) tmp = 0.1 * (a / k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -6e-72], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6 \cdot 10^{-72}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if m < -6e-72Initial 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 45.2%
Taylor expanded in k around 0 21.1%
*-commutative21.1%
Simplified21.1%
Taylor expanded in k around inf 24.0%
if -6e-72 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in m around 0 37.2%
Taylor expanded in k around 0 24.8%
Final simplification24.5%
(FPCore (a k m) :precision binary64 (if (<= m -6e-72) (/ 0.1 (/ k a)) a))
double code(double a, double k, double m) {
double tmp;
if (m <= -6e-72) {
tmp = 0.1 / (k / a);
} else {
tmp = a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-6d-72)) then
tmp = 0.1d0 / (k / a)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -6e-72) {
tmp = 0.1 / (k / a);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -6e-72: tmp = 0.1 / (k / a) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -6e-72) tmp = Float64(0.1 / Float64(k / a)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -6e-72) tmp = 0.1 / (k / a); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -6e-72], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6 \cdot 10^{-72}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if m < -6e-72Initial 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 45.2%
Taylor expanded in k around 0 21.1%
*-commutative21.1%
Simplified21.1%
Taylor expanded in k around inf 24.0%
clear-num24.1%
un-div-inv24.1%
Applied egg-rr24.1%
if -6e-72 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in m around 0 37.2%
Taylor expanded in k around 0 24.8%
Final simplification24.5%
(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 90.7%
associate-/l*90.7%
remove-double-neg90.7%
distribute-frac-neg290.7%
distribute-neg-frac290.7%
remove-double-neg90.7%
sqr-neg90.7%
associate-+l+90.7%
sqr-neg90.7%
distribute-rgt-out90.7%
Simplified90.7%
Taylor expanded in m around 0 40.0%
Taylor expanded in k around 0 18.4%
Final simplification18.4%
herbie shell --seed 2024071
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))