
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m -5.4e-22) (/ (pow k m) (/ (+ 1.0 (* k (+ k 10.0))) a)) (if (<= m 0.0033) (/ (/ a (hypot 1.0 k)) (hypot 1.0 k)) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.4e-22) {
tmp = pow(k, m) / ((1.0 + (k * (k + 10.0))) / a);
} else if (m <= 0.0033) {
tmp = (a / hypot(1.0, k)) / hypot(1.0, k);
} else {
tmp = a * pow(k, m);
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (m <= -5.4e-22) {
tmp = Math.pow(k, m) / ((1.0 + (k * (k + 10.0))) / a);
} else if (m <= 0.0033) {
tmp = (a / Math.hypot(1.0, k)) / Math.hypot(1.0, k);
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.4e-22: tmp = math.pow(k, m) / ((1.0 + (k * (k + 10.0))) / a) elif m <= 0.0033: tmp = (a / math.hypot(1.0, k)) / math.hypot(1.0, k) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.4e-22) tmp = Float64((k ^ m) / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / a)); elseif (m <= 0.0033) tmp = Float64(Float64(a / hypot(1.0, k)) / hypot(1.0, k)); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -5.4e-22) tmp = (k ^ m) / ((1.0 + (k * (k + 10.0))) / a); elseif (m <= 0.0033) tmp = (a / hypot(1.0, k)) / hypot(1.0, k); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.4e-22], N[(N[Power[k, m], $MachinePrecision] / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0033], N[(N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.4 \cdot 10^{-22}:\\
\;\;\;\;\frac{{k}^{m}}{\frac{1 + k \cdot \left(k + 10\right)}{a}}\\
\mathbf{elif}\;m \leq 0.0033:\\
\;\;\;\;\frac{\frac{a}{\mathsf{hypot}\left(1, k\right)}}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -5.4000000000000004e-22Initial program 100.0%
*-commutative100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
if -5.4000000000000004e-22 < m < 0.0033Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in k around 0 89.4%
*-un-lft-identity89.4%
add-sqr-sqrt89.4%
times-frac89.4%
hypot-1-def89.4%
hypot-1-def97.7%
Applied egg-rr97.7%
associate-*l/97.8%
*-lft-identity97.8%
Simplified97.8%
Taylor expanded in m around 0 96.8%
if 0.0033 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in k around 0 100.0%
Final simplification98.9%
(FPCore (a k m) :precision binary64 (/ (/ (* a (pow k m)) (hypot 1.0 k)) (hypot 1.0 k)))
double code(double a, double k, double m) {
return ((a * pow(k, m)) / hypot(1.0, k)) / hypot(1.0, k);
}
public static double code(double a, double k, double m) {
return ((a * Math.pow(k, m)) / Math.hypot(1.0, k)) / Math.hypot(1.0, k);
}
def code(a, k, m): return ((a * math.pow(k, m)) / math.hypot(1.0, k)) / math.hypot(1.0, k)
function code(a, k, m) return Float64(Float64(Float64(a * (k ^ m)) / hypot(1.0, k)) / hypot(1.0, k)) end
function tmp = code(a, k, m) tmp = ((a * (k ^ m)) / hypot(1.0, k)) / hypot(1.0, k); end
code[a_, k_, m_] := N[(N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{a \cdot {k}^{m}}{\mathsf{hypot}\left(1, k\right)}}{\mathsf{hypot}\left(1, k\right)}
\end{array}
Initial program 89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in k around 0 88.4%
*-un-lft-identity88.4%
add-sqr-sqrt88.4%
times-frac88.4%
hypot-1-def88.4%
hypot-1-def98.4%
Applied egg-rr98.4%
associate-*l/98.4%
*-lft-identity98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 2e+244)
(/ (/ a (pow k (- m))) (+ 1.0 (* k (+ k 10.0))))
t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+244) {
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 = a * (k ** m)
if ((t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))) <= 2d+244) 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 = a * Math.pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+244) {
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 = a * math.pow(k, m) tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+244: 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(a * (k ^ m)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 2e+244) tmp = Float64(Float64(a / (k ^ Float64(-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 = a * (k ^ m); tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 2e+244) 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[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+244], N[(N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 2 \cdot 10^{+244}:\\
\;\;\;\;\frac{\frac{a}{{k}^{\left(-m\right)}}}{1 + k \cdot \left(k + 10\right)}\\
\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))) < 2.00000000000000015e244Initial program 96.4%
associate-/l*96.4%
sqr-neg96.4%
associate-+l+96.4%
sqr-neg96.4%
distribute-rgt-out96.4%
Simplified96.4%
*-un-lft-identity96.4%
div-inv96.4%
distribute-lft-in96.4%
associate-+l+96.4%
times-frac96.4%
associate-+l+96.4%
distribute-lft-in96.4%
+-commutative96.4%
+-commutative96.4%
fma-udef96.4%
pow-flip96.4%
Applied egg-rr96.4%
associate-*l/96.4%
*-lft-identity96.4%
Simplified96.4%
fma-udef94.6%
Applied egg-rr96.4%
if 2.00000000000000015e244 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 1 (*.f64 10 k)) (*.f64 k k))) Initial program 56.1%
associate-/l*56.1%
sqr-neg56.1%
associate-+l+56.1%
sqr-neg56.1%
distribute-rgt-out56.1%
Simplified56.1%
Taylor expanded in k around 0 97.6%
Final simplification96.6%
(FPCore (a k m) :precision binary64 (if (<= m 2.2) (/ a (/ (+ 1.0 (* k (+ k 10.0))) (pow k m))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.2) {
tmp = a / ((1.0 + (k * (k + 10.0))) / pow(k, m));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.2d0) then
tmp = a / ((1.0d0 + (k * (k + 10.0d0))) / (k ** m))
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.2) {
tmp = a / ((1.0 + (k * (k + 10.0))) / Math.pow(k, m));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.2: tmp = a / ((1.0 + (k * (k + 10.0))) / math.pow(k, m)) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.2) tmp = Float64(a / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / (k ^ m))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.2) tmp = a / ((1.0 + (k * (k + 10.0))) / (k ^ m)); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.2], N[(a / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.2:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 2.2000000000000002Initial program 95.7%
associate-/l*95.6%
sqr-neg95.6%
associate-+l+95.7%
sqr-neg95.7%
distribute-rgt-out95.7%
Simplified95.7%
if 2.2000000000000002 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in k around 0 100.0%
Final simplification97.0%
(FPCore (a k m) :precision binary64 (if (<= m -7e-16) (/ a (/ (+ 1.0 (* k 10.0)) (pow k m))) (if (<= m 0.000225) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -7e-16) {
tmp = a / ((1.0 + (k * 10.0)) / pow(k, m));
} else if (m <= 0.000225) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-7d-16)) then
tmp = a / ((1.0d0 + (k * 10.0d0)) / (k ** m))
else if (m <= 0.000225d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -7e-16) {
tmp = a / ((1.0 + (k * 10.0)) / Math.pow(k, m));
} else if (m <= 0.000225) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -7e-16: tmp = a / ((1.0 + (k * 10.0)) / math.pow(k, m)) elif m <= 0.000225: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -7e-16) tmp = Float64(a / Float64(Float64(1.0 + Float64(k * 10.0)) / (k ^ m))); elseif (m <= 0.000225) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -7e-16) tmp = a / ((1.0 + (k * 10.0)) / (k ^ m)); elseif (m <= 0.000225) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -7e-16], N[(a / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.000225], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -7 \cdot 10^{-16}:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot 10}{{k}^{m}}}\\
\mathbf{elif}\;m \leq 0.000225:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -7.00000000000000035e-16Initial program 100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in k around 0 98.0%
*-commutative19.7%
Simplified98.0%
if -7.00000000000000035e-16 < m < 2.2499999999999999e-4Initial program 91.5%
associate-/l*91.5%
sqr-neg91.5%
associate-+l+91.5%
sqr-neg91.5%
distribute-rgt-out91.5%
Simplified91.5%
Taylor expanded in m around 0 90.5%
if 2.2499999999999999e-4 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in k around 0 100.0%
Final simplification95.9%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 2.2) (/ t_0 (+ 1.0 (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= 2.2) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a * (k ** m)
if (m <= 2.2d0) then
tmp = t_0 / (1.0d0 + (k * k))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double tmp;
if (m <= 2.2) {
tmp = t_0 / (1.0 + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if m <= 2.2: tmp = t_0 / (1.0 + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (m <= 2.2) tmp = Float64(t_0 / Float64(1.0 + Float64(k * k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); tmp = 0.0; if (m <= 2.2) tmp = t_0 / (1.0 + (k * k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 2.2], N[(t$95$0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq 2.2:\\
\;\;\;\;\frac{t_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if m < 2.2000000000000002Initial program 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in k around 0 93.4%
if 2.2000000000000002 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in k around 0 100.0%
Final simplification95.4%
(FPCore (a k m) :precision binary64 (if (or (<= m -1.25e-5) (not (<= m 2.6e-6))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -1.25e-5) || !(m <= 2.6e-6)) {
tmp = a * pow(k, m);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-1.25d-5)) .or. (.not. (m <= 2.6d-6))) then
tmp = a * (k ** m)
else
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -1.25e-5) || !(m <= 2.6e-6)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -1.25e-5) or not (m <= 2.6e-6): tmp = a * math.pow(k, m) else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -1.25e-5) || !(m <= 2.6e-6)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -1.25e-5) || ~((m <= 2.6e-6))) tmp = a * (k ^ m); else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -1.25e-5], N[Not[LessEqual[m, 2.6e-6]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.25 \cdot 10^{-5} \lor \neg \left(m \leq 2.6 \cdot 10^{-6}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -1.25000000000000006e-5 or 2.60000000000000009e-6 < m Initial program 89.1%
associate-/l*89.1%
sqr-neg89.1%
associate-+l+89.1%
sqr-neg89.1%
distribute-rgt-out89.1%
Simplified89.1%
Taylor expanded in k around 0 98.3%
if -1.25000000000000006e-5 < m < 2.60000000000000009e-6Initial program 91.5%
associate-/l*91.5%
sqr-neg91.5%
associate-+l+91.5%
sqr-neg91.5%
distribute-rgt-out91.5%
Simplified91.5%
Taylor expanded in m around 0 90.5%
Final simplification95.5%
(FPCore (a k m) :precision binary64 (if (<= m -0.011) (* 0.1 (/ a k)) (if (<= m 7.5e+79) (- a (* a (* k -10.0))) (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.011) {
tmp = 0.1 * (a / k);
} else if (m <= 7.5e+79) {
tmp = a - (a * (k * -10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.011d0)) then
tmp = 0.1d0 * (a / k)
else if (m <= 7.5d+79) then
tmp = a - (a * (k * (-10.0d0)))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.011) {
tmp = 0.1 * (a / k);
} else if (m <= 7.5e+79) {
tmp = a - (a * (k * -10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.011: tmp = 0.1 * (a / k) elif m <= 7.5e+79: tmp = a - (a * (k * -10.0)) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.011) tmp = Float64(0.1 * Float64(a / k)); elseif (m <= 7.5e+79) tmp = Float64(a - Float64(a * Float64(k * -10.0))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.011) tmp = 0.1 * (a / k); elseif (m <= 7.5e+79) tmp = a - (a * (k * -10.0)); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.011], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 7.5e+79], N[(a - N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.011:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{elif}\;m \leq 7.5 \cdot 10^{+79}:\\
\;\;\;\;a - a \cdot \left(k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -0.010999999999999999Initial program 100.0%
*-commutative100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 98.0%
Taylor expanded in m around 0 21.6%
Taylor expanded in k around inf 21.7%
if -0.010999999999999999 < m < 7.49999999999999967e79Initial program 85.2%
associate-/l*85.2%
sqr-neg85.2%
associate-+l+85.2%
sqr-neg85.2%
distribute-rgt-out85.2%
Simplified85.2%
Taylor expanded in m around 0 73.5%
Taylor expanded in k around 0 40.9%
Taylor expanded in a around 0 40.9%
*-commutative40.9%
Simplified40.9%
*-un-lft-identity40.9%
add-sqr-sqrt23.1%
sqrt-unprod18.3%
sqr-neg18.3%
sqrt-unprod1.1%
add-sqr-sqrt4.5%
*-un-lft-identity4.5%
add-sqr-sqrt0.0%
sqrt-unprod1.9%
swap-sqr1.9%
metadata-eval1.9%
metadata-eval1.9%
swap-sqr1.9%
sqrt-unprod1.9%
add-sqr-sqrt2.3%
distribute-rgt-out2.3%
*-commutative2.3%
*-un-lft-identity2.3%
distribute-lft-neg-out2.3%
unsub-neg2.3%
Applied egg-rr42.7%
if 7.49999999999999967e79 < m Initial program 83.9%
associate-/l*83.9%
sqr-neg83.9%
associate-+l+83.9%
sqr-neg83.9%
distribute-rgt-out83.9%
Simplified83.9%
Taylor expanded in m around 0 3.6%
Taylor expanded in k around 0 8.8%
Taylor expanded in k around inf 25.9%
Final simplification31.9%
(FPCore (a k m) :precision binary64 (if (<= m -0.011) (/ 1.0 (* 10.0 (/ k a))) (if (<= m 4e+79) (- a (* a (* k -10.0))) (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.011) {
tmp = 1.0 / (10.0 * (k / a));
} else if (m <= 4e+79) {
tmp = a - (a * (k * -10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.011d0)) then
tmp = 1.0d0 / (10.0d0 * (k / a))
else if (m <= 4d+79) then
tmp = a - (a * (k * (-10.0d0)))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.011) {
tmp = 1.0 / (10.0 * (k / a));
} else if (m <= 4e+79) {
tmp = a - (a * (k * -10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.011: tmp = 1.0 / (10.0 * (k / a)) elif m <= 4e+79: tmp = a - (a * (k * -10.0)) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.011) tmp = Float64(1.0 / Float64(10.0 * Float64(k / a))); elseif (m <= 4e+79) tmp = Float64(a - Float64(a * Float64(k * -10.0))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.011) tmp = 1.0 / (10.0 * (k / a)); elseif (m <= 4e+79) tmp = a - (a * (k * -10.0)); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.011], N[(1.0 / N[(10.0 * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4e+79], N[(a - N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.011:\\
\;\;\;\;\frac{1}{10 \cdot \frac{k}{a}}\\
\mathbf{elif}\;m \leq 4 \cdot 10^{+79}:\\
\;\;\;\;a - a \cdot \left(k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -0.010999999999999999Initial program 100.0%
*-commutative100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 98.0%
Taylor expanded in m around 0 21.6%
Taylor expanded in k around inf 23.6%
if -0.010999999999999999 < m < 3.99999999999999987e79Initial program 85.2%
associate-/l*85.2%
sqr-neg85.2%
associate-+l+85.2%
sqr-neg85.2%
distribute-rgt-out85.2%
Simplified85.2%
Taylor expanded in m around 0 73.5%
Taylor expanded in k around 0 40.9%
Taylor expanded in a around 0 40.9%
*-commutative40.9%
Simplified40.9%
*-un-lft-identity40.9%
add-sqr-sqrt23.1%
sqrt-unprod18.3%
sqr-neg18.3%
sqrt-unprod1.1%
add-sqr-sqrt4.5%
*-un-lft-identity4.5%
add-sqr-sqrt0.0%
sqrt-unprod1.9%
swap-sqr1.9%
metadata-eval1.9%
metadata-eval1.9%
swap-sqr1.9%
sqrt-unprod1.9%
add-sqr-sqrt2.3%
distribute-rgt-out2.3%
*-commutative2.3%
*-un-lft-identity2.3%
distribute-lft-neg-out2.3%
unsub-neg2.3%
Applied egg-rr42.7%
if 3.99999999999999987e79 < m Initial program 83.9%
associate-/l*83.9%
sqr-neg83.9%
associate-+l+83.9%
sqr-neg83.9%
distribute-rgt-out83.9%
Simplified83.9%
Taylor expanded in m around 0 3.6%
Taylor expanded in k around 0 8.8%
Taylor expanded in k around inf 25.9%
Final simplification32.5%
(FPCore (a k m) :precision binary64 (if (<= m 0.88) (/ a (+ 1.0 (* k k))) (/ 1.0 (/ (- a) (* a (- a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.88) {
tmp = a / (1.0 + (k * k));
} else {
tmp = 1.0 / (-a / (a * -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.88d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = 1.0d0 / (-a / (a * -a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.88) {
tmp = a / (1.0 + (k * k));
} else {
tmp = 1.0 / (-a / (a * -a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.88: tmp = a / (1.0 + (k * k)) else: tmp = 1.0 / (-a / (a * -a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.88) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(1.0 / Float64(Float64(-a) / Float64(a * Float64(-a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.88) tmp = a / (1.0 + (k * k)); else tmp = 1.0 / (-a / (a * -a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.88], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[((-a) / N[(a * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.88:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{-a}{a \cdot \left(-a\right)}}\\
\end{array}
\end{array}
if m < 0.880000000000000004Initial program 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in k around 0 93.4%
Taylor expanded in m around 0 63.6%
if 0.880000000000000004 < m Initial program 76.6%
*-commutative76.6%
associate-/l*68.8%
sqr-neg68.8%
associate-+l+68.8%
+-commutative68.8%
sqr-neg68.8%
distribute-rgt-out68.8%
fma-def68.8%
+-commutative68.8%
Simplified68.8%
Taylor expanded in k around 0 70.1%
Taylor expanded in m around 0 3.1%
+-commutative3.1%
frac-2neg3.1%
metadata-eval3.1%
associate-*r/3.1%
*-commutative3.1%
frac-add21.0%
neg-mul-121.0%
Applied egg-rr21.0%
Taylor expanded in k around 0 30.5%
mul-1-neg30.5%
Simplified30.5%
Final simplification53.6%
(FPCore (a k m) :precision binary64 (if (<= m 0.76) (/ a (+ 1.0 (* k (+ k 10.0)))) (/ 1.0 (/ (- a) (* a (- a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.76) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = 1.0 / (-a / (a * -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.76d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = 1.0d0 / (-a / (a * -a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.76) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = 1.0 / (-a / (a * -a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.76: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = 1.0 / (-a / (a * -a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.76) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(1.0 / Float64(Float64(-a) / Float64(a * Float64(-a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.76) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = 1.0 / (-a / (a * -a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.76], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[((-a) / N[(a * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.76:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{-a}{a \cdot \left(-a\right)}}\\
\end{array}
\end{array}
if m < 0.76000000000000001Initial program 95.7%
associate-/l*95.6%
sqr-neg95.6%
associate-+l+95.7%
sqr-neg95.7%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 64.7%
if 0.76000000000000001 < m Initial program 76.6%
*-commutative76.6%
associate-/l*68.8%
sqr-neg68.8%
associate-+l+68.8%
+-commutative68.8%
sqr-neg68.8%
distribute-rgt-out68.8%
fma-def68.8%
+-commutative68.8%
Simplified68.8%
Taylor expanded in k around 0 70.1%
Taylor expanded in m around 0 3.1%
+-commutative3.1%
frac-2neg3.1%
metadata-eval3.1%
associate-*r/3.1%
*-commutative3.1%
frac-add21.0%
neg-mul-121.0%
Applied egg-rr21.0%
Taylor expanded in k around 0 30.5%
mul-1-neg30.5%
Simplified30.5%
Final simplification54.4%
(FPCore (a k m) :precision binary64 (if (<= m -0.011) (* 0.1 (/ a k)) (if (<= m 0.55) a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.011) {
tmp = 0.1 * (a / k);
} else if (m <= 0.55) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.011d0)) then
tmp = 0.1d0 * (a / k)
else if (m <= 0.55d0) then
tmp = a
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.011) {
tmp = 0.1 * (a / k);
} else if (m <= 0.55) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.011: tmp = 0.1 * (a / k) elif m <= 0.55: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.011) tmp = Float64(0.1 * Float64(a / k)); elseif (m <= 0.55) tmp = a; else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.011) tmp = 0.1 * (a / k); elseif (m <= 0.55) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.011], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.55], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.011:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{elif}\;m \leq 0.55:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -0.010999999999999999Initial program 100.0%
*-commutative100.0%
associate-/l*100.0%
sqr-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in k around 0 98.0%
Taylor expanded in m around 0 21.6%
Taylor expanded in k around inf 21.7%
if -0.010999999999999999 < m < 0.55000000000000004Initial program 91.6%
associate-/l*91.5%
sqr-neg91.5%
associate-+l+91.6%
sqr-neg91.6%
distribute-rgt-out91.6%
Simplified91.6%
Taylor expanded in m around 0 89.6%
Taylor expanded in k around 0 49.6%
Taylor expanded in k around 0 50.3%
if 0.55000000000000004 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 7.2%
Taylor expanded in k around inf 21.1%
Final simplification31.8%
(FPCore (a k m) :precision binary64 (if (<= m 0.72) (/ a (+ 1.0 (* k 10.0))) (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.72) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.72d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.72) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.72: tmp = a / (1.0 + (k * 10.0)) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.72) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.72) tmp = a / (1.0 + (k * 10.0)); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.72], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.72:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 0.71999999999999997Initial program 95.7%
associate-/l*95.6%
sqr-neg95.6%
associate-+l+95.7%
sqr-neg95.7%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 64.7%
Taylor expanded in k around 0 41.4%
*-commutative41.4%
Simplified41.4%
if 0.71999999999999997 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 7.2%
Taylor expanded in k around inf 21.1%
Final simplification35.3%
(FPCore (a k m) :precision binary64 (if (<= m 1.4) (/ a (+ 1.0 (* k k))) (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.4) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.4d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.4) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.4: tmp = a / (1.0 + (k * k)) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.4) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.4) tmp = a / (1.0 + (k * k)); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.4], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.4:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 1.3999999999999999Initial program 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in k around 0 93.4%
Taylor expanded in m around 0 63.6%
if 1.3999999999999999 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 7.2%
Taylor expanded in k around inf 21.1%
Final simplification50.8%
(FPCore (a k m) :precision binary64 (if (<= m 0.21) a (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.21) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.21d0) then
tmp = a
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.21) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.21: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.21) tmp = a; else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.21) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.21], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.21:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 0.209999999999999992Initial program 95.7%
associate-/l*95.6%
sqr-neg95.6%
associate-+l+95.7%
sqr-neg95.7%
distribute-rgt-out95.7%
Simplified95.7%
Taylor expanded in m around 0 64.7%
Taylor expanded in k around 0 26.9%
Taylor expanded in k around 0 27.7%
if 0.209999999999999992 < m Initial program 76.6%
associate-/l*76.6%
sqr-neg76.6%
associate-+l+76.6%
sqr-neg76.6%
distribute-rgt-out76.6%
Simplified76.6%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 7.2%
Taylor expanded in k around inf 21.1%
Final simplification25.7%
(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.9%
associate-/l*89.9%
sqr-neg89.9%
associate-+l+89.9%
sqr-neg89.9%
distribute-rgt-out89.9%
Simplified89.9%
Taylor expanded in m around 0 46.2%
Taylor expanded in k around 0 21.0%
Taylor expanded in k around 0 20.6%
Final simplification20.6%
herbie shell --seed 2023339
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))