
(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 (* a (pow k m))) (t_1 (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))))) (if (<= t_1 5e+234) t_1 t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 5e+234) {
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 = a * (k ** m)
t_1 = t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))
if (t_1 <= 5d+234) 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 = a * Math.pow(k, m);
double t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_1 <= 5e+234) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)) tmp = 0 if t_1 <= 5e+234: tmp = t_1 else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) t_1 = Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) tmp = 0.0 if (t_1 <= 5e+234) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); t_1 = t_0 / ((1.0 + (k * 10.0)) + (k * k)); tmp = 0.0; if (t_1 <= 5e+234) tmp = t_1; else tmp = 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[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+234], t$95$1, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
t_1 := \frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+234}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) < 5.0000000000000003e234Initial program 98.9%
if 5.0000000000000003e234 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 39.7%
associate-*r/39.7%
associate-+l+39.7%
+-commutative39.7%
distribute-rgt-out39.7%
fma-def39.7%
+-commutative39.7%
Simplified39.7%
Taylor expanded in k around 0 50.0%
exp-to-pow100.0%
Simplified100.0%
Final simplification99.1%
(FPCore (a k m) :precision binary64 (if (<= m 1.1e-30) (/ (pow k m) (/ (+ 1.0 (* k (+ k 10.0))) a)) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.1e-30) {
tmp = pow(k, m) / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * pow(k, m);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.1d-30) then
tmp = (k ** m) / ((1.0d0 + (k * (k + 10.0d0))) / a)
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.1e-30) {
tmp = Math.pow(k, m) / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.1e-30: tmp = math.pow(k, m) / ((1.0 + (k * (k + 10.0))) / a) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.1e-30) tmp = Float64((k ^ m) / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / a)); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.1e-30) tmp = (k ^ m) / ((1.0 + (k * (k + 10.0))) / a); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.1e-30], N[(N[Power[k, m], $MachinePrecision] / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.1 \cdot 10^{-30}:\\
\;\;\;\;\frac{{k}^{m}}{\frac{1 + k \cdot \left(k + 10\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 1.09999999999999992e-30Initial program 98.6%
associate-*r/98.6%
associate-+l+98.6%
+-commutative98.6%
distribute-rgt-out98.6%
fma-def98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in a around 0 73.2%
exp-to-pow98.6%
+-commutative98.6%
fma-udef98.6%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in a around 0 98.1%
if 1.09999999999999992e-30 < m Initial program 63.2%
associate-*r/63.2%
associate-+l+63.2%
+-commutative63.2%
distribute-rgt-out63.2%
fma-def63.2%
+-commutative63.2%
Simplified63.2%
Taylor expanded in k around 0 50.5%
exp-to-pow100.0%
Simplified100.0%
Final simplification98.8%
(FPCore (a k m) :precision binary64 (if (<= k 4.5e-7) (* a (pow k m)) (/ a (pow k (+ 1.0 (- 1.0 m))))))
double code(double a, double k, double m) {
double tmp;
if (k <= 4.5e-7) {
tmp = a * pow(k, m);
} else {
tmp = a / pow(k, (1.0 + (1.0 - m)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 4.5d-7) then
tmp = a * (k ** m)
else
tmp = a / (k ** (1.0d0 + (1.0d0 - m)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 4.5e-7) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / Math.pow(k, (1.0 + (1.0 - m)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 4.5e-7: tmp = a * math.pow(k, m) else: tmp = a / math.pow(k, (1.0 + (1.0 - m))) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 4.5e-7) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / (k ^ Float64(1.0 + Float64(1.0 - m)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 4.5e-7) tmp = a * (k ^ m); else tmp = a / (k ^ (1.0 + (1.0 - m))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 4.5e-7], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[Power[k, N[(1.0 + N[(1.0 - m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{-7}:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{{k}^{\left(1 + \left(1 - m\right)\right)}}\\
\end{array}
\end{array}
if k < 4.4999999999999998e-7Initial program 89.1%
associate-*r/89.1%
associate-+l+89.1%
+-commutative89.1%
distribute-rgt-out89.1%
fma-def89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in k around 0 46.3%
exp-to-pow99.6%
Simplified99.6%
if 4.4999999999999998e-7 < k Initial program 78.9%
associate-*r/78.8%
associate-+l+78.8%
+-commutative78.8%
distribute-rgt-out78.8%
fma-def78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in a around 0 78.9%
exp-to-pow78.9%
+-commutative78.9%
fma-udef78.9%
associate-/l*77.0%
Simplified77.0%
Taylor expanded in k around inf 75.1%
unpow275.1%
Simplified75.1%
associate-/r/77.0%
pow277.0%
pow-div95.6%
Applied egg-rr95.6%
*-commutative95.6%
pow-sub77.0%
pow277.0%
associate-*r/77.0%
frac-times91.3%
clear-num91.3%
frac-times95.7%
*-rgt-identity95.7%
pow195.7%
pow-div95.7%
Applied egg-rr95.7%
*-commutative95.7%
pow-plus95.7%
+-commutative95.7%
Simplified95.7%
Final simplification98.2%
(FPCore (a k m) :precision binary64 (if (or (<= m -1.8e-8) (not (<= m 1.1e-30))) (* a (pow k m)) (/ a (+ 1.0 (+ (* k k) (* k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -1.8e-8) || !(m <= 1.1e-30)) {
tmp = a * pow(k, m);
} else {
tmp = a / (1.0 + ((k * 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.8d-8)) .or. (.not. (m <= 1.1d-30))) then
tmp = a * (k ** m)
else
tmp = a / (1.0d0 + ((k * 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.8e-8) || !(m <= 1.1e-30)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / (1.0 + ((k * k) + (k * 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -1.8e-8) or not (m <= 1.1e-30): tmp = a * math.pow(k, m) else: tmp = a / (1.0 + ((k * k) + (k * 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -1.8e-8) || !(m <= 1.1e-30)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(1.0 + Float64(Float64(k * k) + Float64(k * 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -1.8e-8) || ~((m <= 1.1e-30))) tmp = a * (k ^ m); else tmp = a / (1.0 + ((k * k) + (k * 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -1.8e-8], N[Not[LessEqual[m, 1.1e-30]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(1.0 + N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.8 \cdot 10^{-8} \lor \neg \left(m \leq 1.1 \cdot 10^{-30}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + \left(k \cdot k + k \cdot 10\right)}\\
\end{array}
\end{array}
if m < -1.79999999999999991e-8 or 1.09999999999999992e-30 < m Initial program 80.1%
associate-*r/80.1%
associate-+l+80.1%
+-commutative80.1%
distribute-rgt-out80.1%
fma-def80.1%
+-commutative80.1%
Simplified80.1%
Taylor expanded in k around 0 50.0%
exp-to-pow100.0%
Simplified100.0%
if -1.79999999999999991e-8 < m < 1.09999999999999992e-30Initial program 97.2%
associate-*r/97.2%
associate-+l+97.2%
+-commutative97.2%
distribute-rgt-out97.2%
fma-def97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in m around 0 96.8%
distribute-lft-in96.8%
Applied egg-rr96.8%
Final simplification99.0%
(FPCore (a k m) :precision binary64 (if (<= k 4.5e-7) (* a (pow k m)) (* a (pow k (- m 2.0)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 4.5e-7) {
tmp = a * pow(k, m);
} else {
tmp = a * pow(k, (m - 2.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 (k <= 4.5d-7) then
tmp = a * (k ** m)
else
tmp = a * (k ** (m - 2.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 4.5e-7) {
tmp = a * Math.pow(k, m);
} else {
tmp = a * Math.pow(k, (m - 2.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 4.5e-7: tmp = a * math.pow(k, m) else: tmp = a * math.pow(k, (m - 2.0)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 4.5e-7) tmp = Float64(a * (k ^ m)); else tmp = Float64(a * (k ^ Float64(m - 2.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 4.5e-7) tmp = a * (k ^ m); else tmp = a * (k ^ (m - 2.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 4.5e-7], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m - 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{-7}:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\
\end{array}
\end{array}
if k < 4.4999999999999998e-7Initial program 89.1%
associate-*r/89.1%
associate-+l+89.1%
+-commutative89.1%
distribute-rgt-out89.1%
fma-def89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in k around 0 46.3%
exp-to-pow99.6%
Simplified99.6%
if 4.4999999999999998e-7 < k Initial program 78.9%
associate-*r/78.8%
associate-+l+78.8%
+-commutative78.8%
distribute-rgt-out78.8%
fma-def78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in a around 0 78.9%
exp-to-pow78.9%
+-commutative78.9%
fma-udef78.9%
associate-/l*77.0%
Simplified77.0%
Taylor expanded in k around inf 75.1%
unpow275.1%
Simplified75.1%
associate-/r/77.0%
pow277.0%
pow-div95.6%
Applied egg-rr95.6%
Final simplification98.2%
(FPCore (a k m)
:precision binary64
(if (<= m -0.043)
(* a (/ 1.0 (* k k)))
(if (<= m 6e+15)
(/ a (+ 1.0 (+ (* k k) (* k 10.0))))
(* a (+ 1.0 (* k -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.043) {
tmp = a * (1.0 / (k * k));
} else if (m <= 6e+15) {
tmp = a / (1.0 + ((k * k) + (k * 10.0)));
} else {
tmp = a * (1.0 + (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 <= (-0.043d0)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 6d+15) then
tmp = a / (1.0d0 + ((k * k) + (k * 10.0d0)))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.043) {
tmp = a * (1.0 / (k * k));
} else if (m <= 6e+15) {
tmp = a / (1.0 + ((k * k) + (k * 10.0)));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.043: tmp = a * (1.0 / (k * k)) elif m <= 6e+15: tmp = a / (1.0 + ((k * k) + (k * 10.0))) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.043) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 6e+15) tmp = Float64(a / Float64(1.0 + Float64(Float64(k * k) + Float64(k * 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.043) tmp = a * (1.0 / (k * k)); elseif (m <= 6e+15) tmp = a / (1.0 + ((k * k) + (k * 10.0))); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.043], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 6e+15], N[(a / N[(1.0 + N[(N[(k * k), $MachinePrecision] + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.043:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 6 \cdot 10^{+15}:\\
\;\;\;\;\frac{a}{1 + \left(k \cdot k + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -0.042999999999999997Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 43.6%
Taylor expanded in k around inf 67.7%
unpow267.7%
Simplified67.7%
if -0.042999999999999997 < m < 6e15Initial program 97.4%
associate-*r/97.4%
associate-+l+97.4%
+-commutative97.4%
distribute-rgt-out97.4%
fma-def97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in m around 0 94.9%
distribute-lft-in94.9%
Applied egg-rr94.9%
if 6e15 < m Initial program 61.5%
associate-*r/61.5%
associate-+l+61.5%
+-commutative61.5%
distribute-rgt-out61.5%
fma-def61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 12.6%
*-commutative12.6%
Simplified12.6%
Final simplification57.1%
(FPCore (a k m)
:precision binary64
(if (<= m -0.165)
(* a (/ 1.0 (* k k)))
(if (<= m 1.45e+16)
(/ a (+ 1.0 (* k (+ k 10.0))))
(* a (+ 1.0 (* k -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.165) {
tmp = a * (1.0 / (k * k));
} else if (m <= 1.45e+16) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (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 <= (-0.165d0)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 1.45d+16) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.165) {
tmp = a * (1.0 / (k * k));
} else if (m <= 1.45e+16) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.165: tmp = a * (1.0 / (k * k)) elif m <= 1.45e+16: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.165) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 1.45e+16) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.165) tmp = a * (1.0 / (k * k)); elseif (m <= 1.45e+16) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.165], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.45e+16], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.165:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.45 \cdot 10^{+16}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -0.165000000000000008Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 43.6%
Taylor expanded in k around inf 67.7%
unpow267.7%
Simplified67.7%
if -0.165000000000000008 < m < 1.45e16Initial program 97.4%
associate-*r/97.4%
associate-+l+97.4%
+-commutative97.4%
distribute-rgt-out97.4%
fma-def97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in m around 0 94.9%
if 1.45e16 < m Initial program 61.5%
associate-*r/61.5%
associate-+l+61.5%
+-commutative61.5%
distribute-rgt-out61.5%
fma-def61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 12.6%
*-commutative12.6%
Simplified12.6%
Final simplification57.1%
(FPCore (a k m) :precision binary64 (if (<= k 3.2e-306) (/ a (* k k)) (if (<= k 0.1) (* a (+ 1.0 (* k -10.0))) (/ (/ a k) k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 3.2e-306) {
tmp = a / (k * k);
} else if (k <= 0.1) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = (a / k) / 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 <= 3.2d-306) then
tmp = a / (k * k)
else if (k <= 0.1d0) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = (a / k) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 3.2e-306) {
tmp = a / (k * k);
} else if (k <= 0.1) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 3.2e-306: tmp = a / (k * k) elif k <= 0.1: tmp = a * (1.0 + (k * -10.0)) else: tmp = (a / k) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= 3.2e-306) tmp = Float64(a / Float64(k * k)); elseif (k <= 0.1) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(Float64(a / k) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 3.2e-306) tmp = a / (k * k); elseif (k <= 0.1) tmp = a * (1.0 + (k * -10.0)); else tmp = (a / k) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 3.2e-306], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.1], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.2 \cdot 10^{-306}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < 3.19999999999999971e-306Initial program 80.0%
associate-*r/80.0%
associate-+l+80.0%
+-commutative80.0%
distribute-rgt-out80.0%
fma-def80.0%
+-commutative80.0%
Simplified80.0%
Taylor expanded in m around 0 29.0%
Taylor expanded in k around inf 33.9%
unpow233.9%
Simplified33.9%
if 3.19999999999999971e-306 < k < 0.10000000000000001Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 53.5%
Taylor expanded in k around 0 53.5%
*-commutative53.5%
Simplified53.5%
if 0.10000000000000001 < k Initial program 78.7%
associate-*r/78.6%
associate-+l+78.6%
+-commutative78.6%
distribute-rgt-out78.6%
fma-def78.6%
+-commutative78.6%
Simplified78.6%
Taylor expanded in m around 0 57.1%
Taylor expanded in k around inf 55.4%
unpow255.4%
Simplified55.4%
associate-/r*55.7%
div-inv55.6%
Applied egg-rr55.6%
un-div-inv55.7%
Applied egg-rr55.7%
Final simplification47.4%
(FPCore (a k m) :precision binary64 (if (<= m -1.35e-109) (* a (/ 1.0 (* k k))) (if (<= m 6e+15) (/ a (+ 1.0 (* k 10.0))) (* a (+ 1.0 (* k -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.35e-109) {
tmp = a * (1.0 / (k * k));
} else if (m <= 6e+15) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (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.35d-109)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 6d+15) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.35e-109) {
tmp = a * (1.0 / (k * k));
} else if (m <= 6e+15) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.35e-109: tmp = a * (1.0 / (k * k)) elif m <= 6e+15: tmp = a / (1.0 + (k * 10.0)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.35e-109) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 6e+15) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.35e-109) tmp = a * (1.0 / (k * k)); elseif (m <= 6e+15) tmp = a / (1.0 + (k * 10.0)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.35e-109], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 6e+15], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.35 \cdot 10^{-109}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 6 \cdot 10^{+15}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -1.35e-109Initial program 100.0%
associate-*r/99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in m around 0 49.7%
Taylor expanded in k around inf 66.8%
unpow266.8%
Simplified66.8%
if -1.35e-109 < m < 6e15Initial program 97.0%
associate-*r/97.0%
associate-+l+97.0%
+-commutative97.0%
distribute-rgt-out97.0%
fma-def97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in m around 0 95.7%
Taylor expanded in k around 0 70.5%
*-commutative70.5%
Simplified70.5%
if 6e15 < m Initial program 61.5%
associate-*r/61.5%
associate-+l+61.5%
+-commutative61.5%
distribute-rgt-out61.5%
fma-def61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 12.6%
*-commutative12.6%
Simplified12.6%
Final simplification48.6%
(FPCore (a k m) :precision binary64 (if (<= m -0.62) (* a (/ 1.0 (* k k))) (if (<= m 5.4e+16) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.62) {
tmp = a * (1.0 / (k * k));
} else if (m <= 5.4e+16) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (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 <= (-0.62d0)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 5.4d+16) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.62) {
tmp = a * (1.0 / (k * k));
} else if (m <= 5.4e+16) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.62: tmp = a * (1.0 / (k * k)) elif m <= 5.4e+16: tmp = a / (1.0 + (k * k)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.62) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 5.4e+16) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.62) tmp = a * (1.0 / (k * k)); elseif (m <= 5.4e+16) tmp = a / (1.0 + (k * k)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.62], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5.4e+16], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.62:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 5.4 \cdot 10^{+16}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -0.619999999999999996Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 43.6%
Taylor expanded in k around inf 67.7%
unpow267.7%
Simplified67.7%
if -0.619999999999999996 < m < 5.4e16Initial program 97.4%
associate-*r/97.4%
associate-+l+97.4%
+-commutative97.4%
distribute-rgt-out97.4%
fma-def97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in m around 0 94.9%
Taylor expanded in k around inf 92.4%
unpow292.4%
Simplified92.4%
if 5.4e16 < m Initial program 61.5%
associate-*r/61.5%
associate-+l+61.5%
+-commutative61.5%
distribute-rgt-out61.5%
fma-def61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in m around 0 2.8%
Taylor expanded in k around 0 12.6%
*-commutative12.6%
Simplified12.6%
Final simplification56.3%
(FPCore (a k m) :precision binary64 (if (or (<= k -3.6e+111) (not (<= k 26500.0))) (/ a (* k 10.0)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= -3.6e+111) || !(k <= 26500.0)) {
tmp = a / (k * 10.0);
} 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 <= (-3.6d+111)) .or. (.not. (k <= 26500.0d0))) then
tmp = a / (k * 10.0d0)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((k <= -3.6e+111) || !(k <= 26500.0)) {
tmp = a / (k * 10.0);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= -3.6e+111) or not (k <= 26500.0): tmp = a / (k * 10.0) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= -3.6e+111) || !(k <= 26500.0)) tmp = Float64(a / Float64(k * 10.0)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((k <= -3.6e+111) || ~((k <= 26500.0))) tmp = a / (k * 10.0); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, -3.6e+111], N[Not[LessEqual[k, 26500.0]], $MachinePrecision]], N[(a / N[(k * 10.0), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -3.6 \cdot 10^{+111} \lor \neg \left(k \leq 26500\right):\\
\;\;\;\;\frac{a}{k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -3.6000000000000002e111 or 26500 < k Initial program 72.2%
associate-*r/72.2%
associate-+l+72.2%
+-commutative72.2%
distribute-rgt-out72.2%
fma-def72.2%
+-commutative72.2%
Simplified72.2%
Taylor expanded in m around 0 55.8%
Taylor expanded in k around 0 24.8%
*-commutative24.8%
Simplified24.8%
Taylor expanded in k around inf 24.8%
*-commutative24.8%
Simplified24.8%
if -3.6000000000000002e111 < k < 26500Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 35.5%
Taylor expanded in k around 0 35.1%
Final simplification29.7%
(FPCore (a k m) :precision binary64 (if (or (<= k 6.5e-306) (not (<= k 26500.0))) (/ a (* k k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= 6.5e-306) || !(k <= 26500.0)) {
tmp = a / (k * 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 <= 6.5d-306) .or. (.not. (k <= 26500.0d0))) then
tmp = a / (k * k)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((k <= 6.5e-306) || !(k <= 26500.0)) {
tmp = a / (k * k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 6.5e-306) or not (k <= 26500.0): tmp = a / (k * k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 6.5e-306) || !(k <= 26500.0)) tmp = Float64(a / Float64(k * k)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((k <= 6.5e-306) || ~((k <= 26500.0))) tmp = a / (k * k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 6.5e-306], N[Not[LessEqual[k, 26500.0]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.5 \cdot 10^{-306} \lor \neg \left(k \leq 26500\right):\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < 6.5000000000000004e-306 or 26500 < k Initial program 79.0%
associate-*r/79.0%
associate-+l+79.0%
+-commutative79.0%
distribute-rgt-out79.0%
fma-def79.0%
+-commutative79.0%
Simplified79.0%
Taylor expanded in m around 0 43.7%
Taylor expanded in k around inf 45.4%
unpow245.4%
Simplified45.4%
if 6.5000000000000004e-306 < k < 26500Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 51.6%
Taylor expanded in k around 0 50.8%
Final simplification47.0%
(FPCore (a k m) :precision binary64 (if (<= k 2.5e-306) (/ a (* k k)) (if (<= k 26500.0) a (/ (/ a k) k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 2.5e-306) {
tmp = a / (k * k);
} else if (k <= 26500.0) {
tmp = a;
} else {
tmp = (a / k) / 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 <= 2.5d-306) then
tmp = a / (k * k)
else if (k <= 26500.0d0) then
tmp = a
else
tmp = (a / k) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 2.5e-306) {
tmp = a / (k * k);
} else if (k <= 26500.0) {
tmp = a;
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 2.5e-306: tmp = a / (k * k) elif k <= 26500.0: tmp = a else: tmp = (a / k) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= 2.5e-306) tmp = Float64(a / Float64(k * k)); elseif (k <= 26500.0) tmp = a; else tmp = Float64(Float64(a / k) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 2.5e-306) tmp = a / (k * k); elseif (k <= 26500.0) tmp = a; else tmp = (a / k) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 2.5e-306], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 26500.0], a, N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.5 \cdot 10^{-306}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;k \leq 26500:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < 2.49999999999999999e-306Initial program 80.0%
associate-*r/80.0%
associate-+l+80.0%
+-commutative80.0%
distribute-rgt-out80.0%
fma-def80.0%
+-commutative80.0%
Simplified80.0%
Taylor expanded in m around 0 29.0%
Taylor expanded in k around inf 33.9%
unpow233.9%
Simplified33.9%
if 2.49999999999999999e-306 < k < 26500Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 51.6%
Taylor expanded in k around 0 50.8%
if 26500 < k Initial program 77.9%
associate-*r/77.9%
associate-+l+77.9%
+-commutative77.9%
distribute-rgt-out77.9%
fma-def77.9%
+-commutative77.9%
Simplified77.9%
Taylor expanded in m around 0 59.0%
Taylor expanded in k around inf 57.2%
unpow257.2%
Simplified57.2%
associate-/r*57.5%
div-inv57.5%
Applied egg-rr57.5%
un-div-inv57.5%
Applied egg-rr57.5%
Final simplification47.1%
(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 85.5%
associate-*r/85.4%
associate-+l+85.4%
+-commutative85.4%
distribute-rgt-out85.4%
fma-def85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in m around 0 46.1%
Taylor expanded in k around 0 19.0%
Final simplification19.0%
herbie shell --seed 2023223
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))