
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))) (t_1 (cos (/ K 2.0))))
(if (<= t_0 -1.0)
(fma J (* t_0 t_1) U)
(if (<= t_0 5e-9)
(fma J (* (* 2.0 l) t_1) U)
(* J (* (cos (* 0.5 K)) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double t_1 = cos((K / 2.0));
double tmp;
if (t_0 <= -1.0) {
tmp = fma(J, (t_0 * t_1), U);
} else if (t_0 <= 5e-9) {
tmp = fma(J, ((2.0 * l) * t_1), U);
} else {
tmp = J * (cos((0.5 * K)) * t_0);
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) t_1 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -1.0) tmp = fma(J, Float64(t_0 * t_1), U); elseif (t_0 <= 5e-9) tmp = fma(J, Float64(Float64(2.0 * l) * t_1), U); else tmp = Float64(J * Float64(cos(Float64(0.5 * K)) * t_0)); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -1.0], N[(J * N[(t$95$0 * t$95$1), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[t$95$0, 5e-9], N[(J * N[(N[(2.0 * l), $MachinePrecision] * t$95$1), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
t_1 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -1:\\
\;\;\;\;\mathsf{fma}\left(J, t\_0 \cdot t\_1, U\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(J, \left(2 \cdot \ell\right) \cdot t\_1, U\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -1Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
if -1 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-9Initial program 72.5%
associate-*l*72.5%
fma-define72.5%
Simplified72.5%
Taylor expanded in l around 0 99.9%
if 5.0000000000000001e-9 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Taylor expanded in J around inf 100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))) (t_1 (* J (* (cos (* 0.5 K)) t_0))))
(if (<= t_0 (- INFINITY))
t_1
(if (<= t_0 5e-9)
(+
(*
(* l (+ (* 0.3333333333333333 (* J (pow l 2.0))) (* 2.0 J)))
(cos (/ K 2.0)))
U)
t_1))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double t_1 = J * (cos((0.5 * K)) * t_0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_0 <= 5e-9) {
tmp = ((l * ((0.3333333333333333 * (J * pow(l, 2.0))) + (2.0 * J))) * cos((K / 2.0))) + U;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = Math.exp(l) - Math.exp(-l);
double t_1 = J * (Math.cos((0.5 * K)) * t_0);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_0 <= 5e-9) {
tmp = ((l * ((0.3333333333333333 * (J * Math.pow(l, 2.0))) + (2.0 * J))) * Math.cos((K / 2.0))) + U;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) t_1 = J * (math.cos((0.5 * K)) * t_0) tmp = 0 if t_0 <= -math.inf: tmp = t_1 elif t_0 <= 5e-9: tmp = ((l * ((0.3333333333333333 * (J * math.pow(l, 2.0))) + (2.0 * J))) * math.cos((K / 2.0))) + U else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) t_1 = Float64(J * Float64(cos(Float64(0.5 * K)) * t_0)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = t_1; elseif (t_0 <= 5e-9) tmp = Float64(Float64(Float64(l * Float64(Float64(0.3333333333333333 * Float64(J * (l ^ 2.0))) + Float64(2.0 * J))) * cos(Float64(K / 2.0))) + U); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = exp(l) - exp(-l); t_1 = J * (cos((0.5 * K)) * t_0); tmp = 0.0; if (t_0 <= -Inf) tmp = t_1; elseif (t_0 <= 5e-9) tmp = ((l * ((0.3333333333333333 * (J * (l ^ 2.0))) + (2.0 * J))) * cos((K / 2.0))) + U; else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(J * N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], t$95$1, If[LessEqual[t$95$0, 5e-9], N[(N[(N[(l * N[(N[(0.3333333333333333 * N[(J * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
t_1 := J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot t\_0\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\left(\ell \cdot \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{2}\right) + 2 \cdot J\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 5.0000000000000001e-9 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Taylor expanded in J around inf 100.0%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-9Initial program 73.0%
Taylor expanded in l around 0 99.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (<= t_1 -1.0)
(+ (* (* J t_1) t_0) U)
(if (<= t_1 5e-9)
(fma J (* (* 2.0 l) t_0) U)
(* J (* (cos (* 0.5 K)) t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = exp(l) - exp(-l);
double tmp;
if (t_1 <= -1.0) {
tmp = ((J * t_1) * t_0) + U;
} else if (t_1 <= 5e-9) {
tmp = fma(J, ((2.0 * l) * t_0), U);
} else {
tmp = J * (cos((0.5 * K)) * t_1);
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if (t_1 <= -1.0) tmp = Float64(Float64(Float64(J * t_1) * t_0) + U); elseif (t_1 <= 5e-9) tmp = fma(J, Float64(Float64(2.0 * l) * t_0), U); else tmp = Float64(J * Float64(cos(Float64(0.5 * K)) * t_1)); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.0], N[(N[(N[(J * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[t$95$1, 5e-9], N[(J * N[(N[(2.0 * l), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_1 \leq -1:\\
\;\;\;\;\left(J \cdot t\_1\right) \cdot t\_0 + U\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(J, \left(2 \cdot \ell\right) \cdot t\_0, U\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot t\_1\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -1Initial program 100.0%
if -1 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-9Initial program 72.5%
associate-*l*72.5%
fma-define72.5%
Simplified72.5%
Taylor expanded in l around 0 99.9%
if 5.0000000000000001e-9 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Taylor expanded in J around inf 100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (- (exp l) (exp (- l))))) (t_1 (+ t_0 U)))
(if (<= t_0 (- INFINITY))
t_1
(if (<= t_0 1e+35) (fma J (* (* 2.0 l) (cos (/ K 2.0))) U) t_1))))
double code(double J, double l, double K, double U) {
double t_0 = J * (exp(l) - exp(-l));
double t_1 = t_0 + U;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_0 <= 1e+35) {
tmp = fma(J, ((2.0 * l) * cos((K / 2.0))), U);
} else {
tmp = t_1;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(J * Float64(exp(l) - exp(Float64(-l)))) t_1 = Float64(t_0 + U) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = t_1; elseif (t_0 <= 1e+35) tmp = fma(J, Float64(Float64(2.0 * l) * cos(Float64(K / 2.0))), U); else tmp = t_1; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + U), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], t$95$1, If[LessEqual[t$95$0, 1e+35], N[(J * N[(N[(2.0 * l), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(e^{\ell} - e^{-\ell}\right)\\
t_1 := t\_0 + U\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(J, \left(2 \cdot \ell\right) \cdot \cos \left(\frac{K}{2}\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) < -inf.0 or 9.9999999999999997e34 < (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) Initial program 100.0%
Taylor expanded in K around 0 81.9%
if -inf.0 < (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) < 9.9999999999999997e34Initial program 73.0%
associate-*l*73.0%
fma-define73.0%
Simplified73.0%
Taylor expanded in l around 0 99.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))) (t_1 (+ (* J t_0) U)))
(if (<= t_0 (- INFINITY))
t_1
(if (<= t_0 5e-9) (+ (* 2.0 (* J (* l (cos (* 0.5 K))))) U) t_1))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double t_1 = (J * t_0) + U;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_0 <= 5e-9) {
tmp = (2.0 * (J * (l * cos((0.5 * K))))) + U;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = Math.exp(l) - Math.exp(-l);
double t_1 = (J * t_0) + U;
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_0 <= 5e-9) {
tmp = (2.0 * (J * (l * Math.cos((0.5 * K))))) + U;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) t_1 = (J * t_0) + U tmp = 0 if t_0 <= -math.inf: tmp = t_1 elif t_0 <= 5e-9: tmp = (2.0 * (J * (l * math.cos((0.5 * K))))) + U else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) t_1 = Float64(Float64(J * t_0) + U) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = t_1; elseif (t_0 <= 5e-9) tmp = Float64(Float64(2.0 * Float64(J * Float64(l * cos(Float64(0.5 * K))))) + U); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = exp(l) - exp(-l); t_1 = (J * t_0) + U; tmp = 0.0; if (t_0 <= -Inf) tmp = t_1; elseif (t_0 <= 5e-9) tmp = (2.0 * (J * (l * cos((0.5 * K))))) + U; else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(J * t$95$0), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], t$95$1, If[LessEqual[t$95$0, 5e-9], N[(N[(2.0 * N[(J * N[(l * N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
t_1 := J \cdot t\_0 + U\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(0.5 \cdot K\right)\right)\right) + U\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 5.0000000000000001e-9 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Taylor expanded in K around 0 81.9%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-9Initial program 73.0%
Taylor expanded in l around 0 99.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ (* (* J (* 0.3333333333333333 (pow l 3.0))) t_0) U))
(t_2 (+ (* J (- (exp l) (exp (- l)))) U)))
(if (<= l -5.6e+111)
t_1
(if (<= l -1.46e+25)
t_2
(if (<= l 0.03)
(+
(* (* l (+ (* 0.3333333333333333 (* J (pow l 2.0))) (* 2.0 J))) t_0)
U)
(if (<= l 6e+92) t_2 t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = ((J * (0.3333333333333333 * pow(l, 3.0))) * t_0) + U;
double t_2 = (J * (exp(l) - exp(-l))) + U;
double tmp;
if (l <= -5.6e+111) {
tmp = t_1;
} else if (l <= -1.46e+25) {
tmp = t_2;
} else if (l <= 0.03) {
tmp = ((l * ((0.3333333333333333 * (J * pow(l, 2.0))) + (2.0 * J))) * t_0) + U;
} else if (l <= 6e+92) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = ((j * (0.3333333333333333d0 * (l ** 3.0d0))) * t_0) + u
t_2 = (j * (exp(l) - exp(-l))) + u
if (l <= (-5.6d+111)) then
tmp = t_1
else if (l <= (-1.46d+25)) then
tmp = t_2
else if (l <= 0.03d0) then
tmp = ((l * ((0.3333333333333333d0 * (j * (l ** 2.0d0))) + (2.0d0 * j))) * t_0) + u
else if (l <= 6d+92) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = ((J * (0.3333333333333333 * Math.pow(l, 3.0))) * t_0) + U;
double t_2 = (J * (Math.exp(l) - Math.exp(-l))) + U;
double tmp;
if (l <= -5.6e+111) {
tmp = t_1;
} else if (l <= -1.46e+25) {
tmp = t_2;
} else if (l <= 0.03) {
tmp = ((l * ((0.3333333333333333 * (J * Math.pow(l, 2.0))) + (2.0 * J))) * t_0) + U;
} else if (l <= 6e+92) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = ((J * (0.3333333333333333 * math.pow(l, 3.0))) * t_0) + U t_2 = (J * (math.exp(l) - math.exp(-l))) + U tmp = 0 if l <= -5.6e+111: tmp = t_1 elif l <= -1.46e+25: tmp = t_2 elif l <= 0.03: tmp = ((l * ((0.3333333333333333 * (J * math.pow(l, 2.0))) + (2.0 * J))) * t_0) + U elif l <= 6e+92: tmp = t_2 else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(Float64(Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))) * t_0) + U) t_2 = Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) + U) tmp = 0.0 if (l <= -5.6e+111) tmp = t_1; elseif (l <= -1.46e+25) tmp = t_2; elseif (l <= 0.03) tmp = Float64(Float64(Float64(l * Float64(Float64(0.3333333333333333 * Float64(J * (l ^ 2.0))) + Float64(2.0 * J))) * t_0) + U); elseif (l <= 6e+92) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = ((J * (0.3333333333333333 * (l ^ 3.0))) * t_0) + U; t_2 = (J * (exp(l) - exp(-l))) + U; tmp = 0.0; if (l <= -5.6e+111) tmp = t_1; elseif (l <= -1.46e+25) tmp = t_2; elseif (l <= 0.03) tmp = ((l * ((0.3333333333333333 * (J * (l ^ 2.0))) + (2.0 * J))) * t_0) + U; elseif (l <= 6e+92) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$2 = N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -5.6e+111], t$95$1, If[LessEqual[l, -1.46e+25], t$95$2, If[LessEqual[l, 0.03], N[(N[(N[(l * N[(N[(0.3333333333333333 * N[(J * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 6e+92], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\right) \cdot t\_0 + U\\
t_2 := J \cdot \left(e^{\ell} - e^{-\ell}\right) + U\\
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -1.46 \cdot 10^{+25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\ell \leq 0.03:\\
\;\;\;\;\left(\ell \cdot \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{2}\right) + 2 \cdot J\right)\right) \cdot t\_0 + U\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if l < -5.5999999999999999e111 or 6.00000000000000026e92 < l Initial program 100.0%
Taylor expanded in l around 0 99.0%
Taylor expanded in l around inf 99.0%
if -5.5999999999999999e111 < l < -1.45999999999999996e25 or 0.029999999999999999 < l < 6.00000000000000026e92Initial program 100.0%
Taylor expanded in K around 0 92.9%
if -1.45999999999999996e25 < l < 0.029999999999999999Initial program 73.5%
Taylor expanded in l around 0 98.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ (* (* J (* 0.3333333333333333 (pow l 3.0))) t_0) U))
(t_2 (+ (* J (- (exp l) (exp (- l)))) U)))
(if (<= l -5.6e+111)
t_1
(if (<= l -1950000000.0)
t_2
(if (<= l 0.00182)
(fma J (* (* 2.0 l) t_0) U)
(if (<= l 6e+92) t_2 t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = ((J * (0.3333333333333333 * pow(l, 3.0))) * t_0) + U;
double t_2 = (J * (exp(l) - exp(-l))) + U;
double tmp;
if (l <= -5.6e+111) {
tmp = t_1;
} else if (l <= -1950000000.0) {
tmp = t_2;
} else if (l <= 0.00182) {
tmp = fma(J, ((2.0 * l) * t_0), U);
} else if (l <= 6e+92) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(Float64(Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))) * t_0) + U) t_2 = Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) + U) tmp = 0.0 if (l <= -5.6e+111) tmp = t_1; elseif (l <= -1950000000.0) tmp = t_2; elseif (l <= 0.00182) tmp = fma(J, Float64(Float64(2.0 * l) * t_0), U); elseif (l <= 6e+92) tmp = t_2; else tmp = t_1; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$2 = N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -5.6e+111], t$95$1, If[LessEqual[l, -1950000000.0], t$95$2, If[LessEqual[l, 0.00182], N[(J * N[(N[(2.0 * l), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 6e+92], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\right) \cdot t\_0 + U\\
t_2 := J \cdot \left(e^{\ell} - e^{-\ell}\right) + U\\
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -1950000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\ell \leq 0.00182:\\
\;\;\;\;\mathsf{fma}\left(J, \left(2 \cdot \ell\right) \cdot t\_0, U\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if l < -5.5999999999999999e111 or 6.00000000000000026e92 < l Initial program 100.0%
Taylor expanded in l around 0 99.0%
Taylor expanded in l around inf 99.0%
if -5.5999999999999999e111 < l < -1.95e9 or 0.00182 < l < 6.00000000000000026e92Initial program 100.0%
Taylor expanded in K around 0 93.0%
if -1.95e9 < l < 0.00182Initial program 73.2%
associate-*l*73.2%
fma-define73.2%
Simplified73.2%
Taylor expanded in l around 0 98.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ (* (* J (* 0.3333333333333333 (pow l 3.0))) t_0) U))
(t_2 (+ (* J (- (exp l) (exp (- l)))) U)))
(if (<= l -5.6e+111)
t_1
(if (<= l -1.46e+25)
t_2
(if (<= l 0.12)
(+ (* (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))) t_0) U)
(if (<= l 6e+92) t_2 t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = ((J * (0.3333333333333333 * pow(l, 3.0))) * t_0) + U;
double t_2 = (J * (exp(l) - exp(-l))) + U;
double tmp;
if (l <= -5.6e+111) {
tmp = t_1;
} else if (l <= -1.46e+25) {
tmp = t_2;
} else if (l <= 0.12) {
tmp = ((J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0))))) * t_0) + U;
} else if (l <= 6e+92) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = ((j * (0.3333333333333333d0 * (l ** 3.0d0))) * t_0) + u
t_2 = (j * (exp(l) - exp(-l))) + u
if (l <= (-5.6d+111)) then
tmp = t_1
else if (l <= (-1.46d+25)) then
tmp = t_2
else if (l <= 0.12d0) then
tmp = ((j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0))))) * t_0) + u
else if (l <= 6d+92) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = ((J * (0.3333333333333333 * Math.pow(l, 3.0))) * t_0) + U;
double t_2 = (J * (Math.exp(l) - Math.exp(-l))) + U;
double tmp;
if (l <= -5.6e+111) {
tmp = t_1;
} else if (l <= -1.46e+25) {
tmp = t_2;
} else if (l <= 0.12) {
tmp = ((J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))) * t_0) + U;
} else if (l <= 6e+92) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = ((J * (0.3333333333333333 * math.pow(l, 3.0))) * t_0) + U t_2 = (J * (math.exp(l) - math.exp(-l))) + U tmp = 0 if l <= -5.6e+111: tmp = t_1 elif l <= -1.46e+25: tmp = t_2 elif l <= 0.12: tmp = ((J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) * t_0) + U elif l <= 6e+92: tmp = t_2 else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(Float64(Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))) * t_0) + U) t_2 = Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) + U) tmp = 0.0 if (l <= -5.6e+111) tmp = t_1; elseif (l <= -1.46e+25) tmp = t_2; elseif (l <= 0.12) tmp = Float64(Float64(Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))) * t_0) + U); elseif (l <= 6e+92) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = ((J * (0.3333333333333333 * (l ^ 3.0))) * t_0) + U; t_2 = (J * (exp(l) - exp(-l))) + U; tmp = 0.0; if (l <= -5.6e+111) tmp = t_1; elseif (l <= -1.46e+25) tmp = t_2; elseif (l <= 0.12) tmp = ((J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0))))) * t_0) + U; elseif (l <= 6e+92) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$2 = N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -5.6e+111], t$95$1, If[LessEqual[l, -1.46e+25], t$95$2, If[LessEqual[l, 0.12], N[(N[(N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 6e+92], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\right) \cdot t\_0 + U\\
t_2 := J \cdot \left(e^{\ell} - e^{-\ell}\right) + U\\
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -1.46 \cdot 10^{+25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\ell \leq 0.12:\\
\;\;\;\;\left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)\right) \cdot t\_0 + U\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if l < -5.5999999999999999e111 or 6.00000000000000026e92 < l Initial program 100.0%
Taylor expanded in l around 0 99.0%
Taylor expanded in l around inf 99.0%
if -5.5999999999999999e111 < l < -1.45999999999999996e25 or 0.12 < l < 6.00000000000000026e92Initial program 100.0%
Taylor expanded in K around 0 92.9%
if -1.45999999999999996e25 < l < 0.12Initial program 73.5%
Taylor expanded in l around 0 98.5%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.04) (* U (+ 1.0 (* 2.0 (/ (* J (* l (cos (* 0.5 K)))) U)))) (+ (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.04) {
tmp = U * (1.0 + (2.0 * ((J * (l * cos((0.5 * K)))) / U)));
} else {
tmp = (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0))))) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= 0.04d0) then
tmp = u * (1.0d0 + (2.0d0 * ((j * (l * cos((0.5d0 * k)))) / u)))
else
tmp = (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0))))) + u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= 0.04) {
tmp = U * (1.0 + (2.0 * ((J * (l * Math.cos((0.5 * K)))) / U)));
} else {
tmp = (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))) + U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= 0.04: tmp = U * (1.0 + (2.0 * ((J * (l * math.cos((0.5 * K)))) / U))) else: tmp = (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) + U return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.04) tmp = Float64(U * Float64(1.0 + Float64(2.0 * Float64(Float64(J * Float64(l * cos(Float64(0.5 * K)))) / U)))); else tmp = Float64(Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))) + U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= 0.04) tmp = U * (1.0 + (2.0 * ((J * (l * cos((0.5 * K)))) / U))); else tmp = (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0))))) + U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.04], N[(U * N[(1.0 + N[(2.0 * N[(N[(J * N[(l * N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.04:\\
\;\;\;\;U \cdot \left(1 + 2 \cdot \frac{J \cdot \left(\ell \cdot \cos \left(0.5 \cdot K\right)\right)}{U}\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right) + U\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.0400000000000000008Initial program 85.7%
Taylor expanded in l around 0 66.5%
Taylor expanded in U around inf 70.0%
if 0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 88.1%
Taylor expanded in l around 0 88.2%
Taylor expanded in K around 0 84.3%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.04) (+ (* 2.0 (* J (* l (cos (* 0.5 K))))) U) (+ (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.04) {
tmp = (2.0 * (J * (l * cos((0.5 * K))))) + U;
} else {
tmp = (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0))))) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= 0.04d0) then
tmp = (2.0d0 * (j * (l * cos((0.5d0 * k))))) + u
else
tmp = (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0))))) + u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= 0.04) {
tmp = (2.0 * (J * (l * Math.cos((0.5 * K))))) + U;
} else {
tmp = (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))) + U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= 0.04: tmp = (2.0 * (J * (l * math.cos((0.5 * K))))) + U else: tmp = (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) + U return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.04) tmp = Float64(Float64(2.0 * Float64(J * Float64(l * cos(Float64(0.5 * K))))) + U); else tmp = Float64(Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))) + U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= 0.04) tmp = (2.0 * (J * (l * cos((0.5 * K))))) + U; else tmp = (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0))))) + U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.04], N[(N[(2.0 * N[(J * N[(l * N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.04:\\
\;\;\;\;2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(0.5 \cdot K\right)\right)\right) + U\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right) + U\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.0400000000000000008Initial program 85.7%
Taylor expanded in l around 0 66.5%
if 0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 88.1%
Taylor expanded in l around 0 88.2%
Taylor expanded in K around 0 84.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))) U)))
(if (<= l -3.9e+129)
t_0
(if (<= l -560.0)
(log1p (expm1 (- (/ -4.0 U) U)))
(if (<= l 1.5e-31) (+ (* 2.0 (* J (* l (cos (* 0.5 K))))) U) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0))))) + U;
double tmp;
if (l <= -3.9e+129) {
tmp = t_0;
} else if (l <= -560.0) {
tmp = log1p(expm1(((-4.0 / U) - U)));
} else if (l <= 1.5e-31) {
tmp = (2.0 * (J * (l * cos((0.5 * K))))) + U;
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))) + U;
double tmp;
if (l <= -3.9e+129) {
tmp = t_0;
} else if (l <= -560.0) {
tmp = Math.log1p(Math.expm1(((-4.0 / U) - U)));
} else if (l <= 1.5e-31) {
tmp = (2.0 * (J * (l * Math.cos((0.5 * K))))) + U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) + U tmp = 0 if l <= -3.9e+129: tmp = t_0 elif l <= -560.0: tmp = math.log1p(math.expm1(((-4.0 / U) - U))) elif l <= 1.5e-31: tmp = (2.0 * (J * (l * math.cos((0.5 * K))))) + U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))) + U) tmp = 0.0 if (l <= -3.9e+129) tmp = t_0; elseif (l <= -560.0) tmp = log1p(expm1(Float64(Float64(-4.0 / U) - U))); elseif (l <= 1.5e-31) tmp = Float64(Float64(2.0 * Float64(J * Float64(l * cos(Float64(0.5 * K))))) + U); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -3.9e+129], t$95$0, If[LessEqual[l, -560.0], N[Log[1 + N[(Exp[N[(N[(-4.0 / U), $MachinePrecision] - U), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.5e-31], N[(N[(2.0 * N[(J * N[(l * N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right) + U\\
\mathbf{if}\;\ell \leq -3.9 \cdot 10^{+129}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -560:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{-4}{U} - U\right)\right)\\
\mathbf{elif}\;\ell \leq 1.5 \cdot 10^{-31}:\\
\;\;\;\;2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(0.5 \cdot K\right)\right)\right) + U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -3.8999999999999997e129 or 1.49999999999999991e-31 < l Initial program 96.9%
Taylor expanded in l around 0 88.5%
Taylor expanded in K around 0 75.5%
if -3.8999999999999997e129 < l < -560Initial program 100.0%
Applied egg-rr3.1%
log1p-expm1-u65.5%
Applied egg-rr65.5%
if -560 < l < 1.49999999999999991e-31Initial program 74.5%
Taylor expanded in l around 0 99.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* 2.0 (* J (* l (cos (* 0.5 K)))))))
(if (<= l -1.5e+54)
t_0
(if (<= l 3.9e+30)
(+ (* 2.0 (* J l)) U)
(if (<= l 3.2e+132)
(pow U -3.0)
(if (<= l 4.4e+269) t_0 (pow U -4.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (J * (l * cos((0.5 * K))));
double tmp;
if (l <= -1.5e+54) {
tmp = t_0;
} else if (l <= 3.9e+30) {
tmp = (2.0 * (J * l)) + U;
} else if (l <= 3.2e+132) {
tmp = pow(U, -3.0);
} else if (l <= 4.4e+269) {
tmp = t_0;
} else {
tmp = pow(U, -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 * (j * (l * cos((0.5d0 * k))))
if (l <= (-1.5d+54)) then
tmp = t_0
else if (l <= 3.9d+30) then
tmp = (2.0d0 * (j * l)) + u
else if (l <= 3.2d+132) then
tmp = u ** (-3.0d0)
else if (l <= 4.4d+269) then
tmp = t_0
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (J * (l * Math.cos((0.5 * K))));
double tmp;
if (l <= -1.5e+54) {
tmp = t_0;
} else if (l <= 3.9e+30) {
tmp = (2.0 * (J * l)) + U;
} else if (l <= 3.2e+132) {
tmp = Math.pow(U, -3.0);
} else if (l <= 4.4e+269) {
tmp = t_0;
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): t_0 = 2.0 * (J * (l * math.cos((0.5 * K)))) tmp = 0 if l <= -1.5e+54: tmp = t_0 elif l <= 3.9e+30: tmp = (2.0 * (J * l)) + U elif l <= 3.2e+132: tmp = math.pow(U, -3.0) elif l <= 4.4e+269: tmp = t_0 else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) t_0 = Float64(2.0 * Float64(J * Float64(l * cos(Float64(0.5 * K))))) tmp = 0.0 if (l <= -1.5e+54) tmp = t_0; elseif (l <= 3.9e+30) tmp = Float64(Float64(2.0 * Float64(J * l)) + U); elseif (l <= 3.2e+132) tmp = U ^ -3.0; elseif (l <= 4.4e+269) tmp = t_0; else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 2.0 * (J * (l * cos((0.5 * K)))); tmp = 0.0; if (l <= -1.5e+54) tmp = t_0; elseif (l <= 3.9e+30) tmp = (2.0 * (J * l)) + U; elseif (l <= 3.2e+132) tmp = U ^ -3.0; elseif (l <= 4.4e+269) tmp = t_0; else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[(J * N[(l * N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.5e+54], t$95$0, If[LessEqual[l, 3.9e+30], N[(N[(2.0 * N[(J * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 3.2e+132], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 4.4e+269], t$95$0, N[Power[U, -4.0], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(0.5 \cdot K\right)\right)\right)\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{+54}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 3.9 \cdot 10^{+30}:\\
\;\;\;\;2 \cdot \left(J \cdot \ell\right) + U\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+132}:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 4.4 \cdot 10^{+269}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < -1.4999999999999999e54 or 3.1999999999999997e132 < l < 4.3999999999999997e269Initial program 100.0%
Taylor expanded in l around 0 38.5%
Taylor expanded in J around inf 38.5%
if -1.4999999999999999e54 < l < 3.90000000000000011e30Initial program 76.0%
Taylor expanded in l around 0 88.5%
Taylor expanded in K around 0 76.6%
if 3.90000000000000011e30 < l < 3.1999999999999997e132Initial program 100.0%
Applied egg-rr39.4%
if 4.3999999999999997e269 < l Initial program 100.0%
Applied egg-rr60.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* 2.0 (* J (* l (cos (* 0.5 K)))))))
(if (<= l 2.45e+30)
(+ t_0 U)
(if (<= l 1.75e+130) (pow U -3.0) (if (<= l 1e+269) t_0 (pow U -4.0))))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (J * (l * cos((0.5 * K))));
double tmp;
if (l <= 2.45e+30) {
tmp = t_0 + U;
} else if (l <= 1.75e+130) {
tmp = pow(U, -3.0);
} else if (l <= 1e+269) {
tmp = t_0;
} else {
tmp = pow(U, -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 * (j * (l * cos((0.5d0 * k))))
if (l <= 2.45d+30) then
tmp = t_0 + u
else if (l <= 1.75d+130) then
tmp = u ** (-3.0d0)
else if (l <= 1d+269) then
tmp = t_0
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (J * (l * Math.cos((0.5 * K))));
double tmp;
if (l <= 2.45e+30) {
tmp = t_0 + U;
} else if (l <= 1.75e+130) {
tmp = Math.pow(U, -3.0);
} else if (l <= 1e+269) {
tmp = t_0;
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): t_0 = 2.0 * (J * (l * math.cos((0.5 * K)))) tmp = 0 if l <= 2.45e+30: tmp = t_0 + U elif l <= 1.75e+130: tmp = math.pow(U, -3.0) elif l <= 1e+269: tmp = t_0 else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) t_0 = Float64(2.0 * Float64(J * Float64(l * cos(Float64(0.5 * K))))) tmp = 0.0 if (l <= 2.45e+30) tmp = Float64(t_0 + U); elseif (l <= 1.75e+130) tmp = U ^ -3.0; elseif (l <= 1e+269) tmp = t_0; else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 2.0 * (J * (l * cos((0.5 * K)))); tmp = 0.0; if (l <= 2.45e+30) tmp = t_0 + U; elseif (l <= 1.75e+130) tmp = U ^ -3.0; elseif (l <= 1e+269) tmp = t_0; else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[(J * N[(l * N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 2.45e+30], N[(t$95$0 + U), $MachinePrecision], If[LessEqual[l, 1.75e+130], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 1e+269], t$95$0, N[Power[U, -4.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(0.5 \cdot K\right)\right)\right)\\
\mathbf{if}\;\ell \leq 2.45 \cdot 10^{+30}:\\
\;\;\;\;t\_0 + U\\
\mathbf{elif}\;\ell \leq 1.75 \cdot 10^{+130}:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 10^{+269}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < 2.44999999999999992e30Initial program 82.2%
Taylor expanded in l around 0 75.5%
if 2.44999999999999992e30 < l < 1.75e130Initial program 100.0%
Applied egg-rr39.4%
if 1.75e130 < l < 1e269Initial program 100.0%
Taylor expanded in l around 0 39.2%
Taylor expanded in J around inf 39.3%
if 1e269 < l Initial program 100.0%
Applied egg-rr60.5%
(FPCore (J l K U)
:precision binary64
(if (<= l 2.45e+30)
(+ (* 2.0 (* J l)) U)
(if (<= l 1.16e+127)
(pow U -4.0)
(if (<= l 2e+269) (* l (+ (* 2.0 J) (/ U l))) (pow U -4.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.45e+30) {
tmp = (2.0 * (J * l)) + U;
} else if (l <= 1.16e+127) {
tmp = pow(U, -4.0);
} else if (l <= 2e+269) {
tmp = l * ((2.0 * J) + (U / l));
} else {
tmp = pow(U, -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 2.45d+30) then
tmp = (2.0d0 * (j * l)) + u
else if (l <= 1.16d+127) then
tmp = u ** (-4.0d0)
else if (l <= 2d+269) then
tmp = l * ((2.0d0 * j) + (u / l))
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.45e+30) {
tmp = (2.0 * (J * l)) + U;
} else if (l <= 1.16e+127) {
tmp = Math.pow(U, -4.0);
} else if (l <= 2e+269) {
tmp = l * ((2.0 * J) + (U / l));
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 2.45e+30: tmp = (2.0 * (J * l)) + U elif l <= 1.16e+127: tmp = math.pow(U, -4.0) elif l <= 2e+269: tmp = l * ((2.0 * J) + (U / l)) else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 2.45e+30) tmp = Float64(Float64(2.0 * Float64(J * l)) + U); elseif (l <= 1.16e+127) tmp = U ^ -4.0; elseif (l <= 2e+269) tmp = Float64(l * Float64(Float64(2.0 * J) + Float64(U / l))); else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 2.45e+30) tmp = (2.0 * (J * l)) + U; elseif (l <= 1.16e+127) tmp = U ^ -4.0; elseif (l <= 2e+269) tmp = l * ((2.0 * J) + (U / l)); else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 2.45e+30], N[(N[(2.0 * N[(J * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 1.16e+127], N[Power[U, -4.0], $MachinePrecision], If[LessEqual[l, 2e+269], N[(l * N[(N[(2.0 * J), $MachinePrecision] + N[(U / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[U, -4.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.45 \cdot 10^{+30}:\\
\;\;\;\;2 \cdot \left(J \cdot \ell\right) + U\\
\mathbf{elif}\;\ell \leq 1.16 \cdot 10^{+127}:\\
\;\;\;\;{U}^{-4}\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+269}:\\
\;\;\;\;\ell \cdot \left(2 \cdot J + \frac{U}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < 2.44999999999999992e30Initial program 82.2%
Taylor expanded in l around 0 75.5%
Taylor expanded in K around 0 63.8%
if 2.44999999999999992e30 < l < 1.15999999999999994e127 or 2.0000000000000001e269 < l Initial program 100.0%
Applied egg-rr45.5%
if 1.15999999999999994e127 < l < 2.0000000000000001e269Initial program 100.0%
Taylor expanded in l around 0 38.3%
Taylor expanded in l around inf 38.3%
Taylor expanded in K around 0 34.9%
(FPCore (J l K U)
:precision binary64
(if (<= l 3.9e+30)
(+ (* 2.0 (* J l)) U)
(if (<= l 1.25e+134)
(pow U -3.0)
(if (<= l 4.4e+269) (* l (+ (* 2.0 J) (/ U l))) (pow U -4.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 3.9e+30) {
tmp = (2.0 * (J * l)) + U;
} else if (l <= 1.25e+134) {
tmp = pow(U, -3.0);
} else if (l <= 4.4e+269) {
tmp = l * ((2.0 * J) + (U / l));
} else {
tmp = pow(U, -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 3.9d+30) then
tmp = (2.0d0 * (j * l)) + u
else if (l <= 1.25d+134) then
tmp = u ** (-3.0d0)
else if (l <= 4.4d+269) then
tmp = l * ((2.0d0 * j) + (u / l))
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 3.9e+30) {
tmp = (2.0 * (J * l)) + U;
} else if (l <= 1.25e+134) {
tmp = Math.pow(U, -3.0);
} else if (l <= 4.4e+269) {
tmp = l * ((2.0 * J) + (U / l));
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 3.9e+30: tmp = (2.0 * (J * l)) + U elif l <= 1.25e+134: tmp = math.pow(U, -3.0) elif l <= 4.4e+269: tmp = l * ((2.0 * J) + (U / l)) else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 3.9e+30) tmp = Float64(Float64(2.0 * Float64(J * l)) + U); elseif (l <= 1.25e+134) tmp = U ^ -3.0; elseif (l <= 4.4e+269) tmp = Float64(l * Float64(Float64(2.0 * J) + Float64(U / l))); else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 3.9e+30) tmp = (2.0 * (J * l)) + U; elseif (l <= 1.25e+134) tmp = U ^ -3.0; elseif (l <= 4.4e+269) tmp = l * ((2.0 * J) + (U / l)); else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 3.9e+30], N[(N[(2.0 * N[(J * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 1.25e+134], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 4.4e+269], N[(l * N[(N[(2.0 * J), $MachinePrecision] + N[(U / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[U, -4.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.9 \cdot 10^{+30}:\\
\;\;\;\;2 \cdot \left(J \cdot \ell\right) + U\\
\mathbf{elif}\;\ell \leq 1.25 \cdot 10^{+134}:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 4.4 \cdot 10^{+269}:\\
\;\;\;\;\ell \cdot \left(2 \cdot J + \frac{U}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < 3.90000000000000011e30Initial program 82.2%
Taylor expanded in l around 0 75.5%
Taylor expanded in K around 0 63.8%
if 3.90000000000000011e30 < l < 1.24999999999999995e134Initial program 100.0%
Applied egg-rr39.4%
if 1.24999999999999995e134 < l < 4.3999999999999997e269Initial program 100.0%
Taylor expanded in l around 0 39.2%
Taylor expanded in l around inf 39.2%
Taylor expanded in K around 0 35.8%
if 4.3999999999999997e269 < l Initial program 100.0%
Applied egg-rr60.5%
(FPCore (J l K U) :precision binary64 (if (<= l -9.2e+48) (* U U) (if (<= l 1.7e-9) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -9.2e+48) {
tmp = U * U;
} else if (l <= 1.7e-9) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-9.2d+48)) then
tmp = u * u
else if (l <= 1.7d-9) then
tmp = u
else
tmp = u * u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -9.2e+48) {
tmp = U * U;
} else if (l <= 1.7e-9) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -9.2e+48: tmp = U * U elif l <= 1.7e-9: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -9.2e+48) tmp = Float64(U * U); elseif (l <= 1.7e-9) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -9.2e+48) tmp = U * U; elseif (l <= 1.7e-9) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -9.2e+48], N[(U * U), $MachinePrecision], If[LessEqual[l, 1.7e-9], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9.2 \cdot 10^{+48}:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 1.7 \cdot 10^{-9}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -9.2000000000000001e48 or 1.6999999999999999e-9 < l Initial program 99.3%
Applied egg-rr13.7%
if -9.2000000000000001e48 < l < 1.6999999999999999e-9Initial program 75.2%
Taylor expanded in J around 0 67.1%
(FPCore (J l K U) :precision binary64 (if (<= l -950.0) (+ -4.0 (* (- U) U)) (if (<= l 1.7e-9) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -950.0) {
tmp = -4.0 + (-U * U);
} else if (l <= 1.7e-9) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-950.0d0)) then
tmp = (-4.0d0) + (-u * u)
else if (l <= 1.7d-9) then
tmp = u
else
tmp = u * u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -950.0) {
tmp = -4.0 + (-U * U);
} else if (l <= 1.7e-9) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -950.0: tmp = -4.0 + (-U * U) elif l <= 1.7e-9: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -950.0) tmp = Float64(-4.0 + Float64(Float64(-U) * U)); elseif (l <= 1.7e-9) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -950.0) tmp = -4.0 + (-U * U); elseif (l <= 1.7e-9) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -950.0], N[(-4.0 + N[((-U) * U), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.7e-9], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -950:\\
\;\;\;\;-4 + \left(-U\right) \cdot U\\
\mathbf{elif}\;\ell \leq 1.7 \cdot 10^{-9}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -950Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr17.4%
if -950 < l < 1.6999999999999999e-9Initial program 73.3%
Taylor expanded in J around 0 72.1%
if 1.6999999999999999e-9 < l Initial program 99.0%
Applied egg-rr13.3%
(FPCore (J l K U) :precision binary64 (+ (* 2.0 (* J l)) U))
double code(double J, double l, double K, double U) {
return (2.0 * (J * l)) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = (2.0d0 * (j * l)) + u
end function
public static double code(double J, double l, double K, double U) {
return (2.0 * (J * l)) + U;
}
def code(J, l, K, U): return (2.0 * (J * l)) + U
function code(J, l, K, U) return Float64(Float64(2.0 * Float64(J * l)) + U) end
function tmp = code(J, l, K, U) tmp = (2.0 * (J * l)) + U; end
code[J_, l_, K_, U_] := N[(N[(2.0 * N[(J * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(J \cdot \ell\right) + U
\end{array}
Initial program 87.6%
Taylor expanded in l around 0 60.6%
Taylor expanded in K around 0 51.4%
(FPCore (J l K U) :precision binary64 U)
double code(double J, double l, double K, double U) {
return U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u
end function
public static double code(double J, double l, double K, double U) {
return U;
}
def code(J, l, K, U): return U
function code(J, l, K, U) return U end
function tmp = code(J, l, K, U) tmp = U; end
code[J_, l_, K_, U_] := U
\begin{array}{l}
\\
U
\end{array}
Initial program 87.6%
Taylor expanded in J around 0 33.8%
herbie shell --seed 2024076 -o generate:simplify
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))