
(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
(let* ((t_0 (* a (pow k m))))
(if (<= m -0.0002)
(/ (/ a (fma k (+ k 10.0) 1.0)) (pow k (- m)))
(if (<= m 7.5e-5)
(/ -1.0 (- (/ -1.0 t_0) (* (/ k a) (/ (+ k 10.0) (pow k m)))))
t_0))))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= -0.0002) {
tmp = (a / fma(k, (k + 10.0), 1.0)) / pow(k, -m);
} else if (m <= 7.5e-5) {
tmp = -1.0 / ((-1.0 / t_0) - ((k / a) * ((k + 10.0) / pow(k, m))));
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (m <= -0.0002) tmp = Float64(Float64(a / fma(k, Float64(k + 10.0), 1.0)) / (k ^ Float64(-m))); elseif (m <= 7.5e-5) tmp = Float64(-1.0 / Float64(Float64(-1.0 / t_0) - Float64(Float64(k / a) * Float64(Float64(k + 10.0) / (k ^ m))))); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -0.0002], N[(N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 7.5e-5], N[(-1.0 / N[(N[(-1.0 / t$95$0), $MachinePrecision] - N[(N[(k / a), $MachinePrecision] * N[(N[(k + 10.0), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq -0.0002:\\
\;\;\;\;\frac{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}}{{k}^{\left(-m\right)}}\\
\mathbf{elif}\;m \leq 7.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\frac{-1}{t\_0} - \frac{k}{a} \cdot \frac{k + 10}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -2.0000000000000001e-4Initial program 100.0%
associate-*l/100.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%
div-inv100.0%
associate-/r*100.0%
associate-+l+100.0%
distribute-lft-in100.0%
+-commutative100.0%
+-commutative100.0%
fma-undefine100.0%
pow-flip100.0%
Applied egg-rr100.0%
if -2.0000000000000001e-4 < m < 7.49999999999999934e-5Initial program 92.9%
associate-*l/92.9%
sqr-neg92.9%
associate-+l+92.9%
sqr-neg92.9%
distribute-rgt-out92.9%
Simplified92.9%
+-commutative92.9%
+-commutative92.9%
fma-undefine92.9%
associate-/r/92.9%
clear-num92.8%
frac-2neg92.8%
metadata-eval92.8%
Applied egg-rr92.8%
associate-/l/92.8%
distribute-neg-frac92.8%
neg-sub092.8%
metadata-eval92.8%
fma-undefine92.8%
+-commutative92.8%
associate--r+92.8%
metadata-eval92.8%
metadata-eval92.8%
Simplified92.8%
div-sub92.8%
sub-neg92.8%
times-frac99.2%
Applied egg-rr99.2%
sub-neg99.2%
Simplified99.2%
if 7.49999999999999934e-5 < m Initial program 82.5%
associate-*l/79.4%
sqr-neg79.4%
associate-+l+79.4%
sqr-neg79.4%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in k around 0 100.0%
Final simplification99.7%
(FPCore (a k m) :precision binary64 (if (or (<= m -4.2e-5) (not (<= m 9e-9))) (* a (pow k m)) (* a (/ 1.0 (fma k (+ k 10.0) 1.0)))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -4.2e-5) || !(m <= 9e-9)) {
tmp = a * pow(k, m);
} else {
tmp = a * (1.0 / fma(k, (k + 10.0), 1.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if ((m <= -4.2e-5) || !(m <= 9e-9)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a * Float64(1.0 / fma(k, Float64(k + 10.0), 1.0))); end return tmp end
code[a_, k_, m_] := If[Or[LessEqual[m, -4.2e-5], N[Not[LessEqual[m, 9e-9]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.2 \cdot 10^{-5} \lor \neg \left(m \leq 9 \cdot 10^{-9}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\end{array}
\end{array}
if m < -4.19999999999999977e-5 or 8.99999999999999953e-9 < m Initial program 92.9%
associate-*l/91.6%
sqr-neg91.6%
associate-+l+91.6%
sqr-neg91.6%
distribute-rgt-out91.6%
Simplified91.6%
Taylor expanded in k around 0 98.7%
if -4.19999999999999977e-5 < m < 8.99999999999999953e-9Initial program 92.9%
associate-*l/92.9%
sqr-neg92.9%
associate-+l+92.9%
sqr-neg92.9%
distribute-rgt-out92.9%
Simplified92.9%
Taylor expanded in m around 0 92.1%
clear-num91.9%
distribute-lft-in91.9%
associate-+l+91.9%
associate-/r/92.1%
associate-+l+92.1%
distribute-lft-in92.1%
+-commutative92.1%
+-commutative92.1%
fma-undefine92.1%
Applied egg-rr92.1%
Final simplification96.1%
(FPCore (a k m) :precision binary64 (if (<= m -1.7e-7) (* (pow k m) (/ a (+ 1.0 (* k 10.0)))) (if (<= m 5e-5) (* a (/ 1.0 (fma k (+ k 10.0) 1.0))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.7e-7) {
tmp = pow(k, m) * (a / (1.0 + (k * 10.0)));
} else if (m <= 5e-5) {
tmp = a * (1.0 / fma(k, (k + 10.0), 1.0));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -1.7e-7) tmp = Float64((k ^ m) * Float64(a / Float64(1.0 + Float64(k * 10.0)))); elseif (m <= 5e-5) tmp = Float64(a * Float64(1.0 / fma(k, Float64(k + 10.0), 1.0))); else tmp = Float64(a * (k ^ m)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -1.7e-7], N[(N[Power[k, m], $MachinePrecision] * N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5e-5], N[(a * N[(1.0 / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.7 \cdot 10^{-7}:\\
\;\;\;\;{k}^{m} \cdot \frac{a}{1 + k \cdot 10}\\
\mathbf{elif}\;m \leq 5 \cdot 10^{-5}:\\
\;\;\;\;a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -1.69999999999999987e-7Initial 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 99.0%
*-commutative99.0%
Simplified99.0%
if -1.69999999999999987e-7 < m < 5.00000000000000024e-5Initial program 92.9%
associate-*l/92.9%
sqr-neg92.9%
associate-+l+92.9%
sqr-neg92.9%
distribute-rgt-out92.9%
Simplified92.9%
Taylor expanded in m around 0 92.1%
clear-num91.9%
distribute-lft-in91.9%
associate-+l+91.9%
associate-/r/92.1%
associate-+l+92.1%
distribute-lft-in92.1%
+-commutative92.1%
+-commutative92.1%
fma-undefine92.1%
Applied egg-rr92.1%
if 5.00000000000000024e-5 < m Initial program 82.5%
associate-*l/79.4%
sqr-neg79.4%
associate-+l+79.4%
sqr-neg79.4%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in k around 0 100.0%
Final simplification96.5%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 7.5e-5) (* t_0 (/ -1.0 (- -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 (m <= 7.5e-5) {
tmp = t_0 * (-1.0 / (-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 (m <= 7.5d-5) then
tmp = t_0 * ((-1.0d0) / ((-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 (m <= 7.5e-5) {
tmp = t_0 * (-1.0 / (-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 m <= 7.5e-5: tmp = t_0 * (-1.0 / (-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 (m <= 7.5e-5) tmp = Float64(t_0 * Float64(-1.0 / 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 (m <= 7.5e-5) tmp = t_0 * (-1.0 / (-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[m, 7.5e-5], N[(t$95$0 * N[(-1.0 / N[(-1.0 - N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq 7.5 \cdot 10^{-5}:\\
\;\;\;\;t\_0 \cdot \frac{-1}{-1 - k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 7.49999999999999934e-5Initial program 96.3%
associate-/l*96.3%
sqr-pow95.7%
associate-/r*95.7%
associate-/r*95.7%
sqr-pow96.3%
sqr-neg96.3%
associate-+l+96.3%
+-commutative96.3%
sqr-neg96.3%
distribute-rgt-out96.3%
fma-define96.3%
+-commutative96.3%
Simplified96.3%
fma-undefine96.3%
+-commutative96.3%
+-commutative96.3%
distribute-lft-in96.3%
associate-+l+96.3%
associate-/l*96.3%
clear-num96.2%
associate-/r/96.3%
associate-+l+96.3%
distribute-lft-in96.3%
+-commutative96.3%
+-commutative96.3%
fma-undefine96.3%
Applied egg-rr96.3%
frac-2neg96.3%
metadata-eval96.3%
div-inv96.3%
Applied egg-rr96.3%
associate-*r/96.3%
metadata-eval96.3%
fma-undefine96.3%
+-commutative96.3%
distribute-neg-in96.3%
metadata-eval96.3%
sub-neg96.3%
Simplified96.3%
if 7.49999999999999934e-5 < m Initial program 82.5%
associate-*l/79.4%
sqr-neg79.4%
associate-+l+79.4%
sqr-neg79.4%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in k around 0 100.0%
Final simplification97.2%
(FPCore (a k m) :precision binary64 (if (<= m 7.5e-5) (* (pow k m) (/ a (+ 1.0 (* k (+ k 10.0))))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 7.5e-5) {
tmp = pow(k, m) * (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 <= 7.5d-5) then
tmp = (k ** m) * (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 <= 7.5e-5) {
tmp = Math.pow(k, m) * (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 <= 7.5e-5: tmp = math.pow(k, m) * (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 <= 7.5e-5) tmp = Float64((k ^ m) * 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 <= 7.5e-5) tmp = (k ^ m) * (a / (1.0 + (k * (k + 10.0)))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 7.5e-5], N[(N[Power[k, m], $MachinePrecision] * N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 7.5 \cdot 10^{-5}:\\
\;\;\;\;{k}^{m} \cdot \frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 7.49999999999999934e-5Initial program 96.3%
associate-*l/96.3%
sqr-neg96.3%
associate-+l+96.3%
sqr-neg96.3%
distribute-rgt-out96.3%
Simplified96.3%
if 7.49999999999999934e-5 < m Initial program 82.5%
associate-*l/79.4%
sqr-neg79.4%
associate-+l+79.4%
sqr-neg79.4%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in k around 0 100.0%
Final simplification97.2%
(FPCore (a k m) :precision binary64 (if (<= m 7.5e-5) (/ 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 <= 7.5e-5) {
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 <= 7.5d-5) 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 <= 7.5e-5) {
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 <= 7.5e-5: 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 <= 7.5e-5) 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 <= 7.5e-5) 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, 7.5e-5], 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 7.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 7.49999999999999934e-5Initial program 96.3%
associate-/l*96.3%
sqr-pow95.7%
associate-/r*95.7%
associate-/r*95.7%
sqr-pow96.3%
sqr-neg96.3%
associate-+l+96.3%
+-commutative96.3%
sqr-neg96.3%
distribute-rgt-out96.3%
fma-define96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in m around inf 96.3%
if 7.49999999999999934e-5 < m Initial program 82.5%
associate-*l/79.4%
sqr-neg79.4%
associate-+l+79.4%
sqr-neg79.4%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in k around 0 100.0%
Final simplification97.2%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 7.5e-5) (/ 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 <= 7.5e-5) {
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 <= 7.5d-5) 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 <= 7.5e-5) {
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 <= 7.5e-5: 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 <= 7.5e-5) 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 <= 7.5e-5) 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, 7.5e-5], 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 7.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 7.49999999999999934e-5Initial program 96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in k around 0 94.9%
if 7.49999999999999934e-5 < m Initial program 82.5%
associate-*l/79.4%
sqr-neg79.4%
associate-+l+79.4%
sqr-neg79.4%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in k around 0 100.0%
Final simplification96.2%
(FPCore (a k m) :precision binary64 (if (or (<= m -8.6e-8) (not (<= m 1.4e-8))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -8.6e-8) || !(m <= 1.4e-8)) {
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 <= (-8.6d-8)) .or. (.not. (m <= 1.4d-8))) 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 <= -8.6e-8) || !(m <= 1.4e-8)) {
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 <= -8.6e-8) or not (m <= 1.4e-8): 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 <= -8.6e-8) || !(m <= 1.4e-8)) 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 <= -8.6e-8) || ~((m <= 1.4e-8))) 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, -8.6e-8], N[Not[LessEqual[m, 1.4e-8]], $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 -8.6 \cdot 10^{-8} \lor \neg \left(m \leq 1.4 \cdot 10^{-8}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -8.6000000000000002e-8 or 1.4e-8 < m Initial program 92.9%
associate-*l/91.6%
sqr-neg91.6%
associate-+l+91.6%
sqr-neg91.6%
distribute-rgt-out91.6%
Simplified91.6%
Taylor expanded in k around 0 98.7%
if -8.6000000000000002e-8 < m < 1.4e-8Initial program 92.9%
associate-*l/92.9%
sqr-neg92.9%
associate-+l+92.9%
sqr-neg92.9%
distribute-rgt-out92.9%
Simplified92.9%
Taylor expanded in m around 0 92.1%
Final simplification96.1%
(FPCore (a k m) :precision binary64 (if (<= m 1.35e+16) (/ -1.0 (* (- -1.0 (* k (+ k 10.0))) (/ -1.0 (- a)))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.35e+16) {
tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) * (-1.0 / -a));
} else {
tmp = a + (-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.35d+16) then
tmp = (-1.0d0) / (((-1.0d0) - (k * (k + 10.0d0))) * ((-1.0d0) / -a))
else
tmp = a + ((-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.35e+16) {
tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) * (-1.0 / -a));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.35e+16: tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) * (-1.0 / -a)) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.35e+16) tmp = Float64(-1.0 / Float64(Float64(-1.0 - Float64(k * Float64(k + 10.0))) * Float64(-1.0 / Float64(-a)))); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.35e+16) tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) * (-1.0 / -a)); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.35e+16], N[(-1.0 / N[(N[(-1.0 - N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.35 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1}{\left(-1 - k \cdot \left(k + 10\right)\right) \cdot \frac{-1}{-a}}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 1.35e16Initial program 95.3%
associate-*l/95.3%
sqr-neg95.3%
associate-+l+95.3%
sqr-neg95.3%
distribute-rgt-out95.3%
Simplified95.3%
+-commutative95.3%
+-commutative95.3%
fma-undefine95.3%
associate-/r/95.3%
clear-num95.2%
frac-2neg95.2%
metadata-eval95.2%
Applied egg-rr95.2%
associate-/l/95.2%
distribute-neg-frac95.2%
neg-sub095.2%
metadata-eval95.2%
fma-undefine95.2%
+-commutative95.2%
associate--r+95.2%
metadata-eval95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in m around 0 63.7%
frac-2neg63.7%
div-inv63.7%
+-commutative63.7%
distribute-neg-in63.7%
metadata-eval63.7%
sub-neg63.7%
Applied egg-rr63.7%
if 1.35e16 < m Initial program 85.0%
associate-*l/81.7%
sqr-neg81.7%
associate-+l+81.7%
sqr-neg81.7%
distribute-rgt-out81.7%
Simplified81.7%
Taylor expanded in m around 0 3.7%
Taylor expanded in k around 0 11.7%
Final simplification51.5%
(FPCore (a k m) :precision binary64 (if (<= m -1.7e+103) (/ 0.1 (/ k a)) (if (<= m 1.06e+16) (/ a (+ 1.0 (* k 10.0))) (+ a (* -10.0 (* a k))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.7e+103) {
tmp = 0.1 / (k / a);
} else if (m <= 1.06e+16) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-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.7d+103)) then
tmp = 0.1d0 / (k / a)
else if (m <= 1.06d+16) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a + ((-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.7e+103) {
tmp = 0.1 / (k / a);
} else if (m <= 1.06e+16) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.7e+103: tmp = 0.1 / (k / a) elif m <= 1.06e+16: tmp = a / (1.0 + (k * 10.0)) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.7e+103) tmp = Float64(0.1 / Float64(k / a)); elseif (m <= 1.06e+16) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.7e+103) tmp = 0.1 / (k / a); elseif (m <= 1.06e+16) tmp = a / (1.0 + (k * 10.0)); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.7e+103], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.06e+16], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.7 \cdot 10^{+103}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{elif}\;m \leq 1.06 \cdot 10^{+16}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < -1.6999999999999999e103Initial 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 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in k around inf 91.2%
Taylor expanded in m around 0 23.6%
clear-num24.6%
un-div-inv24.6%
Applied egg-rr24.6%
if -1.6999999999999999e103 < m < 1.06e16Initial program 93.4%
associate-*l/93.4%
sqr-neg93.4%
associate-+l+93.4%
sqr-neg93.4%
distribute-rgt-out93.4%
Simplified93.4%
Taylor expanded in m around 0 73.7%
Taylor expanded in k around 0 47.0%
*-commutative69.6%
Simplified47.0%
if 1.06e16 < m Initial program 85.0%
associate-*l/81.7%
sqr-neg81.7%
associate-+l+81.7%
sqr-neg81.7%
distribute-rgt-out81.7%
Simplified81.7%
Taylor expanded in m around 0 3.7%
Taylor expanded in k around 0 11.7%
Final simplification33.8%
(FPCore (a k m) :precision binary64 (if (<= m 2.7e+16) (/ -1.0 (/ (- -1.0 (* k (+ k 10.0))) a)) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.7e+16) {
tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) / a);
} else {
tmp = a + (-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 <= 2.7d+16) then
tmp = (-1.0d0) / (((-1.0d0) - (k * (k + 10.0d0))) / a)
else
tmp = a + ((-10.0d0) * (a * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.7e+16) {
tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) / a);
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.7e+16: tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) / a) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.7e+16) tmp = Float64(-1.0 / Float64(Float64(-1.0 - Float64(k * Float64(k + 10.0))) / a)); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.7e+16) tmp = -1.0 / ((-1.0 - (k * (k + 10.0))) / a); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.7e+16], N[(-1.0 / N[(N[(-1.0 - N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1}{\frac{-1 - k \cdot \left(k + 10\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 2.7e16Initial program 95.3%
associate-*l/95.3%
sqr-neg95.3%
associate-+l+95.3%
sqr-neg95.3%
distribute-rgt-out95.3%
Simplified95.3%
+-commutative95.3%
+-commutative95.3%
fma-undefine95.3%
associate-/r/95.3%
clear-num95.2%
frac-2neg95.2%
metadata-eval95.2%
Applied egg-rr95.2%
associate-/l/95.2%
distribute-neg-frac95.2%
neg-sub095.2%
metadata-eval95.2%
fma-undefine95.2%
+-commutative95.2%
associate--r+95.2%
metadata-eval95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in m around 0 63.7%
if 2.7e16 < m Initial program 85.0%
associate-*l/81.7%
sqr-neg81.7%
associate-+l+81.7%
sqr-neg81.7%
distribute-rgt-out81.7%
Simplified81.7%
Taylor expanded in m around 0 3.7%
Taylor expanded in k around 0 11.7%
Final simplification51.5%
(FPCore (a k m) :precision binary64 (if (<= m 1e+17) (/ a (+ 1.0 (* k (+ k 10.0)))) (+ a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1e+17) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (-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 <= 1d+17) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + ((-10.0d0) * (a * k))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1e+17) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (-10.0 * (a * k));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1e+17: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (-10.0 * (a * k)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1e+17) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(-10.0 * Float64(a * k))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1e+17) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (-10.0 * (a * k)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1e+17], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 10^{+17}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
if m < 1e17Initial program 95.3%
associate-*l/95.3%
sqr-neg95.3%
associate-+l+95.3%
sqr-neg95.3%
distribute-rgt-out95.3%
Simplified95.3%
Taylor expanded in m around 0 63.6%
if 1e17 < m Initial program 85.0%
associate-*l/81.7%
sqr-neg81.7%
associate-+l+81.7%
sqr-neg81.7%
distribute-rgt-out81.7%
Simplified81.7%
Taylor expanded in m around 0 3.7%
Taylor expanded in k around 0 11.7%
Final simplification51.5%
(FPCore (a k m) :precision binary64 (if (<= k 0.075) (+ a (* -10.0 (* a k))) (/ 0.1 (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.075) {
tmp = a + (-10.0 * (a * k));
} 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.075d0) then
tmp = a + ((-10.0d0) * (a * k))
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.075) {
tmp = a + (-10.0 * (a * k));
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.075: tmp = a + (-10.0 * (a * k)) else: tmp = 0.1 / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.075) tmp = Float64(a + Float64(-10.0 * Float64(a * k))); 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.075) tmp = a + (-10.0 * (a * k)); else tmp = 0.1 / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.075], N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.075:\\
\;\;\;\;a + -10 \cdot \left(a \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 0.0749999999999999972Initial program 97.5%
associate-*l/97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 39.2%
Taylor expanded in k around 0 33.2%
if 0.0749999999999999972 < k Initial program 84.9%
associate-*l/82.8%
sqr-neg82.8%
associate-+l+82.8%
sqr-neg82.8%
distribute-rgt-out82.8%
Simplified82.8%
Taylor expanded in k around 0 51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in k around inf 51.5%
Taylor expanded in m around 0 23.4%
clear-num24.2%
un-div-inv24.2%
Applied egg-rr24.2%
Final simplification29.9%
(FPCore (a k m) :precision binary64 (if (<= k 0.1) a (* 0.1 (/ a k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.1) {
tmp = a;
} else {
tmp = 0.1 * (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 (k <= 0.1d0) then
tmp = a
else
tmp = 0.1d0 * (a / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.1) {
tmp = a;
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.1: tmp = a else: tmp = 0.1 * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.1) tmp = a; else tmp = Float64(0.1 * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.1) tmp = a; else tmp = 0.1 * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.1], a, N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 0.10000000000000001Initial program 97.5%
associate-*l/97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 39.2%
Taylor expanded in k around 0 30.3%
if 0.10000000000000001 < k Initial program 84.9%
associate-*l/82.8%
sqr-neg82.8%
associate-+l+82.8%
sqr-neg82.8%
distribute-rgt-out82.8%
Simplified82.8%
Taylor expanded in k around 0 51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in k around inf 51.5%
Taylor expanded in m around 0 23.4%
Final simplification27.8%
(FPCore (a k m) :precision binary64 (if (<= k 0.1) a (/ 0.1 (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.1) {
tmp = 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.1d0) then
tmp = 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.1) {
tmp = a;
} else {
tmp = 0.1 / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.1: tmp = a else: tmp = 0.1 / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.1) tmp = 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.1) tmp = a; else tmp = 0.1 / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.1], a, N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 0.10000000000000001Initial program 97.5%
associate-*l/97.5%
sqr-neg97.5%
associate-+l+97.5%
sqr-neg97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in m around 0 39.2%
Taylor expanded in k around 0 30.3%
if 0.10000000000000001 < k Initial program 84.9%
associate-*l/82.8%
sqr-neg82.8%
associate-+l+82.8%
sqr-neg82.8%
distribute-rgt-out82.8%
Simplified82.8%
Taylor expanded in k around 0 51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in k around inf 51.5%
Taylor expanded in m around 0 23.4%
clear-num24.2%
un-div-inv24.2%
Applied egg-rr24.2%
Final simplification28.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 92.9%
associate-*l/92.1%
sqr-neg92.1%
associate-+l+92.1%
sqr-neg92.1%
distribute-rgt-out92.1%
Simplified92.1%
Taylor expanded in m around 0 49.6%
Taylor expanded in k around 0 20.7%
Final simplification20.7%
herbie shell --seed 2024034
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))