
(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))))
(if (<= (/ t_0 (+ (* k k) (+ 1.0 (* k 10.0)))) 5e+96)
(/ a (/ (+ 1.0 (* k (+ 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 ((t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 5e+96) {
tmp = a / ((1.0 + (k * (k + 10.0))) / pow(k, m));
} 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 / ((k * k) + (1.0d0 + (k * 10.0d0)))) <= 5d+96) then
tmp = a / ((1.0d0 + (k * (k + 10.0d0))) / (k ** m))
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 / ((k * k) + (1.0 + (k * 10.0)))) <= 5e+96) {
tmp = a / ((1.0 + (k * (k + 10.0))) / Math.pow(k, m));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if (t_0 / ((k * k) + (1.0 + (k * 10.0)))) <= 5e+96: tmp = a / ((1.0 + (k * (k + 10.0))) / math.pow(k, m)) 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(k * k) + Float64(1.0 + Float64(k * 10.0)))) <= 5e+96) tmp = Float64(a / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / (k ^ m))); 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 / ((k * k) + (1.0 + (k * 10.0)))) <= 5e+96) tmp = a / ((1.0 + (k * (k + 10.0))) / (k ^ m)); 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[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+96], N[(a / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t_0}{k \cdot k + \left(1 + k \cdot 10\right)} \leq 5 \cdot 10^{+96}:\\
\;\;\;\;\frac{a}{\frac{1 + k \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 2.05e-78) (/ 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.05e-78) {
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.05d-78) 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.05e-78) {
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.05e-78: 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.05e-78) 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.05e-78) 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.05e-78], 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.05 \cdot 10^{-78}:\\
\;\;\;\;\frac{t_0}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (or (<= m -4e-12) (not (<= m 2.05e-78))) (* a (pow k m)) (/ a (+ (* k k) (+ 1.0 (* k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -4e-12) || !(m <= 2.05e-78)) {
tmp = a * pow(k, m);
} else {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-4d-12)) .or. (.not. (m <= 2.05d-78))) then
tmp = a * (k ** m)
else
tmp = a / ((k * k) + (1.0d0 + (k * 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -4e-12) || !(m <= 2.05e-78)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -4e-12) or not (m <= 2.05e-78): tmp = a * math.pow(k, m) else: tmp = a / ((k * k) + (1.0 + (k * 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -4e-12) || !(m <= 2.05e-78)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -4e-12) || ~((m <= 2.05e-78))) tmp = a * (k ^ m); else tmp = a / ((k * k) + (1.0 + (k * 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -4e-12], N[Not[LessEqual[m, 2.05e-78]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4 \cdot 10^{-12} \lor \neg \left(m \leq 2.05 \cdot 10^{-78}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m -4e-12) (/ (pow k m) (/ 1.0 a)) (if (<= m 2.05e-78) (/ a (+ (* k k) (+ 1.0 (* k 10.0)))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4e-12) {
tmp = pow(k, m) / (1.0 / a);
} else if (m <= 2.05e-78) {
tmp = a / ((k * k) + (1.0 + (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 <= (-4d-12)) then
tmp = (k ** m) / (1.0d0 / a)
else if (m <= 2.05d-78) then
tmp = a / ((k * k) + (1.0d0 + (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 <= -4e-12) {
tmp = Math.pow(k, m) / (1.0 / a);
} else if (m <= 2.05e-78) {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4e-12: tmp = math.pow(k, m) / (1.0 / a) elif m <= 2.05e-78: tmp = a / ((k * k) + (1.0 + (k * 10.0))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4e-12) tmp = Float64((k ^ m) / Float64(1.0 / a)); elseif (m <= 2.05e-78) tmp = Float64(a / Float64(Float64(k * k) + Float64(1.0 + 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 <= -4e-12) tmp = (k ^ m) / (1.0 / a); elseif (m <= 2.05e-78) tmp = a / ((k * k) + (1.0 + (k * 10.0))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4e-12], N[(N[Power[k, m], $MachinePrecision] / N[(1.0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.05e-78], N[(a / N[(N[(k * k), $MachinePrecision] + N[(1.0 + 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 -4 \cdot 10^{-12}:\\
\;\;\;\;\frac{{k}^{m}}{\frac{1}{a}}\\
\mathbf{elif}\;m \leq 2.05 \cdot 10^{-78}:\\
\;\;\;\;\frac{a}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k (+ k 10.0)))))
(if (<= k -3.6e+139)
t_0
(if (<= k -4e-310)
(* a (* k -10.0))
(if (<= k 0.075) (* 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 <= -3.6e+139) {
tmp = t_0;
} else if (k <= -4e-310) {
tmp = a * (k * -10.0);
} else if (k <= 0.075) {
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 <= (-3.6d+139)) then
tmp = t_0
else if (k <= (-4d-310)) then
tmp = a * (k * (-10.0d0))
else if (k <= 0.075d0) 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 <= -3.6e+139) {
tmp = t_0;
} else if (k <= -4e-310) {
tmp = a * (k * -10.0);
} else if (k <= 0.075) {
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 <= -3.6e+139: tmp = t_0 elif k <= -4e-310: tmp = a * (k * -10.0) elif k <= 0.075: 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 <= -3.6e+139) tmp = t_0; elseif (k <= -4e-310) tmp = Float64(a * Float64(k * -10.0)); elseif (k <= 0.075) 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 <= -3.6e+139) tmp = t_0; elseif (k <= -4e-310) tmp = a * (k * -10.0); elseif (k <= 0.075) 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, -3.6e+139], t$95$0, If[LessEqual[k, -4e-310], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.075], 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 -3.6 \cdot 10^{+139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq -4 \cdot 10^{-310}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\mathbf{elif}\;k \leq 0.075:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k (+ k 10.0)))))
(if (<= k -9e+138)
t_0
(if (<= k 2.9e-308)
(* a (* k -10.0))
(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 <= -9e+138) {
tmp = t_0;
} else if (k <= 2.9e-308) {
tmp = a * (k * -10.0);
} 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 <= (-9d+138)) then
tmp = t_0
else if (k <= 2.9d-308) then
tmp = a * (k * (-10.0d0))
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 <= -9e+138) {
tmp = t_0;
} else if (k <= 2.9e-308) {
tmp = a * (k * -10.0);
} 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 <= -9e+138: tmp = t_0 elif k <= 2.9e-308: tmp = a * (k * -10.0) 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 <= -9e+138) tmp = t_0; elseif (k <= 2.9e-308) tmp = Float64(a * Float64(k * -10.0)); 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 <= -9e+138) tmp = t_0; elseif (k <= 2.9e-308) tmp = a * (k * -10.0); 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, -9e+138], t$95$0, If[LessEqual[k, 2.9e-308], N[(a * N[(k * -10.0), $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 -9 \cdot 10^{+138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;k \leq 2.9 \cdot 10^{-308}:\\
\;\;\;\;a \cdot \left(k \cdot -10\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 (if (<= m 0.9) (/ a (+ (* k k) (+ 1.0 (* k 10.0)))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.9) {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = a * (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.9d0) then
tmp = a / ((k * k) + (1.0d0 + (k * 10.0d0)))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.9) {
tmp = a / ((k * k) + (1.0 + (k * 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.9: tmp = a / ((k * k) + (1.0 + (k * 10.0))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.9) tmp = Float64(a / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.9) tmp = a / ((k * k) + (1.0 + (k * 10.0))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.9], N[(a / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.9:\\
\;\;\;\;\frac{a}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m 0.75) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.75) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (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.75d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.75) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.75: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.75) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.75) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.75], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.75:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m 5.2e+14) a (* -10.0 (* a k))))
double code(double a, double k, double m) {
double tmp;
if (m <= 5.2e+14) {
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 <= 5.2d+14) 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 <= 5.2e+14) {
tmp = a;
} else {
tmp = -10.0 * (a * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 5.2e+14: tmp = a else: tmp = -10.0 * (a * k) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 5.2e+14) 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 <= 5.2e+14) tmp = a; else tmp = -10.0 * (a * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 5.2e+14], a, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 5.2 \cdot 10^{+14}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(a \cdot k\right)\\
\end{array}
\end{array}
(FPCore (a k m) :precision binary64 (if (<= m 1.2e+15) a (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.2e+15) {
tmp = a;
} else {
tmp = a * (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.2d+15) then
tmp = a
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.2e+15) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.2e+15: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.2e+15) tmp = a; else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.2e+15) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.2e+15], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\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 2023347
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))