
(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 (let* ((t_0 (* (pow k m) a)) (t_1 (/ 1.0 t_0))) (if (<= k 1e-22) 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 <= 1e-22) {
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 <= 1d-22) 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 <= 1e-22) {
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 <= 1e-22: 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 <= 1e-22) 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 <= 1e-22) 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, 1e-22], 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 10^{-22}:\\
\;\;\;\;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 < 1e-22Initial program 95.2%
associate-/l*95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-neg-frac295.2%
remove-double-neg95.2%
sqr-neg95.2%
associate-+l+95.2%
sqr-neg95.2%
distribute-rgt-out95.9%
Simplified95.9%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 1e-22 < k Initial program 79.8%
associate-/l*79.8%
remove-double-neg79.8%
distribute-frac-neg279.8%
distribute-neg-frac279.8%
remove-double-neg79.8%
sqr-neg79.8%
associate-+l+79.8%
sqr-neg79.8%
distribute-rgt-out79.8%
Simplified79.8%
distribute-lft-in79.8%
associate-+l+79.8%
associate-*r/79.8%
clear-num79.8%
associate-+l+79.8%
distribute-lft-in79.8%
+-commutative79.8%
fma-define79.8%
+-commutative79.8%
*-commutative79.8%
Applied egg-rr79.8%
Taylor expanded in k around 0 98.6%
Final simplification99.4%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a)) (t_1 (/ t_0 (+ (* k k) (+ 1.0 (* k 10.0)))))) (if (<= t_1 5e+300) t_1 t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double t_1 = t_0 / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_1 <= 5e+300) {
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 / ((k * k) + (1.0d0 + (k * 10.0d0)))
if (t_1 <= 5d+300) 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 / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_1 <= 5e+300) {
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 / ((k * k) + (1.0 + (k * 10.0))) tmp = 0 if t_1 <= 5e+300: 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(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_1 <= 5e+300) 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 / ((k * k) + (1.0 + (k * 10.0))); tmp = 0.0; if (t_1 <= 5e+300) 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[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+300], t$95$1, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
t_1 := \frac{t\_0}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;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))) < 5.00000000000000026e300Initial program 96.7%
if 5.00000000000000026e300 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 52.2%
associate-/l*52.2%
remove-double-neg52.2%
distribute-frac-neg252.2%
distribute-neg-frac252.2%
remove-double-neg52.2%
sqr-neg52.2%
associate-+l+52.2%
sqr-neg52.2%
distribute-rgt-out54.3%
Simplified54.3%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.3%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m 3.3)
(/ 1.0 (+ (/ 1.0 t_0) (* (/ (/ k a) (pow k m)) (+ k 10.0))))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 3.3) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) / pow(k, m)) * (k + 10.0)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (m <= 3.3d0) then
tmp = 1.0d0 / ((1.0d0 / t_0) + (((k / a) / (k ** m)) * (k + 10.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if (m <= 3.3) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) / Math.pow(k, m)) * (k + 10.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 3.3: tmp = 1.0 / ((1.0 / t_0) + (((k / a) / math.pow(k, m)) * (k + 10.0))) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 3.3) tmp = Float64(1.0 / Float64(Float64(1.0 / t_0) + Float64(Float64(Float64(k / a) / (k ^ m)) * Float64(k + 10.0)))); 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 <= 3.3) tmp = 1.0 / ((1.0 / t_0) + (((k / a) / (k ^ m)) * (k + 10.0))); 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, 3.3], N[(1.0 / N[(N[(1.0 / t$95$0), $MachinePrecision] + N[(N[(N[(k / a), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 3.3:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0} + \frac{\frac{k}{a}}{{k}^{m}} \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 3.2999999999999998Initial program 95.6%
associate-/l*95.6%
remove-double-neg95.6%
distribute-frac-neg295.6%
distribute-neg-frac295.6%
remove-double-neg95.6%
sqr-neg95.6%
associate-+l+95.6%
sqr-neg95.6%
distribute-rgt-out96.2%
Simplified96.2%
distribute-lft-in95.6%
associate-+l+95.6%
associate-*r/95.6%
clear-num95.6%
associate-+l+95.6%
distribute-lft-in96.2%
+-commutative96.2%
fma-define96.2%
+-commutative96.2%
*-commutative96.2%
Applied egg-rr96.2%
Taylor expanded in k around 0 88.5%
*-un-lft-identity88.5%
fma-define88.5%
+-commutative88.5%
associate-/r*88.5%
un-div-inv88.5%
associate-/r*88.5%
Applied egg-rr88.5%
*-lft-identity88.5%
fma-undefine88.5%
+-commutative88.5%
associate-/r*88.5%
distribute-lft-in84.2%
*-commutative84.2%
associate-*l/84.2%
associate-*r/84.2%
associate-/r*84.2%
distribute-rgt-out95.3%
Simplified95.3%
if 3.2999999999999998 < m Initial program 76.6%
associate-/l*76.6%
remove-double-neg76.6%
distribute-frac-neg276.6%
distribute-neg-frac276.6%
remove-double-neg76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in k around 0 99.0%
*-commutative99.0%
Simplified99.0%
Final simplification96.6%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m -0.054)
t_0
(if (<= m 2.1e-17)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (/ k a) (* 10.0 (/ 1.0 a))))))
(if (<= m 2.6) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) t_0)))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= -0.054) {
tmp = t_0;
} else if (m <= 2.1e-17) {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
} else if (m <= 2.6) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (m <= (-0.054d0)) then
tmp = t_0
else if (m <= 2.1d-17) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k / a) + (10.0d0 * (1.0d0 / a)))))
else if (m <= 2.6d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if (m <= -0.054) {
tmp = t_0;
} else if (m <= 2.1e-17) {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
} else if (m <= 2.6) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= -0.054: tmp = t_0 elif m <= 2.1e-17: tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))) elif m <= 2.6: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= -0.054) tmp = t_0; elseif (m <= 2.1e-17) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k / a) + Float64(10.0 * Float64(1.0 / a)))))); elseif (m <= 2.6) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); 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 <= -0.054) tmp = t_0; elseif (m <= 2.1e-17) tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))); elseif (m <= 2.6) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); 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, -0.054], t$95$0, If[LessEqual[m, 2.1e-17], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.6], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq -0.054:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq 2.1 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(\frac{k}{a} + 10 \cdot \frac{1}{a}\right)}\\
\mathbf{elif}\;m \leq 2.6:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -0.0539999999999999994 or 2.60000000000000009 < m Initial program 86.4%
associate-/l*86.4%
remove-double-neg86.4%
distribute-frac-neg286.4%
distribute-neg-frac286.4%
remove-double-neg86.4%
sqr-neg86.4%
associate-+l+86.4%
sqr-neg86.4%
distribute-rgt-out87.0%
Simplified87.0%
Taylor expanded in k around 0 99.4%
*-commutative99.4%
Simplified99.4%
if -0.0539999999999999994 < m < 2.09999999999999992e-17Initial program 92.8%
associate-/l*92.8%
remove-double-neg92.8%
distribute-frac-neg292.8%
distribute-neg-frac292.8%
remove-double-neg92.8%
sqr-neg92.8%
associate-+l+92.8%
sqr-neg92.8%
distribute-rgt-out92.8%
Simplified92.8%
distribute-lft-in92.8%
associate-+l+92.8%
associate-*r/92.8%
clear-num92.7%
associate-+l+92.7%
distribute-lft-in92.7%
+-commutative92.7%
fma-define92.7%
+-commutative92.7%
*-commutative92.7%
Applied egg-rr92.7%
Taylor expanded in k around 0 99.2%
Taylor expanded in m around 0 98.9%
if 2.09999999999999992e-17 < m < 2.60000000000000009Initial program 99.0%
associate-/l*99.5%
remove-double-neg99.5%
distribute-frac-neg299.5%
distribute-neg-frac299.5%
remove-double-neg99.5%
sqr-neg99.5%
associate-+l+99.5%
sqr-neg99.5%
distribute-rgt-out99.5%
Simplified99.5%
Final simplification99.3%
(FPCore (a k m) :precision binary64 (if (or (<= m -1.45) (not (<= m 0.0145))) (* (pow k m) a) (/ 1.0 (+ (/ 1.0 a) (* k (+ (/ k a) (* 10.0 (/ 1.0 a))))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -1.45) || !(m <= 0.0145)) {
tmp = pow(k, m) * a;
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / 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.45d0)) .or. (.not. (m <= 0.0145d0))) then
tmp = (k ** m) * a
else
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k / a) + (10.0d0 * (1.0d0 / a)))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -1.45) || !(m <= 0.0145)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -1.45) or not (m <= 0.0145): tmp = math.pow(k, m) * a else: tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -1.45) || !(m <= 0.0145)) tmp = Float64((k ^ m) * a); else tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k / a) + Float64(10.0 * Float64(1.0 / a)))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -1.45) || ~((m <= 0.0145))) tmp = (k ^ m) * a; else tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -1.45], N[Not[LessEqual[m, 0.0145]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.45 \lor \neg \left(m \leq 0.0145\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(\frac{k}{a} + 10 \cdot \frac{1}{a}\right)}\\
\end{array}
\end{array}
if m < -1.44999999999999996 or 0.0145000000000000007 < m Initial program 86.4%
associate-/l*86.4%
remove-double-neg86.4%
distribute-frac-neg286.4%
distribute-neg-frac286.4%
remove-double-neg86.4%
sqr-neg86.4%
associate-+l+86.4%
sqr-neg86.4%
distribute-rgt-out87.0%
Simplified87.0%
Taylor expanded in k around 0 99.4%
*-commutative99.4%
Simplified99.4%
if -1.44999999999999996 < m < 0.0145000000000000007Initial program 93.0%
associate-/l*93.0%
remove-double-neg93.0%
distribute-frac-neg293.0%
distribute-neg-frac293.0%
remove-double-neg93.0%
sqr-neg93.0%
associate-+l+93.0%
sqr-neg93.0%
distribute-rgt-out93.0%
Simplified93.0%
distribute-lft-in93.0%
associate-+l+93.0%
associate-*r/93.0%
clear-num92.9%
associate-+l+92.9%
distribute-lft-in92.9%
+-commutative92.9%
fma-define92.9%
+-commutative92.9%
*-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in k around 0 99.3%
Taylor expanded in m around 0 97.5%
Final simplification98.8%
(FPCore (a k m)
:precision binary64
(if (<= m -0.12)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 1.8)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (/ k a) (* 10.0 (/ 1.0 a))))))
(+ a (* a (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.12) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.8) {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
} 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.12d0)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 1.8d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k / a) + (10.0d0 * (1.0d0 / a)))))
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.12) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.8) {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.12: tmp = a / ((k * k) + (k * 10.0)) elif m <= 1.8: tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))) else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.12) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 1.8) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k / a) + Float64(10.0 * Float64(1.0 / a)))))); 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.12) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 1.8) tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))); else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.12], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.8], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $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.12:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 1.8:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(\frac{k}{a} + 10 \cdot \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -0.12Initial program 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in m around 0 34.3%
Taylor expanded in k around inf 34.3%
Taylor expanded in k around inf 41.8%
*-commutative41.8%
Simplified41.8%
if -0.12 < m < 1.80000000000000004Initial program 93.0%
associate-/l*93.0%
remove-double-neg93.0%
distribute-frac-neg293.0%
distribute-neg-frac293.0%
remove-double-neg93.0%
sqr-neg93.0%
associate-+l+93.0%
sqr-neg93.0%
distribute-rgt-out93.0%
Simplified93.0%
distribute-lft-in93.0%
associate-+l+93.0%
associate-*r/93.0%
clear-num92.9%
associate-+l+92.9%
distribute-lft-in92.9%
+-commutative92.9%
fma-define92.9%
+-commutative92.9%
*-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in k around 0 99.3%
Taylor expanded in m around 0 97.5%
if 1.80000000000000004 < m Initial program 76.6%
associate-/l*76.6%
remove-double-neg76.6%
distribute-frac-neg276.6%
distribute-neg-frac276.6%
remove-double-neg76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 25.3%
Taylor expanded in a around 0 31.2%
Final simplification56.8%
(FPCore (a k m)
:precision binary64
(if (<= m -1.12e+74)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 1.7)
(/ a (+ (* k k) (+ 1.0 (* k 10.0))))
(+ a (* a (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.12e+74) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.7) {
tmp = a / ((k * k) + (1.0 + (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.12d+74)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 1.7d0) then
tmp = a / ((k * k) + (1.0d0 + (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.12e+74) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.7) {
tmp = a / ((k * k) + (1.0 + (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.12e+74: tmp = a / ((k * k) + (k * 10.0)) elif m <= 1.7: tmp = a / ((k * k) + (1.0 + (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.12e+74) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 1.7) tmp = Float64(a / Float64(Float64(k * k) + Float64(1.0 + 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.12e+74) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 1.7) tmp = a / ((k * k) + (1.0 + (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.12e+74], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.7], N[(a / N[(N[(k * k), $MachinePrecision] + N[(1.0 + 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.12 \cdot 10^{+74}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 1.7:\\
\;\;\;\;\frac{a}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -1.12000000000000003e74Initial program 98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in m around 0 34.7%
Taylor expanded in k around inf 34.7%
Taylor expanded in k around inf 44.2%
*-commutative44.2%
Simplified44.2%
if -1.12000000000000003e74 < m < 1.69999999999999996Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in m around 0 82.5%
if 1.69999999999999996 < m Initial program 76.6%
associate-/l*76.6%
remove-double-neg76.6%
distribute-frac-neg276.6%
distribute-neg-frac276.6%
remove-double-neg76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 25.3%
Taylor expanded in a around 0 31.2%
Final simplification54.9%
(FPCore (a k m)
:precision binary64
(if (<= m -8.5e+71)
(/ a (+ (* k k) (* k 10.0)))
(if (<= m 1.85)
(/ 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 <= -8.5e+71) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.85) {
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 <= (-8.5d+71)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 1.85d0) 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 <= -8.5e+71) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 1.85) {
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 <= -8.5e+71: tmp = a / ((k * k) + (k * 10.0)) elif m <= 1.85: 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 <= -8.5e+71) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 1.85) 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 <= -8.5e+71) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 1.85) 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, -8.5e+71], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.85], 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 -8.5 \cdot 10^{+71}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 1.85:\\
\;\;\;\;\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 < -8.4999999999999996e71Initial program 98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in m around 0 34.7%
Taylor expanded in k around inf 34.7%
Taylor expanded in k around inf 44.2%
*-commutative44.2%
Simplified44.2%
if -8.4999999999999996e71 < m < 1.8500000000000001Initial program 94.1%
associate-/l*94.1%
remove-double-neg94.1%
distribute-frac-neg294.1%
distribute-neg-frac294.1%
remove-double-neg94.1%
sqr-neg94.1%
associate-+l+94.1%
sqr-neg94.1%
distribute-rgt-out94.1%
Simplified94.1%
Taylor expanded in m around 0 82.5%
if 1.8500000000000001 < m Initial program 76.6%
associate-/l*76.6%
remove-double-neg76.6%
distribute-frac-neg276.6%
distribute-neg-frac276.6%
remove-double-neg76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 25.3%
Taylor expanded in a around 0 31.2%
Final simplification54.9%
(FPCore (a k m) :precision binary64 (if (<= m -1e+73) (/ a (+ (* k k) (* k 10.0))) (if (<= m 5.5) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1e+73) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 5.5) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (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 <= (-1d+73)) then
tmp = a / ((k * k) + (k * 10.0d0))
else if (m <= 5.5d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1e+73) {
tmp = a / ((k * k) + (k * 10.0));
} else if (m <= 5.5) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1e+73: tmp = a / ((k * k) + (k * 10.0)) elif m <= 5.5: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1e+73) tmp = Float64(a / Float64(Float64(k * k) + Float64(k * 10.0))); elseif (m <= 5.5) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1e+73) tmp = a / ((k * k) + (k * 10.0)); elseif (m <= 5.5) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1e+73], N[(a / N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5.5], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1 \cdot 10^{+73}:\\
\;\;\;\;\frac{a}{k \cdot k + k \cdot 10}\\
\mathbf{elif}\;m \leq 5.5:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -9.99999999999999983e72Initial program 98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in m around 0 34.7%
Taylor expanded in k around inf 34.7%
Taylor expanded in k around inf 44.2%
*-commutative44.2%
Simplified44.2%
if -9.99999999999999983e72 < m < 5.5Initial program 93.3%
associate-/l*93.2%
remove-double-neg93.2%
distribute-frac-neg293.2%
distribute-neg-frac293.2%
remove-double-neg93.2%
sqr-neg93.2%
associate-+l+93.2%
sqr-neg93.2%
distribute-rgt-out93.2%
Simplified93.2%
Taylor expanded in m around 0 81.8%
if 5.5 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 6.7%
Taylor expanded in k around inf 14.5%
*-commutative14.5%
*-commutative14.5%
*-commutative14.5%
associate-*r*14.5%
Simplified14.5%
Final simplification48.7%
(FPCore (a k m) :precision binary64 (if (<= m 3.8) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.8) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (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.8d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 3.8) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 3.8: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 3.8) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 3.8) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 3.8], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3.8:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 3.7999999999999998Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 65.3%
if 3.7999999999999998 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 6.7%
Taylor expanded in k around inf 14.5%
*-commutative14.5%
*-commutative14.5%
*-commutative14.5%
associate-*r*14.5%
Simplified14.5%
Final simplification46.9%
(FPCore (a k m) :precision binary64 (if (<= m 3.6) (/ a (+ 1.0 (* k k))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.6) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (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.6d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 3.6) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 3.6: tmp = a / (1.0 + (k * k)) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 3.6) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 3.6) tmp = a / (1.0 + (k * k)); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 3.6], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3.6:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 3.60000000000000009Initial program 95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in m around 0 64.7%
Taylor expanded in k around inf 64.7%
Taylor expanded in k around 0 64.2%
if 3.60000000000000009 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 6.7%
Taylor expanded in k around inf 14.5%
*-commutative14.5%
*-commutative14.5%
*-commutative14.5%
associate-*r*14.5%
Simplified14.5%
(FPCore (a k m) :precision binary64 (if (<= m 3.6) (/ a (+ 1.0 (* k 10.0))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.6) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (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.6d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 3.6) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 3.6: tmp = a / (1.0 + (k * 10.0)) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 3.6) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 3.6) tmp = a / (1.0 + (k * 10.0)); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 3.6], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3.6:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 3.60000000000000009Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 65.3%
Taylor expanded in k around 0 38.3%
*-commutative38.3%
Simplified38.3%
if 3.60000000000000009 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 6.7%
Taylor expanded in k around inf 14.5%
*-commutative14.5%
*-commutative14.5%
*-commutative14.5%
associate-*r*14.5%
Simplified14.5%
(FPCore (a k m) :precision binary64 (if (<= m 470.0) a (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 470.0) {
tmp = a;
} else {
tmp = a * (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 <= 470.0d0) then
tmp = a
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 470.0) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 470.0: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 470.0) tmp = a; else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 470.0) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 470.0], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 470:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 470Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 65.3%
Taylor expanded in k around 0 24.4%
Taylor expanded in k around 0 25.6%
if 470 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 6.7%
Taylor expanded in k around inf 14.5%
*-commutative14.5%
*-commutative14.5%
*-commutative14.5%
associate-*r*14.5%
Simplified14.5%
(FPCore (a k m) :precision binary64 (if (<= m 4.2) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.2) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 4.2d0) then
tmp = a
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 4.2) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4.2: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4.2) tmp = a; else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 4.2) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4.2], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.2:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 4.20000000000000018Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 65.3%
Taylor expanded in k around 0 24.4%
Taylor expanded in k around 0 25.6%
if 4.20000000000000018 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 6.7%
Taylor expanded in k around inf 14.5%
Final simplification21.6%
(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 88.7%
associate-/l*88.7%
remove-double-neg88.7%
distribute-frac-neg288.7%
distribute-neg-frac288.7%
remove-double-neg88.7%
sqr-neg88.7%
associate-+l+88.7%
sqr-neg88.7%
distribute-rgt-out89.0%
Simplified89.0%
Taylor expanded in m around 0 42.6%
Taylor expanded in k around 0 18.0%
Taylor expanded in k around 0 17.6%
herbie shell --seed 2024103
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))