
(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 23 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 -0.1)
(fma t_0 (* J t_1) U)
(if (<= t_0 0.001)
(+
U
(*
t_1
(+
(* 2.0 (* l J))
(+
(* 0.3333333333333333 (* J (pow l 3.0)))
(* 0.016666666666666666 (* J (pow l 5.0)))))))
(+ U (* t_1 (* t_0 J)))))))
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 <= -0.1) {
tmp = fma(t_0, (J * t_1), U);
} else if (t_0 <= 0.001) {
tmp = U + (t_1 * ((2.0 * (l * J)) + ((0.3333333333333333 * (J * pow(l, 3.0))) + (0.016666666666666666 * (J * pow(l, 5.0))))));
} else {
tmp = U + (t_1 * (t_0 * J));
}
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 <= -0.1) tmp = fma(t_0, Float64(J * t_1), U); elseif (t_0 <= 0.001) tmp = Float64(U + Float64(t_1 * Float64(Float64(2.0 * Float64(l * J)) + Float64(Float64(0.3333333333333333 * Float64(J * (l ^ 3.0))) + Float64(0.016666666666666666 * Float64(J * (l ^ 5.0))))))); else tmp = Float64(U + Float64(t_1 * Float64(t_0 * J))); 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, -0.1], N[(t$95$0 * N[(J * t$95$1), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[t$95$0, 0.001], N[(U + N[(t$95$1 * N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.016666666666666666 * N[(J * N[Power[l, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$1 * N[(t$95$0 * J), $MachinePrecision]), $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 -0.1:\\
\;\;\;\;\mathsf{fma}\left(t_0, J \cdot t_1, U\right)\\
\mathbf{elif}\;t_0 \leq 0.001:\\
\;\;\;\;U + t_1 \cdot \left(2 \cdot \left(\ell \cdot J\right) + \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right) + 0.016666666666666666 \cdot \left(J \cdot {\ell}^{5}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t_1 \cdot \left(t_0 \cdot J\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -0.10000000000000001Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
fma-def99.9%
Simplified99.9%
if -0.10000000000000001 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 1e-3Initial program 71.9%
Taylor expanded in l around 0 99.9%
Taylor expanded in l around 0 99.9%
if 1e-3 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Final simplification99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (<= t_0 0.001)
(+
(*
J
(*
(cos (* 0.5 K))
(fma
0.3333333333333333
(pow l 3.0)
(fma
0.0003968253968253968
(pow l 7.0)
(fma 0.016666666666666666 (pow l 5.0) (* l 2.0))))))
U)
(+ U (* (cos (/ K 2.0)) (* t_0 J))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if (t_0 <= 0.001) {
tmp = (J * (cos((0.5 * K)) * fma(0.3333333333333333, pow(l, 3.0), fma(0.0003968253968253968, pow(l, 7.0), fma(0.016666666666666666, pow(l, 5.0), (l * 2.0)))))) + U;
} else {
tmp = U + (cos((K / 2.0)) * (t_0 * J));
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if (t_0 <= 0.001) tmp = Float64(Float64(J * Float64(cos(Float64(0.5 * K)) * fma(0.3333333333333333, (l ^ 3.0), fma(0.0003968253968253968, (l ^ 7.0), fma(0.016666666666666666, (l ^ 5.0), Float64(l * 2.0)))))) + U); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(t_0 * J))); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.001], N[(N[(J * N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision] + N[(0.0003968253968253968 * N[Power[l, 7.0], $MachinePrecision] + N[(0.016666666666666666 * N[Power[l, 5.0], $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_0 \leq 0.001:\\
\;\;\;\;J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \mathsf{fma}\left(0.3333333333333333, {\ell}^{3}, \mathsf{fma}\left(0.0003968253968253968, {\ell}^{7}, \mathsf{fma}\left(0.016666666666666666, {\ell}^{5}, \ell \cdot 2\right)\right)\right)\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(t_0 \cdot J\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 1e-3Initial program 79.4%
Taylor expanded in l around 0 97.9%
Taylor expanded in J around 0 97.9%
*-commutative97.9%
*-commutative97.9%
fma-def97.9%
+-commutative97.9%
*-commutative97.9%
fma-udef97.9%
fma-udef97.9%
associate-*r*97.9%
Simplified97.9%
if 1e-3 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Final simplification98.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 -0.1) (not (<= t_1 0.001)))
(+ U (* t_0 (* t_1 J)))
(+
U
(*
t_0
(+
(* 2.0 (* l J))
(+
(* 0.3333333333333333 (* J (pow l 3.0)))
(* 0.016666666666666666 (* J (pow l 5.0))))))))))
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 <= -0.1) || !(t_1 <= 0.001)) {
tmp = U + (t_0 * (t_1 * J));
} else {
tmp = U + (t_0 * ((2.0 * (l * J)) + ((0.3333333333333333 * (J * pow(l, 3.0))) + (0.016666666666666666 * (J * pow(l, 5.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) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(l) - exp(-l)
if ((t_1 <= (-0.1d0)) .or. (.not. (t_1 <= 0.001d0))) then
tmp = u + (t_0 * (t_1 * j))
else
tmp = u + (t_0 * ((2.0d0 * (l * j)) + ((0.3333333333333333d0 * (j * (l ** 3.0d0))) + (0.016666666666666666d0 * (j * (l ** 5.0d0))))))
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 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_1 <= -0.1) || !(t_1 <= 0.001)) {
tmp = U + (t_0 * (t_1 * J));
} else {
tmp = U + (t_0 * ((2.0 * (l * J)) + ((0.3333333333333333 * (J * Math.pow(l, 3.0))) + (0.016666666666666666 * (J * Math.pow(l, 5.0))))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = math.exp(l) - math.exp(-l) tmp = 0 if (t_1 <= -0.1) or not (t_1 <= 0.001): tmp = U + (t_0 * (t_1 * J)) else: tmp = U + (t_0 * ((2.0 * (l * J)) + ((0.3333333333333333 * (J * math.pow(l, 3.0))) + (0.016666666666666666 * (J * math.pow(l, 5.0)))))) 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 <= -0.1) || !(t_1 <= 0.001)) tmp = Float64(U + Float64(t_0 * Float64(t_1 * J))); else tmp = Float64(U + Float64(t_0 * Float64(Float64(2.0 * Float64(l * J)) + Float64(Float64(0.3333333333333333 * Float64(J * (l ^ 3.0))) + Float64(0.016666666666666666 * Float64(J * (l ^ 5.0))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(l) - exp(-l); tmp = 0.0; if ((t_1 <= -0.1) || ~((t_1 <= 0.001))) tmp = U + (t_0 * (t_1 * J)); else tmp = U + (t_0 * ((2.0 * (l * J)) + ((0.3333333333333333 * (J * (l ^ 3.0))) + (0.016666666666666666 * (J * (l ^ 5.0)))))); 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[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -0.1], N[Not[LessEqual[t$95$1, 0.001]], $MachinePrecision]], N[(U + N[(t$95$0 * N[(t$95$1 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$0 * N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.016666666666666666 * N[(J * N[Power[l, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -0.1 \lor \neg \left(t_1 \leq 0.001\right):\\
\;\;\;\;U + t_0 \cdot \left(t_1 \cdot J\right)\\
\mathbf{else}:\\
\;\;\;\;U + t_0 \cdot \left(2 \cdot \left(\ell \cdot J\right) + \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right) + 0.016666666666666666 \cdot \left(J \cdot {\ell}^{5}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -0.10000000000000001 or 1e-3 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -0.10000000000000001 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 1e-3Initial program 71.9%
Taylor expanded in l around 0 99.9%
Taylor expanded in l around 0 99.9%
Final simplification99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (or (<= t_0 -0.1) (not (<= t_0 0.001)))
(+ U (* (cos (/ K 2.0)) (* t_0 J)))
(+
U
(*
(cos (* 0.5 K))
(+ (* 2.0 (* l J)) (* (pow l 3.0) (* J 0.3333333333333333))))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -0.1) || !(t_0 <= 0.001)) {
tmp = U + (cos((K / 2.0)) * (t_0 * J));
} else {
tmp = U + (cos((0.5 * K)) * ((2.0 * (l * J)) + (pow(l, 3.0) * (J * 0.3333333333333333))));
}
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 = exp(l) - exp(-l)
if ((t_0 <= (-0.1d0)) .or. (.not. (t_0 <= 0.001d0))) then
tmp = u + (cos((k / 2.0d0)) * (t_0 * j))
else
tmp = u + (cos((0.5d0 * k)) * ((2.0d0 * (l * j)) + ((l ** 3.0d0) * (j * 0.3333333333333333d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_0 <= -0.1) || !(t_0 <= 0.001)) {
tmp = U + (Math.cos((K / 2.0)) * (t_0 * J));
} else {
tmp = U + (Math.cos((0.5 * K)) * ((2.0 * (l * J)) + (Math.pow(l, 3.0) * (J * 0.3333333333333333))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) tmp = 0 if (t_0 <= -0.1) or not (t_0 <= 0.001): tmp = U + (math.cos((K / 2.0)) * (t_0 * J)) else: tmp = U + (math.cos((0.5 * K)) * ((2.0 * (l * J)) + (math.pow(l, 3.0) * (J * 0.3333333333333333)))) return tmp
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= -0.1) || !(t_0 <= 0.001)) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(t_0 * J))); else tmp = Float64(U + Float64(cos(Float64(0.5 * K)) * Float64(Float64(2.0 * Float64(l * J)) + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = exp(l) - exp(-l); tmp = 0.0; if ((t_0 <= -0.1) || ~((t_0 <= 0.001))) tmp = U + (cos((K / 2.0)) * (t_0 * J)); else tmp = U + (cos((0.5 * K)) * ((2.0 * (l * J)) + ((l ^ 3.0) * (J * 0.3333333333333333)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -0.1], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_0 \leq -0.1 \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(t_0 \cdot J\right)\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(0.5 \cdot K\right) \cdot \left(2 \cdot \left(\ell \cdot J\right) + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -0.10000000000000001 or 1e-3 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -0.10000000000000001 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 1e-3Initial program 71.9%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-lft-out99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))) (t_1 (cos (/ K 2.0))))
(if (<= t_0 0.001)
(+
U
(*
t_1
(*
J
(+
(* 0.3333333333333333 (pow l 3.0))
(+
(* 0.0003968253968253968 (pow l 7.0))
(+ (* 0.016666666666666666 (pow l 5.0)) (* l 2.0)))))))
(+ U (* t_1 (* t_0 J))))))
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 <= 0.001) {
tmp = U + (t_1 * (J * ((0.3333333333333333 * pow(l, 3.0)) + ((0.0003968253968253968 * pow(l, 7.0)) + ((0.016666666666666666 * pow(l, 5.0)) + (l * 2.0))))));
} else {
tmp = U + (t_1 * (t_0 * J));
}
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) :: tmp
t_0 = exp(l) - exp(-l)
t_1 = cos((k / 2.0d0))
if (t_0 <= 0.001d0) then
tmp = u + (t_1 * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + ((0.0003968253968253968d0 * (l ** 7.0d0)) + ((0.016666666666666666d0 * (l ** 5.0d0)) + (l * 2.0d0))))))
else
tmp = u + (t_1 * (t_0 * j))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.exp(l) - Math.exp(-l);
double t_1 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= 0.001) {
tmp = U + (t_1 * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + ((0.0003968253968253968 * Math.pow(l, 7.0)) + ((0.016666666666666666 * Math.pow(l, 5.0)) + (l * 2.0))))));
} else {
tmp = U + (t_1 * (t_0 * J));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) t_1 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.001: tmp = U + (t_1 * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + ((0.0003968253968253968 * math.pow(l, 7.0)) + ((0.016666666666666666 * math.pow(l, 5.0)) + (l * 2.0)))))) else: tmp = U + (t_1 * (t_0 * J)) 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 <= 0.001) tmp = Float64(U + Float64(t_1 * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(Float64(0.0003968253968253968 * (l ^ 7.0)) + Float64(Float64(0.016666666666666666 * (l ^ 5.0)) + Float64(l * 2.0))))))); else tmp = Float64(U + Float64(t_1 * Float64(t_0 * J))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = exp(l) - exp(-l); t_1 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= 0.001) tmp = U + (t_1 * (J * ((0.3333333333333333 * (l ^ 3.0)) + ((0.0003968253968253968 * (l ^ 7.0)) + ((0.016666666666666666 * (l ^ 5.0)) + (l * 2.0)))))); else tmp = U + (t_1 * (t_0 * J)); 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[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.001], N[(U + N[(t$95$1 * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.0003968253968253968 * N[Power[l, 7.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.016666666666666666 * N[Power[l, 5.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$1 * N[(t$95$0 * J), $MachinePrecision]), $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 0.001:\\
\;\;\;\;U + t_1 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \left(0.0003968253968253968 \cdot {\ell}^{7} + \left(0.016666666666666666 \cdot {\ell}^{5} + \ell \cdot 2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t_1 \cdot \left(t_0 \cdot J\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 1e-3Initial program 79.4%
Taylor expanded in l around 0 97.9%
if 1e-3 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Final simplification98.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (cos (/ K 2.0)) (* (pow l 7.0) (* J 0.0003968253968253968)))))
(t_1 (- (exp l) (exp (- l)))))
(if (<= l -3.2e+27)
t_0
(if (<= l -0.054)
(fma t_1 J U)
(if (<= l 0.00112)
(+
U
(*
(cos (* 0.5 K))
(+ (* 2.0 (* l J)) (* (pow l 3.0) (* J 0.3333333333333333)))))
(if (<= l 3.8e+43) (+ U (* t_1 J)) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (pow(l, 7.0) * (J * 0.0003968253968253968)));
double t_1 = exp(l) - exp(-l);
double tmp;
if (l <= -3.2e+27) {
tmp = t_0;
} else if (l <= -0.054) {
tmp = fma(t_1, J, U);
} else if (l <= 0.00112) {
tmp = U + (cos((0.5 * K)) * ((2.0 * (l * J)) + (pow(l, 3.0) * (J * 0.3333333333333333))));
} else if (l <= 3.8e+43) {
tmp = U + (t_1 * J);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64((l ^ 7.0) * Float64(J * 0.0003968253968253968)))) t_1 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if (l <= -3.2e+27) tmp = t_0; elseif (l <= -0.054) tmp = fma(t_1, J, U); elseif (l <= 0.00112) tmp = Float64(U + Float64(cos(Float64(0.5 * K)) * Float64(Float64(2.0 * Float64(l * J)) + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))))); elseif (l <= 3.8e+43) tmp = Float64(U + Float64(t_1 * J)); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[l, 7.0], $MachinePrecision] * N[(J * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.2e+27], t$95$0, If[LessEqual[l, -0.054], N[(t$95$1 * J + U), $MachinePrecision], If[LessEqual[l, 0.00112], N[(U + N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e+43], N[(U + N[(t$95$1 * J), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left({\ell}^{7} \cdot \left(J \cdot 0.0003968253968253968\right)\right)\\
t_1 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{+27}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -0.054:\\
\;\;\;\;\mathsf{fma}\left(t_1, J, U\right)\\
\mathbf{elif}\;\ell \leq 0.00112:\\
\;\;\;\;U + \cos \left(0.5 \cdot K\right) \cdot \left(2 \cdot \left(\ell \cdot J\right) + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{+43}:\\
\;\;\;\;U + t_1 \cdot J\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -3.20000000000000015e27 or 3.80000000000000008e43 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in l around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -3.20000000000000015e27 < l < -0.0539999999999999994Initial program 99.3%
Taylor expanded in K around 0 99.3%
fma-def99.3%
Simplified99.3%
if -0.0539999999999999994 < l < 0.0011199999999999999Initial program 71.9%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-lft-out99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
Simplified99.9%
if 0.0011199999999999999 < l < 3.80000000000000008e43Initial program 100.0%
Taylor expanded in K around 0 80.0%
Final simplification99.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (cos (/ K 2.0)) (* (pow l 7.0) (* J 0.0003968253968253968)))))
(t_1 (+ U (* (- (exp l) (exp (- l))) J))))
(if (<= l -3.2e+27)
t_0
(if (<= l -0.052)
t_1
(if (<= l 0.00112)
(+
U
(*
(cos (* 0.5 K))
(+ (* 2.0 (* l J)) (* (pow l 3.0) (* J 0.3333333333333333)))))
(if (<= l 6.4e+43) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (pow(l, 7.0) * (J * 0.0003968253968253968)));
double t_1 = U + ((exp(l) - exp(-l)) * J);
double tmp;
if (l <= -3.2e+27) {
tmp = t_0;
} else if (l <= -0.052) {
tmp = t_1;
} else if (l <= 0.00112) {
tmp = U + (cos((0.5 * K)) * ((2.0 * (l * J)) + (pow(l, 3.0) * (J * 0.3333333333333333))));
} else if (l <= 6.4e+43) {
tmp = t_1;
} else {
tmp = t_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) :: t_1
real(8) :: tmp
t_0 = u + (cos((k / 2.0d0)) * ((l ** 7.0d0) * (j * 0.0003968253968253968d0)))
t_1 = u + ((exp(l) - exp(-l)) * j)
if (l <= (-3.2d+27)) then
tmp = t_0
else if (l <= (-0.052d0)) then
tmp = t_1
else if (l <= 0.00112d0) then
tmp = u + (cos((0.5d0 * k)) * ((2.0d0 * (l * j)) + ((l ** 3.0d0) * (j * 0.3333333333333333d0))))
else if (l <= 6.4d+43) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (Math.cos((K / 2.0)) * (Math.pow(l, 7.0) * (J * 0.0003968253968253968)));
double t_1 = U + ((Math.exp(l) - Math.exp(-l)) * J);
double tmp;
if (l <= -3.2e+27) {
tmp = t_0;
} else if (l <= -0.052) {
tmp = t_1;
} else if (l <= 0.00112) {
tmp = U + (Math.cos((0.5 * K)) * ((2.0 * (l * J)) + (Math.pow(l, 3.0) * (J * 0.3333333333333333))));
} else if (l <= 6.4e+43) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (math.pow(l, 7.0) * (J * 0.0003968253968253968))) t_1 = U + ((math.exp(l) - math.exp(-l)) * J) tmp = 0 if l <= -3.2e+27: tmp = t_0 elif l <= -0.052: tmp = t_1 elif l <= 0.00112: tmp = U + (math.cos((0.5 * K)) * ((2.0 * (l * J)) + (math.pow(l, 3.0) * (J * 0.3333333333333333)))) elif l <= 6.4e+43: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64((l ^ 7.0) * Float64(J * 0.0003968253968253968)))) t_1 = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)) tmp = 0.0 if (l <= -3.2e+27) tmp = t_0; elseif (l <= -0.052) tmp = t_1; elseif (l <= 0.00112) tmp = Float64(U + Float64(cos(Float64(0.5 * K)) * Float64(Float64(2.0 * Float64(l * J)) + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))))); elseif (l <= 6.4e+43) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (cos((K / 2.0)) * ((l ^ 7.0) * (J * 0.0003968253968253968))); t_1 = U + ((exp(l) - exp(-l)) * J); tmp = 0.0; if (l <= -3.2e+27) tmp = t_0; elseif (l <= -0.052) tmp = t_1; elseif (l <= 0.00112) tmp = U + (cos((0.5 * K)) * ((2.0 * (l * J)) + ((l ^ 3.0) * (J * 0.3333333333333333)))); elseif (l <= 6.4e+43) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[l, 7.0], $MachinePrecision] * N[(J * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.2e+27], t$95$0, If[LessEqual[l, -0.052], t$95$1, If[LessEqual[l, 0.00112], N[(U + N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.4e+43], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left({\ell}^{7} \cdot \left(J \cdot 0.0003968253968253968\right)\right)\\
t_1 := U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{+27}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -0.052:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 0.00112:\\
\;\;\;\;U + \cos \left(0.5 \cdot K\right) \cdot \left(2 \cdot \left(\ell \cdot J\right) + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
\mathbf{elif}\;\ell \leq 6.4 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -3.20000000000000015e27 or 6.40000000000000029e43 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in l around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -3.20000000000000015e27 < l < -0.0519999999999999976 or 0.0011199999999999999 < l < 6.40000000000000029e43Initial program 99.7%
Taylor expanded in K around 0 87.2%
if -0.0519999999999999976 < l < 0.0011199999999999999Initial program 71.9%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-lft-out99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification99.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (cos (/ K 2.0)) (* (pow l 7.0) (* J 0.0003968253968253968)))))
(t_1 (+ U (* (- (exp l) (exp (- l))) J))))
(if (<= l -3.2e+27)
t_0
(if (<= l -0.054)
t_1
(if (<= l 0.00112)
(+
U
(*
J
(*
(cos (* 0.5 K))
(+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))))
(if (<= l 7.2e+43) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (pow(l, 7.0) * (J * 0.0003968253968253968)));
double t_1 = U + ((exp(l) - exp(-l)) * J);
double tmp;
if (l <= -3.2e+27) {
tmp = t_0;
} else if (l <= -0.054) {
tmp = t_1;
} else if (l <= 0.00112) {
tmp = U + (J * (cos((0.5 * K)) * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0))));
} else if (l <= 7.2e+43) {
tmp = t_1;
} else {
tmp = t_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) :: t_1
real(8) :: tmp
t_0 = u + (cos((k / 2.0d0)) * ((l ** 7.0d0) * (j * 0.0003968253968253968d0)))
t_1 = u + ((exp(l) - exp(-l)) * j)
if (l <= (-3.2d+27)) then
tmp = t_0
else if (l <= (-0.054d0)) then
tmp = t_1
else if (l <= 0.00112d0) then
tmp = u + (j * (cos((0.5d0 * k)) * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))))
else if (l <= 7.2d+43) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (Math.cos((K / 2.0)) * (Math.pow(l, 7.0) * (J * 0.0003968253968253968)));
double t_1 = U + ((Math.exp(l) - Math.exp(-l)) * J);
double tmp;
if (l <= -3.2e+27) {
tmp = t_0;
} else if (l <= -0.054) {
tmp = t_1;
} else if (l <= 0.00112) {
tmp = U + (J * (Math.cos((0.5 * K)) * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))));
} else if (l <= 7.2e+43) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (math.pow(l, 7.0) * (J * 0.0003968253968253968))) t_1 = U + ((math.exp(l) - math.exp(-l)) * J) tmp = 0 if l <= -3.2e+27: tmp = t_0 elif l <= -0.054: tmp = t_1 elif l <= 0.00112: tmp = U + (J * (math.cos((0.5 * K)) * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)))) elif l <= 7.2e+43: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64((l ^ 7.0) * Float64(J * 0.0003968253968253968)))) t_1 = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)) tmp = 0.0 if (l <= -3.2e+27) tmp = t_0; elseif (l <= -0.054) tmp = t_1; elseif (l <= 0.00112) tmp = Float64(U + Float64(J * Float64(cos(Float64(0.5 * K)) * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))))); elseif (l <= 7.2e+43) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (cos((K / 2.0)) * ((l ^ 7.0) * (J * 0.0003968253968253968))); t_1 = U + ((exp(l) - exp(-l)) * J); tmp = 0.0; if (l <= -3.2e+27) tmp = t_0; elseif (l <= -0.054) tmp = t_1; elseif (l <= 0.00112) tmp = U + (J * (cos((0.5 * K)) * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)))); elseif (l <= 7.2e+43) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[l, 7.0], $MachinePrecision] * N[(J * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.2e+27], t$95$0, If[LessEqual[l, -0.054], t$95$1, If[LessEqual[l, 0.00112], N[(U + N[(J * N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.2e+43], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left({\ell}^{7} \cdot \left(J \cdot 0.0003968253968253968\right)\right)\\
t_1 := U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{+27}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -0.054:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 0.00112:\\
\;\;\;\;U + J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 7.2 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -3.20000000000000015e27 or 7.2000000000000002e43 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in l around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -3.20000000000000015e27 < l < -0.0539999999999999994 or 0.0011199999999999999 < l < 7.2000000000000002e43Initial program 99.7%
Taylor expanded in K around 0 87.2%
if -0.0539999999999999994 < l < 0.0011199999999999999Initial program 71.9%
Taylor expanded in l around 0 99.9%
Taylor expanded in J around 0 99.9%
*-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
fma-udef99.9%
fma-udef99.9%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in l around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-rgt-out99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-lft-out99.9%
Simplified99.9%
Final simplification99.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ U (* t_0 (* (pow l 7.0) (* J 0.0003968253968253968)))))
(t_2 (+ U (* (- (exp l) (exp (- l))) J))))
(if (<= l -3.2e+27)
t_1
(if (<= l -0.052)
t_2
(if (<= l 0.00112)
(+ U (* t_0 (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))
(if (<= l 7.2e+43) t_2 t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = U + (t_0 * (pow(l, 7.0) * (J * 0.0003968253968253968)));
double t_2 = U + ((exp(l) - exp(-l)) * J);
double tmp;
if (l <= -3.2e+27) {
tmp = t_1;
} else if (l <= -0.052) {
tmp = t_2;
} else if (l <= 0.00112) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else if (l <= 7.2e+43) {
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 = u + (t_0 * ((l ** 7.0d0) * (j * 0.0003968253968253968d0)))
t_2 = u + ((exp(l) - exp(-l)) * j)
if (l <= (-3.2d+27)) then
tmp = t_1
else if (l <= (-0.052d0)) then
tmp = t_2
else if (l <= 0.00112d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
else if (l <= 7.2d+43) 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 = U + (t_0 * (Math.pow(l, 7.0) * (J * 0.0003968253968253968)));
double t_2 = U + ((Math.exp(l) - Math.exp(-l)) * J);
double tmp;
if (l <= -3.2e+27) {
tmp = t_1;
} else if (l <= -0.052) {
tmp = t_2;
} else if (l <= 0.00112) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else if (l <= 7.2e+43) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = U + (t_0 * (math.pow(l, 7.0) * (J * 0.0003968253968253968))) t_2 = U + ((math.exp(l) - math.exp(-l)) * J) tmp = 0 if l <= -3.2e+27: tmp = t_1 elif l <= -0.052: tmp = t_2 elif l <= 0.00112: tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) elif l <= 7.2e+43: 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(U + Float64(t_0 * Float64((l ^ 7.0) * Float64(J * 0.0003968253968253968)))) t_2 = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)) tmp = 0.0 if (l <= -3.2e+27) tmp = t_1; elseif (l <= -0.052) tmp = t_2; elseif (l <= 0.00112) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); elseif (l <= 7.2e+43) 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 = U + (t_0 * ((l ^ 7.0) * (J * 0.0003968253968253968))); t_2 = U + ((exp(l) - exp(-l)) * J); tmp = 0.0; if (l <= -3.2e+27) tmp = t_1; elseif (l <= -0.052) tmp = t_2; elseif (l <= 0.00112) tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); elseif (l <= 7.2e+43) 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[(U + N[(t$95$0 * N[(N[Power[l, 7.0], $MachinePrecision] * N[(J * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.2e+27], t$95$1, If[LessEqual[l, -0.052], t$95$2, If[LessEqual[l, 0.00112], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.2e+43], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := U + t_0 \cdot \left({\ell}^{7} \cdot \left(J \cdot 0.0003968253968253968\right)\right)\\
t_2 := U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -0.052:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq 0.00112:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 7.2 \cdot 10^{+43}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -3.20000000000000015e27 or 7.2000000000000002e43 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in l around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -3.20000000000000015e27 < l < -0.0519999999999999976 or 0.0011199999999999999 < l < 7.2000000000000002e43Initial program 99.7%
Taylor expanded in K around 0 87.2%
if -0.0519999999999999976 < l < 0.0011199999999999999Initial program 71.9%
Taylor expanded in l around 0 99.9%
Taylor expanded in l around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-rgt-out99.9%
unpow399.9%
associate-*r*99.9%
distribute-rgt-out99.9%
Simplified99.9%
Final simplification99.1%
(FPCore (J l K U)
:precision binary64
(if (or (<= l -7.8e+170)
(not (or (<= l -0.05) (and (not (<= l 0.00112)) (<= l 1.2e+97)))))
(+ U (* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))
(+ U (* (- (exp l) (exp (- l))) J))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -7.8e+170) || !((l <= -0.05) || (!(l <= 0.00112) && (l <= 1.2e+97)))) {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + ((exp(l) - exp(-l)) * J);
}
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 <= (-7.8d+170)) .or. (.not. (l <= (-0.05d0)) .or. (.not. (l <= 0.00112d0)) .and. (l <= 1.2d+97))) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
else
tmp = u + ((exp(l) - exp(-l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -7.8e+170) || !((l <= -0.05) || (!(l <= 0.00112) && (l <= 1.2e+97)))) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + ((Math.exp(l) - Math.exp(-l)) * J);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -7.8e+170) or not ((l <= -0.05) or (not (l <= 0.00112) and (l <= 1.2e+97))): tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) else: tmp = U + ((math.exp(l) - math.exp(-l)) * J) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -7.8e+170) || !((l <= -0.05) || (!(l <= 0.00112) && (l <= 1.2e+97)))) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); else tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -7.8e+170) || ~(((l <= -0.05) || (~((l <= 0.00112)) && (l <= 1.2e+97))))) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); else tmp = U + ((exp(l) - exp(-l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -7.8e+170], N[Not[Or[LessEqual[l, -0.05], And[N[Not[LessEqual[l, 0.00112]], $MachinePrecision], LessEqual[l, 1.2e+97]]]], $MachinePrecision]], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.8 \cdot 10^{+170} \lor \neg \left(\ell \leq -0.05 \lor \neg \left(\ell \leq 0.00112\right) \land \ell \leq 1.2 \cdot 10^{+97}\right):\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\end{array}
\end{array}
if l < -7.8000000000000005e170 or -0.050000000000000003 < l < 0.0011199999999999999 or 1.2e97 < l Initial program 81.1%
Taylor expanded in l around 0 99.9%
Taylor expanded in l around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-rgt-out99.9%
unpow399.9%
associate-*r*99.9%
distribute-rgt-out99.9%
Simplified99.9%
if -7.8000000000000005e170 < l < -0.050000000000000003 or 0.0011199999999999999 < l < 1.2e97Initial program 99.9%
Taylor expanded in K around 0 82.3%
Final simplification96.4%
(FPCore (J l K U)
:precision binary64
(if (or (<= l -7.8e+170)
(not (or (<= l -190.0) (and (not (<= l 245.0)) (<= l 8.6e+97)))))
(+ U (* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))
(* (- (exp l) (exp (- l))) J)))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -7.8e+170) || !((l <= -190.0) || (!(l <= 245.0) && (l <= 8.6e+97)))) {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = (exp(l) - exp(-l)) * J;
}
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 <= (-7.8d+170)) .or. (.not. (l <= (-190.0d0)) .or. (.not. (l <= 245.0d0)) .and. (l <= 8.6d+97))) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
else
tmp = (exp(l) - exp(-l)) * j
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -7.8e+170) || !((l <= -190.0) || (!(l <= 245.0) && (l <= 8.6e+97)))) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = (Math.exp(l) - Math.exp(-l)) * J;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -7.8e+170) or not ((l <= -190.0) or (not (l <= 245.0) and (l <= 8.6e+97))): tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) else: tmp = (math.exp(l) - math.exp(-l)) * J return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -7.8e+170) || !((l <= -190.0) || (!(l <= 245.0) && (l <= 8.6e+97)))) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); else tmp = Float64(Float64(exp(l) - exp(Float64(-l))) * J); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -7.8e+170) || ~(((l <= -190.0) || (~((l <= 245.0)) && (l <= 8.6e+97))))) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); else tmp = (exp(l) - exp(-l)) * J; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -7.8e+170], N[Not[Or[LessEqual[l, -190.0], And[N[Not[LessEqual[l, 245.0]], $MachinePrecision], LessEqual[l, 8.6e+97]]]], $MachinePrecision]], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.8 \cdot 10^{+170} \lor \neg \left(\ell \leq -190 \lor \neg \left(\ell \leq 245\right) \land \ell \leq 8.6 \cdot 10^{+97}\right):\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\end{array}
\end{array}
if l < -7.8000000000000005e170 or -190 < l < 245 or 8.5999999999999996e97 < l Initial program 81.2%
Taylor expanded in l around 0 99.9%
Taylor expanded in l around 0 99.7%
associate-*r*99.7%
associate-*r*99.7%
distribute-rgt-out99.7%
unpow399.7%
associate-*r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
if -7.8000000000000005e170 < l < -190 or 245 < l < 8.5999999999999996e97Initial program 100.0%
Taylor expanded in K around 0 81.6%
Taylor expanded in J around inf 81.6%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(if (<= l -7.5e+99)
(+ U (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))
(if (<= l -2400000.0)
(pow U -8.0)
(if (<= l 1.2e+24)
(+ U (* J (* (cos (* 0.5 K)) (* l 2.0))))
(if (<= l 7.2e+71)
(pow U -8.0)
(+
(* 2.0 (* l J))
(+ U (* 0.3333333333333333 (* J (pow l 3.0))))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -7.5e+99) {
tmp = U + (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0)));
} else if (l <= -2400000.0) {
tmp = pow(U, -8.0);
} else if (l <= 1.2e+24) {
tmp = U + (J * (cos((0.5 * K)) * (l * 2.0)));
} else if (l <= 7.2e+71) {
tmp = pow(U, -8.0);
} else {
tmp = (2.0 * (l * J)) + (U + (0.3333333333333333 * (J * pow(l, 3.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 <= (-7.5d+99)) then
tmp = u + (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0)))
else if (l <= (-2400000.0d0)) then
tmp = u ** (-8.0d0)
else if (l <= 1.2d+24) then
tmp = u + (j * (cos((0.5d0 * k)) * (l * 2.0d0)))
else if (l <= 7.2d+71) then
tmp = u ** (-8.0d0)
else
tmp = (2.0d0 * (l * j)) + (u + (0.3333333333333333d0 * (j * (l ** 3.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -7.5e+99) {
tmp = U + (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0)));
} else if (l <= -2400000.0) {
tmp = Math.pow(U, -8.0);
} else if (l <= 1.2e+24) {
tmp = U + (J * (Math.cos((0.5 * K)) * (l * 2.0)));
} else if (l <= 7.2e+71) {
tmp = Math.pow(U, -8.0);
} else {
tmp = (2.0 * (l * J)) + (U + (0.3333333333333333 * (J * Math.pow(l, 3.0))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -7.5e+99: tmp = U + (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))) elif l <= -2400000.0: tmp = math.pow(U, -8.0) elif l <= 1.2e+24: tmp = U + (J * (math.cos((0.5 * K)) * (l * 2.0))) elif l <= 7.2e+71: tmp = math.pow(U, -8.0) else: tmp = (2.0 * (l * J)) + (U + (0.3333333333333333 * (J * math.pow(l, 3.0)))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -7.5e+99) tmp = Float64(U + Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0)))); elseif (l <= -2400000.0) tmp = U ^ -8.0; elseif (l <= 1.2e+24) tmp = Float64(U + Float64(J * Float64(cos(Float64(0.5 * K)) * Float64(l * 2.0)))); elseif (l <= 7.2e+71) tmp = U ^ -8.0; else tmp = Float64(Float64(2.0 * Float64(l * J)) + Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -7.5e+99) tmp = U + (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0))); elseif (l <= -2400000.0) tmp = U ^ -8.0; elseif (l <= 1.2e+24) tmp = U + (J * (cos((0.5 * K)) * (l * 2.0))); elseif (l <= 7.2e+71) tmp = U ^ -8.0; else tmp = (2.0 * (l * J)) + (U + (0.3333333333333333 * (J * (l ^ 3.0)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -7.5e+99], N[(U + N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2400000.0], N[Power[U, -8.0], $MachinePrecision], If[LessEqual[l, 1.2e+24], N[(U + N[(J * N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.2e+71], N[Power[U, -8.0], $MachinePrecision], N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] + N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.5 \cdot 10^{+99}:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq -2400000:\\
\;\;\;\;{U}^{-8}\\
\mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+24}:\\
\;\;\;\;U + J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 7.2 \cdot 10^{+71}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot J\right) + \left(U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\right)\\
\end{array}
\end{array}
if l < -7.49999999999999963e99Initial program 100.0%
Taylor expanded in K around 0 82.9%
Taylor expanded in l around 0 82.9%
if -7.49999999999999963e99 < l < -2.4e6 or 1.2e24 < l < 7.1999999999999999e71Initial program 100.0%
Applied egg-rr57.6%
if -2.4e6 < l < 1.2e24Initial program 72.8%
Taylor expanded in l around 0 97.9%
Taylor expanded in J around 0 97.9%
*-commutative97.9%
*-commutative97.9%
fma-def97.9%
+-commutative97.9%
*-commutative97.9%
fma-udef97.9%
fma-udef97.9%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in l around 0 96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
if 7.1999999999999999e71 < l Initial program 100.0%
Taylor expanded in K around 0 78.0%
Taylor expanded in l around 0 72.2%
Final simplification85.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))))
(if (<= l -3.15e+100)
t_0
(if (<= l -2400000.0)
(pow U -8.0)
(if (<= l 1.05e+24)
(+ U (* J (* (cos (* 0.5 K)) (* l 2.0))))
(if (<= l 2.8e+71) (pow U -8.0) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0)));
double tmp;
if (l <= -3.15e+100) {
tmp = t_0;
} else if (l <= -2400000.0) {
tmp = pow(U, -8.0);
} else if (l <= 1.05e+24) {
tmp = U + (J * (cos((0.5 * K)) * (l * 2.0)));
} else if (l <= 2.8e+71) {
tmp = pow(U, -8.0);
} else {
tmp = t_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 = u + (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0)))
if (l <= (-3.15d+100)) then
tmp = t_0
else if (l <= (-2400000.0d0)) then
tmp = u ** (-8.0d0)
else if (l <= 1.05d+24) then
tmp = u + (j * (cos((0.5d0 * k)) * (l * 2.0d0)))
else if (l <= 2.8d+71) then
tmp = u ** (-8.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0)));
double tmp;
if (l <= -3.15e+100) {
tmp = t_0;
} else if (l <= -2400000.0) {
tmp = Math.pow(U, -8.0);
} else if (l <= 1.05e+24) {
tmp = U + (J * (Math.cos((0.5 * K)) * (l * 2.0)));
} else if (l <= 2.8e+71) {
tmp = Math.pow(U, -8.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))) tmp = 0 if l <= -3.15e+100: tmp = t_0 elif l <= -2400000.0: tmp = math.pow(U, -8.0) elif l <= 1.05e+24: tmp = U + (J * (math.cos((0.5 * K)) * (l * 2.0))) elif l <= 2.8e+71: tmp = math.pow(U, -8.0) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0)))) tmp = 0.0 if (l <= -3.15e+100) tmp = t_0; elseif (l <= -2400000.0) tmp = U ^ -8.0; elseif (l <= 1.05e+24) tmp = Float64(U + Float64(J * Float64(cos(Float64(0.5 * K)) * Float64(l * 2.0)))); elseif (l <= 2.8e+71) tmp = U ^ -8.0; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0))); tmp = 0.0; if (l <= -3.15e+100) tmp = t_0; elseif (l <= -2400000.0) tmp = U ^ -8.0; elseif (l <= 1.05e+24) tmp = U + (J * (cos((0.5 * K)) * (l * 2.0))); elseif (l <= 2.8e+71) tmp = U ^ -8.0; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.15e+100], t$95$0, If[LessEqual[l, -2400000.0], N[Power[U, -8.0], $MachinePrecision], If[LessEqual[l, 1.05e+24], N[(U + N[(J * N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.8e+71], N[Power[U, -8.0], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\mathbf{if}\;\ell \leq -3.15 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -2400000:\\
\;\;\;\;{U}^{-8}\\
\mathbf{elif}\;\ell \leq 1.05 \cdot 10^{+24}:\\
\;\;\;\;U + J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 2.8 \cdot 10^{+71}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -3.1500000000000002e100 or 2.80000000000000002e71 < l Initial program 100.0%
Taylor expanded in K around 0 80.0%
Taylor expanded in l around 0 76.6%
if -3.1500000000000002e100 < l < -2.4e6 or 1.0500000000000001e24 < l < 2.80000000000000002e71Initial program 100.0%
Applied egg-rr57.6%
if -2.4e6 < l < 1.0500000000000001e24Initial program 72.8%
Taylor expanded in l around 0 97.9%
Taylor expanded in J around 0 97.9%
*-commutative97.9%
*-commutative97.9%
fma-def97.9%
+-commutative97.9%
*-commutative97.9%
fma-udef97.9%
fma-udef97.9%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in l around 0 96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
Final simplification85.8%
(FPCore (J l K U)
:precision binary64
(if (<= l -7500000000.0)
(pow U -3.0)
(if (or (<= l 1.1e+24) (not (<= l 6e+125)))
(+ U (* 2.0 (* l (* J (cos (* 0.5 K))))))
(pow U -8.0))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -7500000000.0) {
tmp = pow(U, -3.0);
} else if ((l <= 1.1e+24) || !(l <= 6e+125)) {
tmp = U + (2.0 * (l * (J * cos((0.5 * K)))));
} else {
tmp = pow(U, -8.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 <= (-7500000000.0d0)) then
tmp = u ** (-3.0d0)
else if ((l <= 1.1d+24) .or. (.not. (l <= 6d+125))) then
tmp = u + (2.0d0 * (l * (j * cos((0.5d0 * k)))))
else
tmp = u ** (-8.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -7500000000.0) {
tmp = Math.pow(U, -3.0);
} else if ((l <= 1.1e+24) || !(l <= 6e+125)) {
tmp = U + (2.0 * (l * (J * Math.cos((0.5 * K)))));
} else {
tmp = Math.pow(U, -8.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -7500000000.0: tmp = math.pow(U, -3.0) elif (l <= 1.1e+24) or not (l <= 6e+125): tmp = U + (2.0 * (l * (J * math.cos((0.5 * K))))) else: tmp = math.pow(U, -8.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -7500000000.0) tmp = U ^ -3.0; elseif ((l <= 1.1e+24) || !(l <= 6e+125)) tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J * cos(Float64(0.5 * K)))))); else tmp = U ^ -8.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -7500000000.0) tmp = U ^ -3.0; elseif ((l <= 1.1e+24) || ~((l <= 6e+125))) tmp = U + (2.0 * (l * (J * cos((0.5 * K))))); else tmp = U ^ -8.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -7500000000.0], N[Power[U, -3.0], $MachinePrecision], If[Or[LessEqual[l, 1.1e+24], N[Not[LessEqual[l, 6e+125]], $MachinePrecision]], N[(U + N[(2.0 * N[(l * N[(J * N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[U, -8.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7500000000:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 1.1 \cdot 10^{+24} \lor \neg \left(\ell \leq 6 \cdot 10^{+125}\right):\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J \cdot \cos \left(0.5 \cdot K\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{U}^{-8}\\
\end{array}
\end{array}
if l < -7.5e9Initial program 100.0%
Applied egg-rr35.6%
if -7.5e9 < l < 1.10000000000000001e24 or 6.0000000000000003e125 < l Initial program 78.3%
Taylor expanded in l around 0 84.6%
*-commutative84.6%
associate-*l*84.6%
*-commutative84.6%
Simplified84.6%
if 1.10000000000000001e24 < l < 6.0000000000000003e125Initial program 100.0%
Applied egg-rr36.4%
Final simplification69.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (* 0.5 K))))
(if (<= l -155000000.0)
(pow U -3.0)
(if (<= l 2e+24)
(+ U (* J (* t_0 (* l 2.0))))
(if (<= l 4.8e+125) (pow U -8.0) (+ U (* 2.0 (* l (* J t_0)))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((0.5 * K));
double tmp;
if (l <= -155000000.0) {
tmp = pow(U, -3.0);
} else if (l <= 2e+24) {
tmp = U + (J * (t_0 * (l * 2.0)));
} else if (l <= 4.8e+125) {
tmp = pow(U, -8.0);
} else {
tmp = U + (2.0 * (l * (J * t_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 = cos((0.5d0 * k))
if (l <= (-155000000.0d0)) then
tmp = u ** (-3.0d0)
else if (l <= 2d+24) then
tmp = u + (j * (t_0 * (l * 2.0d0)))
else if (l <= 4.8d+125) then
tmp = u ** (-8.0d0)
else
tmp = u + (2.0d0 * (l * (j * t_0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((0.5 * K));
double tmp;
if (l <= -155000000.0) {
tmp = Math.pow(U, -3.0);
} else if (l <= 2e+24) {
tmp = U + (J * (t_0 * (l * 2.0)));
} else if (l <= 4.8e+125) {
tmp = Math.pow(U, -8.0);
} else {
tmp = U + (2.0 * (l * (J * t_0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((0.5 * K)) tmp = 0 if l <= -155000000.0: tmp = math.pow(U, -3.0) elif l <= 2e+24: tmp = U + (J * (t_0 * (l * 2.0))) elif l <= 4.8e+125: tmp = math.pow(U, -8.0) else: tmp = U + (2.0 * (l * (J * t_0))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(0.5 * K)) tmp = 0.0 if (l <= -155000000.0) tmp = U ^ -3.0; elseif (l <= 2e+24) tmp = Float64(U + Float64(J * Float64(t_0 * Float64(l * 2.0)))); elseif (l <= 4.8e+125) tmp = U ^ -8.0; else tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J * t_0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((0.5 * K)); tmp = 0.0; if (l <= -155000000.0) tmp = U ^ -3.0; elseif (l <= 2e+24) tmp = U + (J * (t_0 * (l * 2.0))); elseif (l <= 4.8e+125) tmp = U ^ -8.0; else tmp = U + (2.0 * (l * (J * t_0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -155000000.0], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 2e+24], N[(U + N[(J * N[(t$95$0 * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.8e+125], N[Power[U, -8.0], $MachinePrecision], N[(U + N[(2.0 * N[(l * N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(0.5 \cdot K\right)\\
\mathbf{if}\;\ell \leq -155000000:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+24}:\\
\;\;\;\;U + J \cdot \left(t_0 \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{+125}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J \cdot t_0\right)\right)\\
\end{array}
\end{array}
if l < -1.55e8Initial program 100.0%
Applied egg-rr35.6%
if -1.55e8 < l < 2e24Initial program 72.8%
Taylor expanded in l around 0 97.9%
Taylor expanded in J around 0 97.9%
*-commutative97.9%
*-commutative97.9%
fma-def97.9%
+-commutative97.9%
*-commutative97.9%
fma-udef97.9%
fma-udef97.9%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in l around 0 96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
if 2e24 < l < 4.7999999999999999e125Initial program 100.0%
Applied egg-rr36.4%
if 4.7999999999999999e125 < l Initial program 100.0%
Taylor expanded in l around 0 36.3%
*-commutative36.3%
associate-*l*36.3%
*-commutative36.3%
Simplified36.3%
Final simplification70.0%
(FPCore (J l K U) :precision binary64 (+ U (* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l))))))))
double code(double J, double l, double K, double U) {
return U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
}
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 + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
end function
public static double code(double J, double l, double K, double U) {
return U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); end
code[J_, l_, K_, U_] := N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)
\end{array}
Initial program 84.8%
Taylor expanded in l around 0 95.9%
Taylor expanded in l around 0 89.0%
associate-*r*89.0%
associate-*r*89.0%
distribute-rgt-out89.0%
unpow389.0%
associate-*r*89.0%
distribute-rgt-out89.0%
Simplified89.0%
Final simplification89.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (* l 2.0)))))
(if (<= l -18000000.0)
(pow U -8.0)
(if (<= l 860.0)
t_0
(if (<= l 2.9e+120)
(pow U -8.0)
(if (<= l 1.65e+218)
(+ U (* J (+ -8.0 (* K K))))
(if (<= l 3.4e+238) (pow U -8.0) t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * 2.0));
double tmp;
if (l <= -18000000.0) {
tmp = pow(U, -8.0);
} else if (l <= 860.0) {
tmp = t_0;
} else if (l <= 2.9e+120) {
tmp = pow(U, -8.0);
} else if (l <= 1.65e+218) {
tmp = U + (J * (-8.0 + (K * K)));
} else if (l <= 3.4e+238) {
tmp = pow(U, -8.0);
} else {
tmp = t_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 = u + (j * (l * 2.0d0))
if (l <= (-18000000.0d0)) then
tmp = u ** (-8.0d0)
else if (l <= 860.0d0) then
tmp = t_0
else if (l <= 2.9d+120) then
tmp = u ** (-8.0d0)
else if (l <= 1.65d+218) then
tmp = u + (j * ((-8.0d0) + (k * k)))
else if (l <= 3.4d+238) then
tmp = u ** (-8.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * 2.0));
double tmp;
if (l <= -18000000.0) {
tmp = Math.pow(U, -8.0);
} else if (l <= 860.0) {
tmp = t_0;
} else if (l <= 2.9e+120) {
tmp = Math.pow(U, -8.0);
} else if (l <= 1.65e+218) {
tmp = U + (J * (-8.0 + (K * K)));
} else if (l <= 3.4e+238) {
tmp = Math.pow(U, -8.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (J * (l * 2.0)) tmp = 0 if l <= -18000000.0: tmp = math.pow(U, -8.0) elif l <= 860.0: tmp = t_0 elif l <= 2.9e+120: tmp = math.pow(U, -8.0) elif l <= 1.65e+218: tmp = U + (J * (-8.0 + (K * K))) elif l <= 3.4e+238: tmp = math.pow(U, -8.0) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64(l * 2.0))) tmp = 0.0 if (l <= -18000000.0) tmp = U ^ -8.0; elseif (l <= 860.0) tmp = t_0; elseif (l <= 2.9e+120) tmp = U ^ -8.0; elseif (l <= 1.65e+218) tmp = Float64(U + Float64(J * Float64(-8.0 + Float64(K * K)))); elseif (l <= 3.4e+238) tmp = U ^ -8.0; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (J * (l * 2.0)); tmp = 0.0; if (l <= -18000000.0) tmp = U ^ -8.0; elseif (l <= 860.0) tmp = t_0; elseif (l <= 2.9e+120) tmp = U ^ -8.0; elseif (l <= 1.65e+218) tmp = U + (J * (-8.0 + (K * K))); elseif (l <= 3.4e+238) tmp = U ^ -8.0; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -18000000.0], N[Power[U, -8.0], $MachinePrecision], If[LessEqual[l, 860.0], t$95$0, If[LessEqual[l, 2.9e+120], N[Power[U, -8.0], $MachinePrecision], If[LessEqual[l, 1.65e+218], N[(U + N[(J * N[(-8.0 + N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.4e+238], N[Power[U, -8.0], $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{if}\;\ell \leq -18000000:\\
\;\;\;\;{U}^{-8}\\
\mathbf{elif}\;\ell \leq 860:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+120}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{elif}\;\ell \leq 1.65 \cdot 10^{+218}:\\
\;\;\;\;U + J \cdot \left(-8 + K \cdot K\right)\\
\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+238}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -1.8e7 or 860 < l < 2.9000000000000001e120 or 1.64999999999999999e218 < l < 3.3999999999999998e238Initial program 100.0%
Applied egg-rr33.9%
if -1.8e7 < l < 860 or 3.3999999999999998e238 < l Initial program 74.3%
Taylor expanded in K around 0 73.4%
Taylor expanded in l around 0 80.9%
if 2.9000000000000001e120 < l < 1.64999999999999999e218Initial program 100.0%
Applied egg-rr1.3%
Taylor expanded in K around 0 38.5%
distribute-rgt-out38.5%
unpow238.5%
Simplified38.5%
Final simplification62.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (* l 2.0)))))
(if (<= l -3200000.0)
(pow U -3.0)
(if (<= l 800.0)
t_0
(if (<= l 2.5e+120)
(pow U -8.0)
(if (<= l 3e+220)
(+ U (* J (+ -8.0 (* K K))))
(if (<= l 2.05e+239) (pow U -8.0) t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * 2.0));
double tmp;
if (l <= -3200000.0) {
tmp = pow(U, -3.0);
} else if (l <= 800.0) {
tmp = t_0;
} else if (l <= 2.5e+120) {
tmp = pow(U, -8.0);
} else if (l <= 3e+220) {
tmp = U + (J * (-8.0 + (K * K)));
} else if (l <= 2.05e+239) {
tmp = pow(U, -8.0);
} else {
tmp = t_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 = u + (j * (l * 2.0d0))
if (l <= (-3200000.0d0)) then
tmp = u ** (-3.0d0)
else if (l <= 800.0d0) then
tmp = t_0
else if (l <= 2.5d+120) then
tmp = u ** (-8.0d0)
else if (l <= 3d+220) then
tmp = u + (j * ((-8.0d0) + (k * k)))
else if (l <= 2.05d+239) then
tmp = u ** (-8.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * 2.0));
double tmp;
if (l <= -3200000.0) {
tmp = Math.pow(U, -3.0);
} else if (l <= 800.0) {
tmp = t_0;
} else if (l <= 2.5e+120) {
tmp = Math.pow(U, -8.0);
} else if (l <= 3e+220) {
tmp = U + (J * (-8.0 + (K * K)));
} else if (l <= 2.05e+239) {
tmp = Math.pow(U, -8.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (J * (l * 2.0)) tmp = 0 if l <= -3200000.0: tmp = math.pow(U, -3.0) elif l <= 800.0: tmp = t_0 elif l <= 2.5e+120: tmp = math.pow(U, -8.0) elif l <= 3e+220: tmp = U + (J * (-8.0 + (K * K))) elif l <= 2.05e+239: tmp = math.pow(U, -8.0) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64(l * 2.0))) tmp = 0.0 if (l <= -3200000.0) tmp = U ^ -3.0; elseif (l <= 800.0) tmp = t_0; elseif (l <= 2.5e+120) tmp = U ^ -8.0; elseif (l <= 3e+220) tmp = Float64(U + Float64(J * Float64(-8.0 + Float64(K * K)))); elseif (l <= 2.05e+239) tmp = U ^ -8.0; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (J * (l * 2.0)); tmp = 0.0; if (l <= -3200000.0) tmp = U ^ -3.0; elseif (l <= 800.0) tmp = t_0; elseif (l <= 2.5e+120) tmp = U ^ -8.0; elseif (l <= 3e+220) tmp = U + (J * (-8.0 + (K * K))); elseif (l <= 2.05e+239) tmp = U ^ -8.0; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3200000.0], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 800.0], t$95$0, If[LessEqual[l, 2.5e+120], N[Power[U, -8.0], $MachinePrecision], If[LessEqual[l, 3e+220], N[(U + N[(J * N[(-8.0 + N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.05e+239], N[Power[U, -8.0], $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{if}\;\ell \leq -3200000:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 800:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{+120}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{elif}\;\ell \leq 3 \cdot 10^{+220}:\\
\;\;\;\;U + J \cdot \left(-8 + K \cdot K\right)\\
\mathbf{elif}\;\ell \leq 2.05 \cdot 10^{+239}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -3.2e6Initial program 100.0%
Applied egg-rr35.6%
if -3.2e6 < l < 800 or 2.0500000000000001e239 < l Initial program 74.3%
Taylor expanded in K around 0 73.4%
Taylor expanded in l around 0 80.9%
if 800 < l < 2.50000000000000009e120 or 3.00000000000000024e220 < l < 2.0500000000000001e239Initial program 100.0%
Applied egg-rr35.0%
if 2.50000000000000009e120 < l < 3.00000000000000024e220Initial program 100.0%
Applied egg-rr1.3%
Taylor expanded in K around 0 38.5%
distribute-rgt-out38.5%
unpow238.5%
Simplified38.5%
Final simplification62.5%
(FPCore (J l K U) :precision binary64 (if (<= l 1.45e+24) (+ U (* J (* l 2.0))) (+ U (* J (+ -8.0 (* K K))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.45e+24) {
tmp = U + (J * (l * 2.0));
} else {
tmp = U + (J * (-8.0 + (K * K)));
}
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 <= 1.45d+24) then
tmp = u + (j * (l * 2.0d0))
else
tmp = u + (j * ((-8.0d0) + (k * k)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.45e+24) {
tmp = U + (J * (l * 2.0));
} else {
tmp = U + (J * (-8.0 + (K * K)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.45e+24: tmp = U + (J * (l * 2.0)) else: tmp = U + (J * (-8.0 + (K * K))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.45e+24) tmp = Float64(U + Float64(J * Float64(l * 2.0))); else tmp = Float64(U + Float64(J * Float64(-8.0 + Float64(K * K)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.45e+24) tmp = U + (J * (l * 2.0)); else tmp = U + (J * (-8.0 + (K * K))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.45e+24], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(-8.0 + N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.45 \cdot 10^{+24}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(-8 + K \cdot K\right)\\
\end{array}
\end{array}
if l < 1.4499999999999999e24Initial program 79.8%
Taylor expanded in K around 0 73.4%
Taylor expanded in l around 0 64.8%
if 1.4499999999999999e24 < l Initial program 100.0%
Applied egg-rr1.2%
Taylor expanded in K around 0 26.3%
distribute-rgt-out26.3%
unpow226.3%
Simplified26.3%
Final simplification55.2%
(FPCore (J l K U) :precision binary64 (if (<= l 1.1e+49) U (* U (- U -8.0))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.1e+49) {
tmp = U;
} else {
tmp = U * (U - -8.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 <= 1.1d+49) then
tmp = u
else
tmp = u * (u - (-8.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.1e+49) {
tmp = U;
} else {
tmp = U * (U - -8.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.1e+49: tmp = U else: tmp = U * (U - -8.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.1e+49) tmp = U; else tmp = Float64(U * Float64(U - -8.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.1e+49) tmp = U; else tmp = U * (U - -8.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.1e+49], U, N[(U * N[(U - -8.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.1 \cdot 10^{+49}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(U - -8\right)\\
\end{array}
\end{array}
if l < 1.1e49Initial program 80.7%
Taylor expanded in J around 0 48.3%
if 1.1e49 < l Initial program 100.0%
Applied egg-rr16.3%
Final simplification41.4%
(FPCore (J l K U) :precision binary64 (+ U (* J (* l 2.0))))
double code(double J, double l, double K, double U) {
return U + (J * (l * 2.0));
}
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 + (j * (l * 2.0d0))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (l * 2.0));
}
def code(J, l, K, U): return U + (J * (l * 2.0))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(l * 2.0))) end
function tmp = code(J, l, K, U) tmp = U + (J * (l * 2.0)); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot 2\right)
\end{array}
Initial program 84.8%
Taylor expanded in K around 0 74.6%
Taylor expanded in l around 0 53.6%
Final simplification53.6%
(FPCore (J l K U) :precision binary64 (if (<= l 1.05e+94) U (* U U)))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.05e+94) {
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 <= 1.05d+94) 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 <= 1.05e+94) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.05e+94: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.05e+94) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.05e+94) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.05e+94], U, N[(U * U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.05 \cdot 10^{+94}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < 1.04999999999999995e94Initial program 81.5%
Taylor expanded in J around 0 46.3%
if 1.04999999999999995e94 < l Initial program 100.0%
Applied egg-rr19.0%
Final simplification41.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 84.8%
Taylor expanded in J around 0 38.3%
Final simplification38.3%
herbie shell --seed 2023181
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))