
(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 11 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 2e+211) 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 <= 2e+211) {
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 <= 2d+211) 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 <= 2e+211) {
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 <= 2e+211: 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 <= 2e+211) 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 <= 2e+211) 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, 2e+211], 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 2 \cdot 10^{+211}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m 3.9) (/ 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 <= 3.9) {
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 <= 3.9d0) 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 <= 3.9) {
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 <= 3.9: 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 <= 3.9) 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 <= 3.9) 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, 3.9], 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 3.9:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m -0.00075) (/ a (/ (+ 1.0 (* k 10.0)) (pow k m))) (if (<= m 5.2e-5) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.00075) {
tmp = a / ((1.0 + (k * 10.0)) / pow(k, m));
} else if (m <= 5.2e-5) {
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 <= (-0.00075d0)) then
tmp = a / ((1.0d0 + (k * 10.0d0)) / (k ** m))
else if (m <= 5.2d-5) 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 <= -0.00075) {
tmp = a / ((1.0 + (k * 10.0)) / Math.pow(k, m));
} else if (m <= 5.2e-5) {
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 <= -0.00075: tmp = a / ((1.0 + (k * 10.0)) / math.pow(k, m)) elif m <= 5.2e-5: 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 <= -0.00075) tmp = Float64(a / Float64(Float64(1.0 + Float64(k * 10.0)) / (k ^ m))); elseif (m <= 5.2e-5) 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 <= -0.00075) tmp = a / ((1.0 + (k * 10.0)) / (k ^ m)); elseif (m <= 5.2e-5) 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, -0.00075], N[(a / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5.2e-5], 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 -0.00075:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot 10}{{k}^{m}}}\\
\mathbf{elif}\;m \leq 5.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (or (<= m -0.00175) (not (<= m 0.000225))) (* a (pow k m)) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.00175) || !(m <= 0.000225)) {
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 <= (-0.00175d0)) .or. (.not. (m <= 0.000225d0))) 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 <= -0.00175) || !(m <= 0.000225)) {
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 <= -0.00175) or not (m <= 0.000225): 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 <= -0.00175) || !(m <= 0.000225)) 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 <= -0.00175) || ~((m <= 0.000225))) 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, -0.00175], N[Not[LessEqual[m, 0.000225]], $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 -0.00175 \lor \neg \left(m \leq 0.000225\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k (+ k 10.0)))) (t_1 (* -10.0 (* a k))))
(if (<= k -4.2e+82)
t_0
(if (<= k -5e-310) t_1 (if (<= k 0.075) (+ a t_1) t_0)))))
double code(double a, double k, double m) {
double t_0 = a / (k * (k + 10.0));
double t_1 = -10.0 * (a * k);
double tmp;
if (k <= -4.2e+82) {
tmp = t_0;
} else if (k <= -5e-310) {
tmp = t_1;
} else if (k <= 0.075) {
tmp = a + 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 * (k + 10.0d0))
t_1 = (-10.0d0) * (a * k)
if (k <= (-4.2d+82)) then
tmp = t_0
else if (k <= (-5d-310)) then
tmp = t_1
else if (k <= 0.075d0) then
tmp = a + 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 / (k * (k + 10.0));
double t_1 = -10.0 * (a * k);
double tmp;
if (k <= -4.2e+82) {
tmp = t_0;
} else if (k <= -5e-310) {
tmp = t_1;
} else if (k <= 0.075) {
tmp = a + t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * (k + 10.0)) t_1 = -10.0 * (a * k) tmp = 0 if k <= -4.2e+82: tmp = t_0 elif k <= -5e-310: tmp = t_1 elif k <= 0.075: tmp = a + t_1 else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * Float64(k + 10.0))) t_1 = Float64(-10.0 * Float64(a * k)) tmp = 0.0 if (k <= -4.2e+82) tmp = t_0; elseif (k <= -5e-310) tmp = t_1; elseif (k <= 0.075) tmp = Float64(a + t_1); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * (k + 10.0)); t_1 = -10.0 * (a * k); tmp = 0.0; if (k <= -4.2e+82) tmp = t_0; elseif (k <= -5e-310) tmp = t_1; elseif (k <= 0.075) tmp = a + t_1; else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -4.2e+82], t$95$0, If[LessEqual[k, -5e-310], t$95$1, If[LessEqual[k, 0.075], N[(a + t$95$1), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot \left(k + 10\right)}\\
t_1 := -10 \cdot \left(a \cdot k\right)\\
\mathbf{if}\;k \leq -4.2 \cdot 10^{+82}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 0.075:\\
\;\;\;\;a + t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k (+ k 10.0)))))
(if (<= k -2.3e+87)
t_0
(if (<= k 1.5e-308)
(* -10.0 (* a k))
(if (<= k 1.0) (/ a (+ 1.0 (* k 10.0))) t_0)))))
double code(double a, double k, double m) {
double t_0 = a / (k * (k + 10.0));
double tmp;
if (k <= -2.3e+87) {
tmp = t_0;
} else if (k <= 1.5e-308) {
tmp = -10.0 * (a * k);
} else if (k <= 1.0) {
tmp = a / (1.0 + (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 * (k + 10.0d0))
if (k <= (-2.3d+87)) then
tmp = t_0
else if (k <= 1.5d-308) then
tmp = (-10.0d0) * (a * k)
else if (k <= 1.0d0) then
tmp = a / (1.0d0 + (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 / (k * (k + 10.0));
double tmp;
if (k <= -2.3e+87) {
tmp = t_0;
} else if (k <= 1.5e-308) {
tmp = -10.0 * (a * k);
} else if (k <= 1.0) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a / (k * (k + 10.0)) tmp = 0 if k <= -2.3e+87: tmp = t_0 elif k <= 1.5e-308: tmp = -10.0 * (a * k) elif k <= 1.0: tmp = a / (1.0 + (k * 10.0)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a / Float64(k * Float64(k + 10.0))) tmp = 0.0 if (k <= -2.3e+87) tmp = t_0; elseif (k <= 1.5e-308) tmp = Float64(-10.0 * Float64(a * k)); elseif (k <= 1.0) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (k * (k + 10.0)); tmp = 0.0; if (k <= -2.3e+87) tmp = t_0; elseif (k <= 1.5e-308) tmp = -10.0 * (a * k); elseif (k <= 1.0) tmp = a / (1.0 + (k * 10.0)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -2.3e+87], t$95$0, If[LessEqual[k, 1.5e-308], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.0], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot \left(k + 10\right)}\\
\mathbf{if}\;k \leq -2.3 \cdot 10^{+87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 1.5 \cdot 10^{-308}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* k (+ k 10.0))))
(if (<= m -0.33)
(/ a t_0)
(if (<= m 0.95) (/ a (+ 1.0 t_0)) (* -10.0 (* a k))))))
double code(double a, double k, double m) {
double t_0 = k * (k + 10.0);
double tmp;
if (m <= -0.33) {
tmp = a / t_0;
} else if (m <= 0.95) {
tmp = a / (1.0 + t_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) :: t_0
real(8) :: tmp
t_0 = k * (k + 10.0d0)
if (m <= (-0.33d0)) then
tmp = a / t_0
else if (m <= 0.95d0) then
tmp = a / (1.0d0 + t_0)
else
tmp = (-10.0d0) * (a * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = k * (k + 10.0);
double tmp;
if (m <= -0.33) {
tmp = a / t_0;
} else if (m <= 0.95) {
tmp = a / (1.0 + t_0);
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): t_0 = k * (k + 10.0) tmp = 0 if m <= -0.33: tmp = a / t_0 elif m <= 0.95: tmp = a / (1.0 + t_0) else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) t_0 = Float64(k * Float64(k + 10.0)) tmp = 0.0 if (m <= -0.33) tmp = Float64(a / t_0); elseif (m <= 0.95) tmp = Float64(a / Float64(1.0 + t_0)); else tmp = Float64(-10.0 * Float64(a * k)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = k * (k + 10.0); tmp = 0.0; if (m <= -0.33) tmp = a / t_0; elseif (m <= 0.95) tmp = a / (1.0 + t_0); else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -0.33], N[(a / t$95$0), $MachinePrecision], If[LessEqual[m, 0.95], N[(a / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := k \cdot \left(k + 10\right)\\
\mathbf{if}\;m \leq -0.33:\\
\;\;\;\;\frac{a}{t_0}\\
\mathbf{elif}\;m \leq 0.95:\\
\;\;\;\;\frac{a}{1 + t_0}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m -3.2e-14) (* 0.1 (/ a k)) (if (<= m 0.245) a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.2e-14) {
tmp = 0.1 * (a / k);
} else if (m <= 0.245) {
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 <= (-3.2d-14)) then
tmp = 0.1d0 * (a / k)
else if (m <= 0.245d0) 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 <= -3.2e-14) {
tmp = 0.1 * (a / k);
} else if (m <= 0.245) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.2e-14: tmp = 0.1 * (a / k) elif m <= 0.245: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.2e-14) tmp = Float64(0.1 * Float64(a / k)); elseif (m <= 0.245) 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 <= -3.2e-14) tmp = 0.1 * (a / k); elseif (m <= 0.245) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.2e-14], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.245], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.2 \cdot 10^{-14}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{elif}\;m \leq 0.245:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m -1e-13) (/ 0.1 (/ k a)) (if (<= m 0.22) a (* -10.0 (* a k)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1e-13) {
tmp = 0.1 / (k / a);
} else if (m <= 0.22) {
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 <= (-1d-13)) then
tmp = 0.1d0 / (k / a)
else if (m <= 0.22d0) 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 <= -1e-13) {
tmp = 0.1 / (k / a);
} else if (m <= 0.22) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1e-13: tmp = 0.1 / (k / a) elif m <= 0.22: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1e-13) tmp = Float64(0.1 / Float64(k / a)); elseif (m <= 0.22) 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 <= -1e-13) tmp = 0.1 / (k / a); elseif (m <= 0.22) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1e-13], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.22], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1 \cdot 10^{-13}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{elif}\;m \leq 0.22:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m 0.4) a (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.4) {
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.4d0) 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.4) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.4: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.4) 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.4) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.4], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.4:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
(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}
herbie shell --seed 2023343
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))