
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m))) (t_1 (/ 1.0 t_0))) (if (<= k 4.5e-57) 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 = a * pow(k, m);
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 4.5e-57) {
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 = a * (k ** m)
t_1 = 1.0d0 / t_0
if (k <= 4.5d-57) 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 = a * Math.pow(k, m);
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 4.5e-57) {
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 = a * math.pow(k, m) t_1 = 1.0 / t_0 tmp = 0 if k <= 4.5e-57: 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(a * (k ^ m)) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (k <= 4.5e-57) 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 = a * (k ^ m); t_1 = 1.0 / t_0; tmp = 0.0; if (k <= 4.5e-57) 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[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[k, 4.5e-57], 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 := a \cdot {k}^{m}\\
t_1 := \frac{1}{t\_0}\\
\mathbf{if}\;k \leq 4.5 \cdot 10^{-57}:\\
\;\;\;\;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 < 4.49999999999999973e-57Initial 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 k around 0 100.0%
if 4.49999999999999973e-57 < k Initial program 83.5%
associate-/l*83.5%
remove-double-neg83.5%
distribute-frac-neg283.5%
distribute-neg-frac283.5%
remove-double-neg83.5%
sqr-neg83.5%
associate-+l+83.4%
sqr-neg83.4%
distribute-rgt-out83.4%
Simplified83.4%
distribute-lft-in83.4%
associate-+l+83.5%
associate-*r/83.5%
clear-num82.9%
associate-+l+82.8%
distribute-lft-in82.8%
+-commutative82.8%
fma-define82.9%
+-commutative82.9%
*-commutative82.9%
Applied egg-rr82.9%
Taylor expanded in k around 0 98.7%
Final simplification99.5%
(FPCore (a k m) :precision binary64 (if (<= m 2.8e-19) (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))) (/ 1.0 (/ (pow k (- m)) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.8e-19) {
tmp = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = 1.0 / (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 <= 2.8d-19) then
tmp = (a * (k ** m)) / ((1.0d0 + (k * 10.0d0)) + (k * k))
else
tmp = 1.0d0 / ((k ** -m) / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.8e-19) {
tmp = (a * Math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = 1.0 / (Math.pow(k, -m) / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.8e-19: tmp = (a * math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k)) else: tmp = 1.0 / (math.pow(k, -m) / a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.8e-19) tmp = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))); else tmp = Float64(1.0 / Float64((k ^ Float64(-m)) / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.8e-19) tmp = (a * (k ^ m)) / ((1.0 + (k * 10.0)) + (k * k)); else tmp = 1.0 / ((k ^ -m) / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.8e-19], N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[k, (-m)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{{k}^{\left(-m\right)}}{a}}\\
\end{array}
\end{array}
if m < 2.80000000000000003e-19Initial program 96.9%
if 2.80000000000000003e-19 < m Initial program 76.1%
associate-/l*76.1%
remove-double-neg76.1%
distribute-frac-neg276.1%
distribute-neg-frac276.1%
remove-double-neg76.1%
sqr-neg76.1%
associate-+l+76.1%
sqr-neg76.1%
distribute-rgt-out76.1%
Simplified76.1%
distribute-lft-in76.1%
associate-+l+76.1%
associate-*r/76.1%
clear-num76.1%
associate-+l+76.1%
distribute-lft-in76.1%
+-commutative76.1%
fma-define76.1%
+-commutative76.1%
*-commutative76.1%
Applied egg-rr76.1%
Taylor expanded in k around 0 100.0%
associate-/r*100.0%
Simplified100.0%
*-un-lft-identity100.0%
associate-/l/100.0%
associate-/r*100.0%
pow-flip100.0%
Applied egg-rr100.0%
*-lft-identity100.0%
Simplified100.0%
Final simplification98.0%
(FPCore (a k m)
:precision binary64
(if (<= m -0.25)
(* a (pow k m))
(if (<= m 2.8e-19)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))
(/ 1.0 (/ (pow k (- m)) a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.25) {
tmp = a * pow(k, m);
} else if (m <= 2.8e-19) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = 1.0 / (pow(k, -m) / a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.25d0)) then
tmp = a * (k ** m)
else if (m <= 2.8d-19) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
else
tmp = 1.0d0 / ((k ** -m) / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.25) {
tmp = a * Math.pow(k, m);
} else if (m <= 2.8e-19) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = 1.0 / (Math.pow(k, -m) / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.25: tmp = a * math.pow(k, m) elif m <= 2.8e-19: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) else: tmp = 1.0 / (math.pow(k, -m) / a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.25) tmp = Float64(a * (k ^ m)); elseif (m <= 2.8e-19) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); else tmp = Float64(1.0 / Float64((k ^ Float64(-m)) / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.25) tmp = a * (k ^ m); elseif (m <= 2.8e-19) tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); else tmp = 1.0 / ((k ^ -m) / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.25], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.8e-19], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[k, (-m)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.25:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{elif}\;m \leq 2.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{{k}^{\left(-m\right)}}{a}}\\
\end{array}
\end{array}
if m < -0.25Initial 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 100.0%
if -0.25 < m < 2.80000000000000003e-19Initial program 93.9%
associate-/l*93.9%
remove-double-neg93.9%
distribute-frac-neg293.9%
distribute-neg-frac293.9%
remove-double-neg93.9%
sqr-neg93.9%
associate-+l+93.9%
sqr-neg93.9%
distribute-rgt-out93.9%
Simplified93.9%
distribute-lft-in93.9%
associate-+l+93.9%
associate-*r/93.9%
clear-num92.9%
associate-+l+92.9%
distribute-lft-in92.9%
+-commutative92.9%
fma-define93.0%
+-commutative93.0%
*-commutative93.0%
Applied egg-rr93.0%
Taylor expanded in m around 0 92.7%
Taylor expanded in k around 0 97.7%
if 2.80000000000000003e-19 < m Initial program 76.1%
associate-/l*76.1%
remove-double-neg76.1%
distribute-frac-neg276.1%
distribute-neg-frac276.1%
remove-double-neg76.1%
sqr-neg76.1%
associate-+l+76.1%
sqr-neg76.1%
distribute-rgt-out76.1%
Simplified76.1%
distribute-lft-in76.1%
associate-+l+76.1%
associate-*r/76.1%
clear-num76.1%
associate-+l+76.1%
distribute-lft-in76.1%
+-commutative76.1%
fma-define76.1%
+-commutative76.1%
*-commutative76.1%
Applied egg-rr76.1%
Taylor expanded in k around 0 100.0%
associate-/r*100.0%
Simplified100.0%
*-un-lft-identity100.0%
associate-/l/100.0%
associate-/r*100.0%
pow-flip100.0%
Applied egg-rr100.0%
*-lft-identity100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (a k m) :precision binary64 (if (<= m 2.8e-19) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (/ 1.0 (/ (pow k (- m)) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.8e-19) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = 1.0 / (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 <= 2.8d-19) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = 1.0d0 / ((k ** -m) / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.8e-19) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = 1.0 / (Math.pow(k, -m) / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.8e-19: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = 1.0 / (math.pow(k, -m) / a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.8e-19) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(1.0 / Float64((k ^ Float64(-m)) / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.8e-19) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = 1.0 / ((k ^ -m) / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.8e-19], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[k, (-m)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.8 \cdot 10^{-19}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{{k}^{\left(-m\right)}}{a}}\\
\end{array}
\end{array}
if m < 2.80000000000000003e-19Initial program 96.9%
associate-/l*96.9%
remove-double-neg96.9%
distribute-frac-neg296.9%
distribute-neg-frac296.9%
remove-double-neg96.9%
sqr-neg96.9%
associate-+l+96.9%
sqr-neg96.9%
distribute-rgt-out96.9%
Simplified96.9%
if 2.80000000000000003e-19 < m Initial program 76.1%
associate-/l*76.1%
remove-double-neg76.1%
distribute-frac-neg276.1%
distribute-neg-frac276.1%
remove-double-neg76.1%
sqr-neg76.1%
associate-+l+76.1%
sqr-neg76.1%
distribute-rgt-out76.1%
Simplified76.1%
distribute-lft-in76.1%
associate-+l+76.1%
associate-*r/76.1%
clear-num76.1%
associate-+l+76.1%
distribute-lft-in76.1%
+-commutative76.1%
fma-define76.1%
+-commutative76.1%
*-commutative76.1%
Applied egg-rr76.1%
Taylor expanded in k around 0 100.0%
associate-/r*100.0%
Simplified100.0%
*-un-lft-identity100.0%
associate-/l/100.0%
associate-/r*100.0%
pow-flip100.0%
Applied egg-rr100.0%
*-lft-identity100.0%
Simplified100.0%
Final simplification98.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.4) (not (<= m 2.8e-19))) (* a (pow k m)) (/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.4) || !(m <= 2.8e-19)) {
tmp = a * pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (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.4d0)) .or. (.not. (m <= 2.8d-19))) then
tmp = a * (k ** m)
else
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -0.4) || !(m <= 2.8e-19)) {
tmp = a * Math.pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -0.4) or not (m <= 2.8e-19): tmp = a * math.pow(k, m) else: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -0.4) || !(m <= 2.8e-19)) tmp = Float64(a * (k ^ m)); else tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -0.4) || ~((m <= 2.8e-19))) tmp = a * (k ^ m); else tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -0.4], N[Not[LessEqual[m, 2.8e-19]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.4 \lor \neg \left(m \leq 2.8 \cdot 10^{-19}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\end{array}
\end{array}
if m < -0.40000000000000002 or 2.80000000000000003e-19 < m Initial program 87.7%
associate-/l*87.7%
remove-double-neg87.7%
distribute-frac-neg287.7%
distribute-neg-frac287.7%
remove-double-neg87.7%
sqr-neg87.7%
associate-+l+87.7%
sqr-neg87.7%
distribute-rgt-out87.7%
Simplified87.7%
Taylor expanded in k around 0 100.0%
if -0.40000000000000002 < m < 2.80000000000000003e-19Initial program 93.9%
associate-/l*93.9%
remove-double-neg93.9%
distribute-frac-neg293.9%
distribute-neg-frac293.9%
remove-double-neg93.9%
sqr-neg93.9%
associate-+l+93.9%
sqr-neg93.9%
distribute-rgt-out93.9%
Simplified93.9%
distribute-lft-in93.9%
associate-+l+93.9%
associate-*r/93.9%
clear-num92.9%
associate-+l+92.9%
distribute-lft-in92.9%
+-commutative92.9%
fma-define93.0%
+-commutative93.0%
*-commutative93.0%
Applied egg-rr93.0%
Taylor expanded in m around 0 92.7%
Taylor expanded in k around 0 97.7%
Final simplification99.2%
(FPCore (a k m)
:precision binary64
(if (<= m -5e+140)
(/ 1.0 (/ (+ 1.0 (* k (+ k 10.0))) a))
(if (<= m 1.38e-18)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))
(* a (+ 1.0 (* k (- (* k 100.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5e+140) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else if (m <= 1.38e-18) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (k * ((k * 100.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 <= (-5d+140)) then
tmp = 1.0d0 / ((1.0d0 + (k * (k + 10.0d0))) / a)
else if (m <= 1.38d-18) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
else
tmp = a * (1.0d0 + (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5e+140) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else if (m <= 1.38e-18) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5e+140: tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a) elif m <= 1.38e-18: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5e+140) tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / a)); elseif (m <= 1.38e-18) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5e+140) tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a); elseif (m <= 1.38e-18) tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5e+140], N[(1.0 / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.38e-18], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5 \cdot 10^{+140}:\\
\;\;\;\;\frac{1}{\frac{1 + k \cdot \left(k + 10\right)}{a}}\\
\mathbf{elif}\;m \leq 1.38 \cdot 10^{-18}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < -5.00000000000000008e140Initial 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%
distribute-lft-in100.0%
associate-+l+100.0%
associate-*r/100.0%
clear-num100.0%
associate-+l+100.0%
distribute-lft-in100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in m around 0 58.1%
if -5.00000000000000008e140 < m < 1.38e-18Initial program 95.8%
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%
distribute-lft-in95.8%
associate-+l+95.8%
associate-*r/95.8%
clear-num95.1%
associate-+l+95.1%
distribute-lft-in95.1%
+-commutative95.1%
fma-define95.1%
+-commutative95.1%
*-commutative95.1%
Applied egg-rr95.1%
Taylor expanded in m around 0 72.9%
Taylor expanded in k around 0 76.4%
if 1.38e-18 < m Initial program 75.8%
associate-/l*75.8%
remove-double-neg75.8%
distribute-frac-neg275.8%
distribute-neg-frac275.8%
remove-double-neg75.8%
sqr-neg75.8%
associate-+l+75.8%
sqr-neg75.8%
distribute-rgt-out75.8%
Simplified75.8%
Taylor expanded in k around 0 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in m around 0 3.9%
Taylor expanded in k around 0 33.7%
Final simplification58.6%
(FPCore (a k m) :precision binary64 (if (<= m 1.38e-18) (/ 1.0 (/ (+ 1.0 (* k (+ k 10.0))) a)) (* a (+ 1.0 (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.38e-18) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * (1.0 + (k * ((k * 100.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.38d-18) then
tmp = 1.0d0 / ((1.0d0 + (k * (k + 10.0d0))) / a)
else
tmp = a * (1.0d0 + (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.38e-18) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.38e-18: tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.38e-18) tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / a)); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.38e-18) tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.38e-18], N[(1.0 / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.38 \cdot 10^{-18}:\\
\;\;\;\;\frac{1}{\frac{1 + k \cdot \left(k + 10\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.38e-18Initial program 96.9%
associate-/l*96.9%
remove-double-neg96.9%
distribute-frac-neg296.9%
distribute-neg-frac296.9%
remove-double-neg96.9%
sqr-neg96.9%
associate-+l+96.9%
sqr-neg96.9%
distribute-rgt-out96.9%
Simplified96.9%
distribute-lft-in96.9%
associate-+l+96.9%
associate-*r/96.9%
clear-num96.5%
associate-+l+96.4%
distribute-lft-in96.4%
+-commutative96.4%
fma-define96.5%
+-commutative96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in m around 0 68.9%
if 1.38e-18 < m Initial program 75.8%
associate-/l*75.8%
remove-double-neg75.8%
distribute-frac-neg275.8%
distribute-neg-frac275.8%
remove-double-neg75.8%
sqr-neg75.8%
associate-+l+75.8%
sqr-neg75.8%
distribute-rgt-out75.8%
Simplified75.8%
Taylor expanded in k around 0 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in m around 0 3.9%
Taylor expanded in k around 0 33.7%
Final simplification57.0%
(FPCore (a k m) :precision binary64 (if (<= m 1.38e-18) (/ 1.0 (/ (+ 1.0 (* k k)) a)) (* a (+ 1.0 (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.38e-18) {
tmp = 1.0 / ((1.0 + (k * k)) / a);
} else {
tmp = a * (1.0 + (k * ((k * 100.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.38d-18) then
tmp = 1.0d0 / ((1.0d0 + (k * k)) / a)
else
tmp = a * (1.0d0 + (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.38e-18) {
tmp = 1.0 / ((1.0 + (k * k)) / a);
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.38e-18: tmp = 1.0 / ((1.0 + (k * k)) / a) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.38e-18) tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(k * k)) / a)); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.38e-18) tmp = 1.0 / ((1.0 + (k * k)) / a); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.38e-18], N[(1.0 / N[(N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.38 \cdot 10^{-18}:\\
\;\;\;\;\frac{1}{\frac{1 + k \cdot k}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.38e-18Initial program 96.9%
associate-/l*96.9%
remove-double-neg96.9%
distribute-frac-neg296.9%
distribute-neg-frac296.9%
remove-double-neg96.9%
sqr-neg96.9%
associate-+l+96.9%
sqr-neg96.9%
distribute-rgt-out96.9%
Simplified96.9%
distribute-lft-in96.9%
associate-+l+96.9%
associate-*r/96.9%
clear-num96.5%
associate-+l+96.4%
distribute-lft-in96.4%
+-commutative96.4%
fma-define96.5%
+-commutative96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in m around 0 68.9%
Taylor expanded in k around inf 68.0%
if 1.38e-18 < m Initial program 75.8%
associate-/l*75.8%
remove-double-neg75.8%
distribute-frac-neg275.8%
distribute-neg-frac275.8%
remove-double-neg75.8%
sqr-neg75.8%
associate-+l+75.8%
sqr-neg75.8%
distribute-rgt-out75.8%
Simplified75.8%
Taylor expanded in k around 0 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in m around 0 3.9%
Taylor expanded in k around 0 33.7%
Final simplification56.3%
(FPCore (a k m) :precision binary64 (if (or (<= k -1.75e+132) (not (<= k 0.1))) (/ 0.1 (/ k a)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= -1.75e+132) || !(k <= 0.1)) {
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 ((k <= (-1.75d+132)) .or. (.not. (k <= 0.1d0))) 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 ((k <= -1.75e+132) || !(k <= 0.1)) {
tmp = 0.1 / (k / a);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= -1.75e+132) or not (k <= 0.1): tmp = 0.1 / (k / a) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= -1.75e+132) || !(k <= 0.1)) 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 ((k <= -1.75e+132) || ~((k <= 0.1))) tmp = 0.1 / (k / a); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, -1.75e+132], N[Not[LessEqual[k, 0.1]], $MachinePrecision]], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -1.75 \cdot 10^{+132} \lor \neg \left(k \leq 0.1\right):\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -1.7500000000000001e132 or 0.10000000000000001 < k Initial program 76.5%
associate-/l*76.4%
remove-double-neg76.4%
distribute-frac-neg276.4%
distribute-neg-frac276.4%
remove-double-neg76.4%
sqr-neg76.4%
associate-+l+76.4%
sqr-neg76.4%
distribute-rgt-out76.4%
Simplified76.4%
Taylor expanded in k around 0 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in m around 0 18.3%
Taylor expanded in k around inf 18.3%
clear-num18.9%
un-div-inv18.9%
Applied egg-rr18.9%
if -1.7500000000000001e132 < k < 0.10000000000000001Initial 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 36.3%
Taylor expanded in k around 0 34.6%
Final simplification27.8%
(FPCore (a k m) :precision binary64 (if (or (<= k -5.6e+130) (not (<= k 0.1))) (* 0.1 (/ a k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= -5.6e+130) || !(k <= 0.1)) {
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 ((k <= (-5.6d+130)) .or. (.not. (k <= 0.1d0))) 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 ((k <= -5.6e+130) || !(k <= 0.1)) {
tmp = 0.1 * (a / k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= -5.6e+130) or not (k <= 0.1): tmp = 0.1 * (a / k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= -5.6e+130) || !(k <= 0.1)) 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 ((k <= -5.6e+130) || ~((k <= 0.1))) tmp = 0.1 * (a / k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, -5.6e+130], N[Not[LessEqual[k, 0.1]], $MachinePrecision]], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -5.6 \cdot 10^{+130} \lor \neg \left(k \leq 0.1\right):\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -5.5999999999999997e130 or 0.10000000000000001 < k Initial program 76.5%
associate-/l*76.4%
remove-double-neg76.4%
distribute-frac-neg276.4%
distribute-neg-frac276.4%
remove-double-neg76.4%
sqr-neg76.4%
associate-+l+76.4%
sqr-neg76.4%
distribute-rgt-out76.4%
Simplified76.4%
Taylor expanded in k around 0 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in m around 0 18.3%
Taylor expanded in k around inf 18.3%
if -5.5999999999999997e130 < k < 0.10000000000000001Initial 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 36.3%
Taylor expanded in k around 0 34.6%
Final simplification27.5%
(FPCore (a k m) :precision binary64 (if (<= k -4.7e+130) (* 0.1 (/ a k)) (if (<= k 0.1) a (* a (/ 0.1 k)))))
double code(double a, double k, double m) {
double tmp;
if (k <= -4.7e+130) {
tmp = 0.1 * (a / k);
} else if (k <= 0.1) {
tmp = a;
} else {
tmp = a * (0.1 / 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 (k <= (-4.7d+130)) then
tmp = 0.1d0 * (a / k)
else if (k <= 0.1d0) then
tmp = a
else
tmp = a * (0.1d0 / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -4.7e+130) {
tmp = 0.1 * (a / k);
} else if (k <= 0.1) {
tmp = a;
} else {
tmp = a * (0.1 / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -4.7e+130: tmp = 0.1 * (a / k) elif k <= 0.1: tmp = a else: tmp = a * (0.1 / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -4.7e+130) tmp = Float64(0.1 * Float64(a / k)); elseif (k <= 0.1) tmp = a; else tmp = Float64(a * Float64(0.1 / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -4.7e+130) tmp = 0.1 * (a / k); elseif (k <= 0.1) tmp = a; else tmp = a * (0.1 / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -4.7e+130], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.1], a, N[(a * N[(0.1 / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -4.7 \cdot 10^{+130}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{0.1}{k}\\
\end{array}
\end{array}
if k < -4.70000000000000045e130Initial program 62.5%
associate-/l*62.5%
remove-double-neg62.5%
distribute-frac-neg262.5%
distribute-neg-frac262.5%
remove-double-neg62.5%
sqr-neg62.5%
associate-+l+62.5%
sqr-neg62.5%
distribute-rgt-out62.5%
Simplified62.5%
Taylor expanded in k around 0 62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in m around 0 23.0%
Taylor expanded in k around inf 23.0%
if -4.70000000000000045e130 < k < 0.10000000000000001Initial 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 36.3%
Taylor expanded in k around 0 34.6%
if 0.10000000000000001 < k Initial program 80.3%
associate-/l*80.2%
remove-double-neg80.2%
distribute-frac-neg280.2%
distribute-neg-frac280.2%
remove-double-neg80.2%
sqr-neg80.2%
associate-+l+80.2%
sqr-neg80.2%
distribute-rgt-out80.2%
Simplified80.2%
Taylor expanded in k around 0 69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in m around 0 17.0%
Taylor expanded in k around inf 17.0%
associate-*r/17.0%
*-commutative17.0%
associate-/l*17.0%
Simplified17.0%
(FPCore (a k m) :precision binary64 (if (<= k 0.14) (+ a (* -10.0 (* k a))) (/ 0.1 (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.14) {
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.14d0) 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.14) {
tmp = a + (-10.0 * (k * a));
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.14: 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.14) 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.14) 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.14], 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.14:\\
\;\;\;\;a + -10 \cdot \left(k \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 0.14000000000000001Initial program 94.7%
associate-/l*94.7%
remove-double-neg94.7%
distribute-frac-neg294.7%
distribute-neg-frac294.7%
remove-double-neg94.7%
sqr-neg94.7%
associate-+l+94.7%
sqr-neg94.7%
distribute-rgt-out94.7%
Simplified94.7%
Taylor expanded in m around 0 39.9%
Taylor expanded in k around 0 32.0%
if 0.14000000000000001 < k Initial program 80.1%
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 k around 0 68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in m around 0 17.2%
Taylor expanded in k around inf 17.2%
clear-num17.9%
un-div-inv17.9%
Applied egg-rr17.9%
Final simplification27.2%
(FPCore (a k m) :precision binary64 (if (<= k 0.14) (* a (+ 1.0 (* k -10.0))) (/ 0.1 (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.14) {
tmp = a * (1.0 + (k * -10.0));
} 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.14d0) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
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.14) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.14: tmp = a * (1.0 + (k * -10.0)) else: tmp = 0.1 / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.14) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); 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.14) tmp = a * (1.0 + (k * -10.0)); else tmp = 0.1 / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.14], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.14:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 0.14000000000000001Initial program 94.7%
associate-/l*94.7%
remove-double-neg94.7%
distribute-frac-neg294.7%
distribute-neg-frac294.7%
remove-double-neg94.7%
sqr-neg94.7%
associate-+l+94.7%
sqr-neg94.7%
distribute-rgt-out94.7%
Simplified94.7%
Taylor expanded in k around 0 89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in m around 0 32.9%
Taylor expanded in k around 0 32.0%
*-commutative32.0%
Simplified32.0%
if 0.14000000000000001 < k Initial program 80.1%
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 k around 0 68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in m around 0 17.2%
Taylor expanded in k around inf 17.2%
clear-num17.9%
un-div-inv17.9%
Applied egg-rr17.9%
(FPCore (a k m) :precision binary64 (/ 1.0 (/ (+ 1.0 (* k k)) a)))
double code(double a, double k, double m) {
return 1.0 / ((1.0 + (k * k)) / a);
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = 1.0d0 / ((1.0d0 + (k * k)) / a)
end function
public static double code(double a, double k, double m) {
return 1.0 / ((1.0 + (k * k)) / a);
}
def code(a, k, m): return 1.0 / ((1.0 + (k * k)) / a)
function code(a, k, m) return Float64(1.0 / Float64(Float64(1.0 + Float64(k * k)) / a)) end
function tmp = code(a, k, m) tmp = 1.0 / ((1.0 + (k * k)) / a); end
code[a_, k_, m_] := N[(1.0 / N[(N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{1 + k \cdot k}{a}}
\end{array}
Initial program 89.8%
associate-/l*89.8%
remove-double-neg89.8%
distribute-frac-neg289.8%
distribute-neg-frac289.8%
remove-double-neg89.8%
sqr-neg89.8%
associate-+l+89.8%
sqr-neg89.8%
distribute-rgt-out89.8%
Simplified89.8%
distribute-lft-in89.8%
associate-+l+89.8%
associate-*r/89.8%
clear-num89.5%
associate-+l+89.4%
distribute-lft-in89.4%
+-commutative89.4%
fma-define89.5%
+-commutative89.5%
*-commutative89.5%
Applied egg-rr89.5%
Taylor expanded in m around 0 46.9%
Taylor expanded in k around inf 46.2%
(FPCore (a k m) :precision binary64 (/ a (+ 1.0 (* k k))))
double code(double a, double k, double m) {
return a / (1.0 + (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 / (1.0d0 + (k * k))
end function
public static double code(double a, double k, double m) {
return a / (1.0 + (k * k));
}
def code(a, k, m): return a / (1.0 + (k * k))
function code(a, k, m) return Float64(a / Float64(1.0 + Float64(k * k))) end
function tmp = code(a, k, m) tmp = a / (1.0 + (k * k)); end
code[a_, k_, m_] := N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a}{1 + k \cdot k}
\end{array}
Initial program 89.8%
associate-/l*89.8%
remove-double-neg89.8%
distribute-frac-neg289.8%
distribute-neg-frac289.8%
remove-double-neg89.8%
sqr-neg89.8%
associate-+l+89.8%
sqr-neg89.8%
distribute-rgt-out89.8%
Simplified89.8%
Taylor expanded in m around 0 46.1%
Taylor expanded in k around inf 45.5%
(FPCore (a k m) :precision binary64 (/ a (+ 1.0 (* k 10.0))))
double code(double a, double k, double m) {
return a / (1.0 + (k * 10.0));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a / (1.0d0 + (k * 10.0d0))
end function
public static double code(double a, double k, double m) {
return a / (1.0 + (k * 10.0));
}
def code(a, k, m): return a / (1.0 + (k * 10.0))
function code(a, k, m) return Float64(a / Float64(1.0 + Float64(k * 10.0))) end
function tmp = code(a, k, m) tmp = a / (1.0 + (k * 10.0)); end
code[a_, k_, m_] := N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a}{1 + k \cdot 10}
\end{array}
Initial program 89.8%
associate-/l*89.8%
remove-double-neg89.8%
distribute-frac-neg289.8%
distribute-neg-frac289.8%
remove-double-neg89.8%
sqr-neg89.8%
associate-+l+89.8%
sqr-neg89.8%
distribute-rgt-out89.8%
Simplified89.8%
Taylor expanded in m around 0 46.1%
Taylor expanded in k around 0 27.6%
*-commutative82.2%
Simplified27.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 89.8%
associate-/l*89.8%
remove-double-neg89.8%
distribute-frac-neg289.8%
distribute-neg-frac289.8%
remove-double-neg89.8%
sqr-neg89.8%
associate-+l+89.8%
sqr-neg89.8%
distribute-rgt-out89.8%
Simplified89.8%
Taylor expanded in m around 0 46.1%
Taylor expanded in k around 0 21.2%
herbie shell --seed 2024145
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))