
(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 24 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 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 0.0005)))
(+ (* (* t_1 J) t_0) U)
(+ U (* t_0 (* J (fma 2.0 l (* 0.3333333333333333 (pow l 3.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 <= -((double) INFINITY)) || !(t_1 <= 0.0005)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (J * fma(2.0, l, (0.3333333333333333 * pow(l, 3.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 <= Float64(-Inf)) || !(t_1 <= 0.0005)) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = Float64(U + Float64(t_0 * Float64(J * fma(2.0, l, Float64(0.3333333333333333 * (l ^ 3.0)))))); 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 0.0005]], $MachinePrecision]], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(2.0 * l + N[(0.3333333333333333 * N[Power[l, 3.0], $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 -\infty \lor \neg \left(t\_1 \leq 0.0005\right):\\
\;\;\;\;\left(t\_1 \cdot J\right) \cdot t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \mathsf{fma}\left(2, \ell, 0.3333333333333333 \cdot {\ell}^{3}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 5.0000000000000001e-4 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-4Initial program 70.2%
Taylor expanded in l around 0 99.9%
distribute-rgt-in99.9%
fma-define99.9%
associate-*l*99.9%
pow-plus99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 0.0005)))
(+ (* (* t_1 J) t_0) U)
(+
U
(* t_0 (* l (+ (* 0.3333333333333333 (* J (pow l 2.0))) (* J 2.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 <= -((double) INFINITY)) || !(t_1 <= 0.0005)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * pow(l, 2.0))) + (J * 2.0))));
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 0.0005)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * Math.pow(l, 2.0))) + (J * 2.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 <= -math.inf) or not (t_1 <= 0.0005): tmp = ((t_1 * J) * t_0) + U else: tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * math.pow(l, 2.0))) + (J * 2.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 <= Float64(-Inf)) || !(t_1 <= 0.0005)) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = Float64(U + Float64(t_0 * Float64(l * Float64(Float64(0.3333333333333333 * Float64(J * (l ^ 2.0))) + Float64(J * 2.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 <= -Inf) || ~((t_1 <= 0.0005))) tmp = ((t_1 * J) * t_0) + U; else tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * (l ^ 2.0))) + (J * 2.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, (-Infinity)], N[Not[LessEqual[t$95$1, 0.0005]], $MachinePrecision]], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(l * N[(N[(0.3333333333333333 * N[(J * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(J * 2.0), $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 -\infty \lor \neg \left(t\_1 \leq 0.0005\right):\\
\;\;\;\;\left(t\_1 \cdot J\right) \cdot t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{2}\right) + J \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 5.0000000000000001e-4 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-4Initial program 70.2%
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 -1e-5) (not (<= t_0 2e-16)))
(+ (* t_0 J) U)
(+ U (* (cos (/ K 2.0)) (* l (* J 2.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -1e-5) || !(t_0 <= 2e-16)) {
tmp = (t_0 * J) + U;
} else {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.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 = exp(l) - exp(-l)
if ((t_0 <= (-1d-5)) .or. (.not. (t_0 <= 2d-16))) then
tmp = (t_0 * j) + u
else
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
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 <= -1e-5) || !(t_0 <= 2e-16)) {
tmp = (t_0 * J) + U;
} else {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) tmp = 0 if (t_0 <= -1e-5) or not (t_0 <= 2e-16): tmp = (t_0 * J) + U else: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) return tmp
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= -1e-5) || !(t_0 <= 2e-16)) tmp = Float64(Float64(t_0 * J) + U); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = exp(l) - exp(-l); tmp = 0.0; if ((t_0 <= -1e-5) || ~((t_0 <= 2e-16))) tmp = (t_0 * J) + U; else tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); 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, -1e-5], N[Not[LessEqual[t$95$0, 2e-16]], $MachinePrecision]], N[(N[(t$95$0 * J), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-5} \lor \neg \left(t\_0 \leq 2 \cdot 10^{-16}\right):\\
\;\;\;\;t\_0 \cdot J + U\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -1.00000000000000008e-5 or 2e-16 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 99.7%
Taylor expanded in K around 0 76.9%
if -1.00000000000000008e-5 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 2e-16Initial program 70.0%
Taylor expanded in l around 0 99.9%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification88.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (- (exp l) (exp (- l))) J)))
(if (<= t_0 -2e-170)
(+ t_0 U)
(+
U
(*
(cos (/ K 2.0))
(* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))))))))
double code(double J, double l, double K, double U) {
double t_0 = (exp(l) - exp(-l)) * J;
double tmp;
if (t_0 <= -2e-170) {
tmp = t_0 + U;
} else {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.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 = (exp(l) - exp(-l)) * j
if (t_0 <= (-2d-170)) then
tmp = t_0 + u
else
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0))))))
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)) * J;
double tmp;
if (t_0 <= -2e-170) {
tmp = t_0 + U;
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))));
}
return tmp;
}
def code(J, l, K, U): t_0 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if t_0 <= -2e-170: tmp = t_0 + U else: tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0)))))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (t_0 <= -2e-170) tmp = Float64(t_0 + U); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (t_0 <= -2e-170) tmp = t_0 + U; else tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0)))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-170], N[(t$95$0 + U), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-170}:\\
\;\;\;\;t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) < -1.99999999999999997e-170Initial program 99.4%
Taylor expanded in K around 0 80.0%
if -1.99999999999999997e-170 < (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) Initial program 79.0%
Taylor expanded in l around 0 95.9%
Final simplification91.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (* J (pow l 3.0)) (* 0.3333333333333333 (cos (* K 0.5))))))
(t_1 (+ (* (- (exp l) (exp (- l))) J) U)))
(if (<= l -9.4e+179)
t_0
(if (<= l -0.13)
t_1
(if (<= l 0.092)
(+
U
(*
(cos (/ K 2.0))
(* l (+ (* 0.3333333333333333 (* J (pow l 2.0))) (* J 2.0)))))
(if (<= l 8.4e+77) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((J * pow(l, 3.0)) * (0.3333333333333333 * cos((K * 0.5))));
double t_1 = ((exp(l) - exp(-l)) * J) + U;
double tmp;
if (l <= -9.4e+179) {
tmp = t_0;
} else if (l <= -0.13) {
tmp = t_1;
} else if (l <= 0.092) {
tmp = U + (cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * pow(l, 2.0))) + (J * 2.0))));
} else if (l <= 8.4e+77) {
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 + ((j * (l ** 3.0d0)) * (0.3333333333333333d0 * cos((k * 0.5d0))))
t_1 = ((exp(l) - exp(-l)) * j) + u
if (l <= (-9.4d+179)) then
tmp = t_0
else if (l <= (-0.13d0)) then
tmp = t_1
else if (l <= 0.092d0) then
tmp = u + (cos((k / 2.0d0)) * (l * ((0.3333333333333333d0 * (j * (l ** 2.0d0))) + (j * 2.0d0))))
else if (l <= 8.4d+77) 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 + ((J * Math.pow(l, 3.0)) * (0.3333333333333333 * Math.cos((K * 0.5))));
double t_1 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double tmp;
if (l <= -9.4e+179) {
tmp = t_0;
} else if (l <= -0.13) {
tmp = t_1;
} else if (l <= 0.092) {
tmp = U + (Math.cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * Math.pow(l, 2.0))) + (J * 2.0))));
} else if (l <= 8.4e+77) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + ((J * math.pow(l, 3.0)) * (0.3333333333333333 * math.cos((K * 0.5)))) t_1 = ((math.exp(l) - math.exp(-l)) * J) + U tmp = 0 if l <= -9.4e+179: tmp = t_0 elif l <= -0.13: tmp = t_1 elif l <= 0.092: tmp = U + (math.cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * math.pow(l, 2.0))) + (J * 2.0)))) elif l <= 8.4e+77: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(J * (l ^ 3.0)) * Float64(0.3333333333333333 * cos(Float64(K * 0.5))))) t_1 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) tmp = 0.0 if (l <= -9.4e+179) tmp = t_0; elseif (l <= -0.13) tmp = t_1; elseif (l <= 0.092) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(Float64(0.3333333333333333 * Float64(J * (l ^ 2.0))) + Float64(J * 2.0))))); elseif (l <= 8.4e+77) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + ((J * (l ^ 3.0)) * (0.3333333333333333 * cos((K * 0.5)))); t_1 = ((exp(l) - exp(-l)) * J) + U; tmp = 0.0; if (l <= -9.4e+179) tmp = t_0; elseif (l <= -0.13) tmp = t_1; elseif (l <= 0.092) tmp = U + (cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * (l ^ 2.0))) + (J * 2.0)))); elseif (l <= 8.4e+77) 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[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -9.4e+179], t$95$0, If[LessEqual[l, -0.13], t$95$1, If[LessEqual[l, 0.092], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(N[(0.3333333333333333 * N[(J * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.4e+77], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(J \cdot {\ell}^{3}\right) \cdot \left(0.3333333333333333 \cdot \cos \left(K \cdot 0.5\right)\right)\\
t_1 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
\mathbf{if}\;\ell \leq -9.4 \cdot 10^{+179}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -0.13:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 0.092:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{2}\right) + J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 8.4 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -9.40000000000000013e179 or 8.3999999999999995e77 < l Initial program 100.0%
Taylor expanded in l around 0 96.4%
distribute-rgt-in96.4%
fma-define96.4%
associate-*l*96.4%
pow-plus96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in l around inf 96.4%
*-commutative96.4%
associate-*r*96.4%
*-commutative96.4%
associate-*l*96.4%
*-commutative96.4%
Simplified96.4%
if -9.40000000000000013e179 < l < -0.13 or 0.091999999999999998 < l < 8.3999999999999995e77Initial program 99.9%
Taylor expanded in K around 0 85.4%
if -0.13 < l < 0.091999999999999998Initial program 70.2%
Taylor expanded in l around 0 99.9%
Final simplification96.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (* J (pow l 3.0)) (* 0.3333333333333333 (cos (* K 0.5))))))
(t_1 (+ (* (- (exp l) (exp (- l))) J) U)))
(if (<= l -9.4e+179)
t_0
(if (<= l -8.5e-6)
t_1
(if (<= l 0.00017)
(+ U (* (cos (/ K 2.0)) (* l (* J 2.0))))
(if (<= l 8.4e+77) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((J * pow(l, 3.0)) * (0.3333333333333333 * cos((K * 0.5))));
double t_1 = ((exp(l) - exp(-l)) * J) + U;
double tmp;
if (l <= -9.4e+179) {
tmp = t_0;
} else if (l <= -8.5e-6) {
tmp = t_1;
} else if (l <= 0.00017) {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 8.4e+77) {
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 + ((j * (l ** 3.0d0)) * (0.3333333333333333d0 * cos((k * 0.5d0))))
t_1 = ((exp(l) - exp(-l)) * j) + u
if (l <= (-9.4d+179)) then
tmp = t_0
else if (l <= (-8.5d-6)) then
tmp = t_1
else if (l <= 0.00017d0) then
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
else if (l <= 8.4d+77) 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 + ((J * Math.pow(l, 3.0)) * (0.3333333333333333 * Math.cos((K * 0.5))));
double t_1 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double tmp;
if (l <= -9.4e+179) {
tmp = t_0;
} else if (l <= -8.5e-6) {
tmp = t_1;
} else if (l <= 0.00017) {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 8.4e+77) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + ((J * math.pow(l, 3.0)) * (0.3333333333333333 * math.cos((K * 0.5)))) t_1 = ((math.exp(l) - math.exp(-l)) * J) + U tmp = 0 if l <= -9.4e+179: tmp = t_0 elif l <= -8.5e-6: tmp = t_1 elif l <= 0.00017: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) elif l <= 8.4e+77: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(J * (l ^ 3.0)) * Float64(0.3333333333333333 * cos(Float64(K * 0.5))))) t_1 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) tmp = 0.0 if (l <= -9.4e+179) tmp = t_0; elseif (l <= -8.5e-6) tmp = t_1; elseif (l <= 0.00017) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); elseif (l <= 8.4e+77) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + ((J * (l ^ 3.0)) * (0.3333333333333333 * cos((K * 0.5)))); t_1 = ((exp(l) - exp(-l)) * J) + U; tmp = 0.0; if (l <= -9.4e+179) tmp = t_0; elseif (l <= -8.5e-6) tmp = t_1; elseif (l <= 0.00017) tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); elseif (l <= 8.4e+77) 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[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -9.4e+179], t$95$0, If[LessEqual[l, -8.5e-6], t$95$1, If[LessEqual[l, 0.00017], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.4e+77], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(J \cdot {\ell}^{3}\right) \cdot \left(0.3333333333333333 \cdot \cos \left(K \cdot 0.5\right)\right)\\
t_1 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
\mathbf{if}\;\ell \leq -9.4 \cdot 10^{+179}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 0.00017:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 8.4 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -9.40000000000000013e179 or 8.3999999999999995e77 < l Initial program 100.0%
Taylor expanded in l around 0 96.4%
distribute-rgt-in96.4%
fma-define96.4%
associate-*l*96.4%
pow-plus96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in l around inf 96.4%
*-commutative96.4%
associate-*r*96.4%
*-commutative96.4%
associate-*l*96.4%
*-commutative96.4%
Simplified96.4%
if -9.40000000000000013e179 < l < -8.4999999999999999e-6 or 1.7e-4 < l < 8.3999999999999995e77Initial program 99.2%
Taylor expanded in K around 0 85.2%
if -8.4999999999999999e-6 < l < 1.7e-4Initial program 70.0%
Taylor expanded in l around 0 99.9%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification96.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.01)
(+ U (* t_0 (* l (* J 2.0))))
(*
U
(+ 1.0 (/ (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))) U))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.01) {
tmp = U + (t_0 * (l * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * ((0.3333333333333333 * pow(l, 3.0)) + (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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= (-0.01d0)) then
tmp = u + (t_0 * (l * (j * 2.0d0)))
else
tmp = u * (1.0d0 + ((j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))) / u))
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 tmp;
if (t_0 <= -0.01) {
tmp = U + (t_0 * (l * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))) / U));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.01: tmp = U + (t_0 * (l * (J * 2.0))) else: tmp = U * (1.0 + ((J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))) / U)) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.01) tmp = Float64(U + Float64(t_0 * Float64(l * Float64(J * 2.0)))); else tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))) / U))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= -0.01) tmp = U + (t_0 * (l * (J * 2.0))); else tmp = U * (1.0 + ((J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0))) / U)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.01], N[(U + N[(t$95$0 * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(1.0 + N[(N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -0.01:\\
\;\;\;\;U + t\_0 \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)}{U}\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0100000000000000002Initial program 85.7%
Taylor expanded in l around 0 69.9%
associate-*r*69.9%
*-commutative69.9%
Simplified69.9%
if -0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.4%
Taylor expanded in l around 0 90.1%
distribute-rgt-in90.1%
fma-define90.1%
associate-*l*90.1%
pow-plus90.1%
metadata-eval90.1%
Simplified90.1%
Taylor expanded in K around 0 85.5%
Taylor expanded in U around inf 86.5%
Final simplification82.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.01)
(+ U (* t_0 (* l (* J 2.0))))
(+ U (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.01) {
tmp = U + (t_0 * (l * (J * 2.0)));
} else {
tmp = U + (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.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((k / 2.0d0))
if (t_0 <= (-0.01d0)) then
tmp = u + (t_0 * (l * (j * 2.0d0)))
else
tmp = u + (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.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 tmp;
if (t_0 <= -0.01) {
tmp = U + (t_0 * (l * (J * 2.0)));
} else {
tmp = U + (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.01: tmp = U + (t_0 * (l * (J * 2.0))) else: tmp = U + (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.01) tmp = Float64(U + Float64(t_0 * Float64(l * Float64(J * 2.0)))); else tmp = Float64(U + Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= -0.01) tmp = U + (t_0 * (l * (J * 2.0))); else tmp = U + (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.01], N[(U + N[(t$95$0 * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -0.01:\\
\;\;\;\;U + t\_0 \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0100000000000000002Initial program 85.7%
Taylor expanded in l around 0 69.9%
associate-*r*69.9%
*-commutative69.9%
Simplified69.9%
if -0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.4%
Taylor expanded in l around 0 90.1%
distribute-rgt-in90.1%
fma-define90.1%
associate-*l*90.1%
pow-plus90.1%
metadata-eval90.1%
Simplified90.1%
Taylor expanded in K around 0 85.5%
Final simplification81.4%
(FPCore (J l K U)
:precision binary64
(if (<= l -8.5e-6)
(* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))
(if (<= l 1050.0)
(+ U (* 2.0 (* J (* l (cos (* K 0.5))))))
(if (<= l 1.7e+72)
(* U (- U -4.0))
(if (or (<= l 4.3e+83) (and (not (<= l 4.5e+172)) (<= l 1.3e+194)))
(* (* J (* l (pow K 2.0))) -0.25)
(+ U (* (pow l 3.0) (* J 0.3333333333333333))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -8.5e-6) {
tmp = J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0));
} else if (l <= 1050.0) {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
} else if (l <= 1.7e+72) {
tmp = U * (U - -4.0);
} else if ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * pow(K, 2.0))) * -0.25;
} else {
tmp = U + (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) :: tmp
if (l <= (-8.5d-6)) then
tmp = j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))
else if (l <= 1050.0d0) then
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
else if (l <= 1.7d+72) then
tmp = u * (u - (-4.0d0))
else if ((l <= 4.3d+83) .or. (.not. (l <= 4.5d+172)) .and. (l <= 1.3d+194)) then
tmp = (j * (l * (k ** 2.0d0))) * (-0.25d0)
else
tmp = u + ((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 tmp;
if (l <= -8.5e-6) {
tmp = J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0));
} else if (l <= 1050.0) {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
} else if (l <= 1.7e+72) {
tmp = U * (U - -4.0);
} else if ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * Math.pow(K, 2.0))) * -0.25;
} else {
tmp = U + (Math.pow(l, 3.0) * (J * 0.3333333333333333));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -8.5e-6: tmp = J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)) elif l <= 1050.0: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) elif l <= 1.7e+72: tmp = U * (U - -4.0) elif (l <= 4.3e+83) or (not (l <= 4.5e+172) and (l <= 1.3e+194)): tmp = (J * (l * math.pow(K, 2.0))) * -0.25 else: tmp = U + (math.pow(l, 3.0) * (J * 0.3333333333333333)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -8.5e-6) tmp = Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))); elseif (l <= 1050.0) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); elseif (l <= 1.7e+72) tmp = Float64(U * Float64(U - -4.0)); elseif ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) tmp = Float64(Float64(J * Float64(l * (K ^ 2.0))) * -0.25); else tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -8.5e-6) tmp = J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)); elseif (l <= 1050.0) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); elseif (l <= 1.7e+72) tmp = U * (U - -4.0); elseif ((l <= 4.3e+83) || (~((l <= 4.5e+172)) && (l <= 1.3e+194))) tmp = (J * (l * (K ^ 2.0))) * -0.25; else tmp = U + ((l ^ 3.0) * (J * 0.3333333333333333)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -8.5e-6], N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1050.0], N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.7e+72], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 4.3e+83], And[N[Not[LessEqual[l, 4.5e+172]], $MachinePrecision], LessEqual[l, 1.3e+194]]], N[(N[(J * N[(l * N[Power[K, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 1050:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 1.7 \cdot 10^{+72}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 4.3 \cdot 10^{+83} \lor \neg \left(\ell \leq 4.5 \cdot 10^{+172}\right) \land \ell \leq 1.3 \cdot 10^{+194}:\\
\;\;\;\;\left(J \cdot \left(\ell \cdot {K}^{2}\right)\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\end{array}
\end{array}
if l < -8.4999999999999999e-6Initial program 99.7%
Taylor expanded in l around 0 83.8%
distribute-rgt-in83.8%
fma-define83.8%
associate-*l*83.8%
pow-plus83.8%
metadata-eval83.8%
Simplified83.8%
Taylor expanded in K around 0 74.2%
Taylor expanded in U around 0 74.1%
if -8.4999999999999999e-6 < l < 1050Initial program 70.8%
Taylor expanded in l around 0 98.3%
if 1050 < l < 1.6999999999999999e72Initial program 100.0%
Applied egg-rr37.0%
if 1.6999999999999999e72 < l < 4.3e83 or 4.5000000000000002e172 < l < 1.2999999999999999e194Initial program 100.0%
Taylor expanded in l around 0 51.9%
Taylor expanded in K around 0 87.6%
Taylor expanded in K around inf 87.6%
*-commutative87.6%
*-commutative87.6%
Simplified87.6%
if 4.3e83 < l < 4.5000000000000002e172 or 1.2999999999999999e194 < l Initial program 100.0%
Taylor expanded in l around 0 95.0%
distribute-rgt-in95.0%
fma-define95.0%
associate-*l*95.0%
pow-plus95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in K around 0 73.4%
Taylor expanded in l around inf 73.4%
*-commutative73.4%
*-commutative73.4%
associate-*r*73.4%
Simplified73.4%
Final simplification85.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -8.5e-6)
(* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))
(if (<= l 1750.0)
(+ U (* l (* (* J 2.0) (cos (* K 0.5)))))
(if (<= l 3.7e+73)
(* U (- U -4.0))
(if (or (<= l 4.3e+83) (and (not (<= l 4.5e+172)) (<= l 1.3e+194)))
(* (* J (* l (pow K 2.0))) -0.25)
(+ U (* (pow l 3.0) (* J 0.3333333333333333))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -8.5e-6) {
tmp = J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0));
} else if (l <= 1750.0) {
tmp = U + (l * ((J * 2.0) * cos((K * 0.5))));
} else if (l <= 3.7e+73) {
tmp = U * (U - -4.0);
} else if ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * pow(K, 2.0))) * -0.25;
} else {
tmp = U + (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) :: tmp
if (l <= (-8.5d-6)) then
tmp = j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))
else if (l <= 1750.0d0) then
tmp = u + (l * ((j * 2.0d0) * cos((k * 0.5d0))))
else if (l <= 3.7d+73) then
tmp = u * (u - (-4.0d0))
else if ((l <= 4.3d+83) .or. (.not. (l <= 4.5d+172)) .and. (l <= 1.3d+194)) then
tmp = (j * (l * (k ** 2.0d0))) * (-0.25d0)
else
tmp = u + ((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 tmp;
if (l <= -8.5e-6) {
tmp = J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0));
} else if (l <= 1750.0) {
tmp = U + (l * ((J * 2.0) * Math.cos((K * 0.5))));
} else if (l <= 3.7e+73) {
tmp = U * (U - -4.0);
} else if ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * Math.pow(K, 2.0))) * -0.25;
} else {
tmp = U + (Math.pow(l, 3.0) * (J * 0.3333333333333333));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -8.5e-6: tmp = J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)) elif l <= 1750.0: tmp = U + (l * ((J * 2.0) * math.cos((K * 0.5)))) elif l <= 3.7e+73: tmp = U * (U - -4.0) elif (l <= 4.3e+83) or (not (l <= 4.5e+172) and (l <= 1.3e+194)): tmp = (J * (l * math.pow(K, 2.0))) * -0.25 else: tmp = U + (math.pow(l, 3.0) * (J * 0.3333333333333333)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -8.5e-6) tmp = Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))); elseif (l <= 1750.0) tmp = Float64(U + Float64(l * Float64(Float64(J * 2.0) * cos(Float64(K * 0.5))))); elseif (l <= 3.7e+73) tmp = Float64(U * Float64(U - -4.0)); elseif ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) tmp = Float64(Float64(J * Float64(l * (K ^ 2.0))) * -0.25); else tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -8.5e-6) tmp = J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)); elseif (l <= 1750.0) tmp = U + (l * ((J * 2.0) * cos((K * 0.5)))); elseif (l <= 3.7e+73) tmp = U * (U - -4.0); elseif ((l <= 4.3e+83) || (~((l <= 4.5e+172)) && (l <= 1.3e+194))) tmp = (J * (l * (K ^ 2.0))) * -0.25; else tmp = U + ((l ^ 3.0) * (J * 0.3333333333333333)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -8.5e-6], N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1750.0], N[(U + N[(l * N[(N[(J * 2.0), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.7e+73], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 4.3e+83], And[N[Not[LessEqual[l, 4.5e+172]], $MachinePrecision], LessEqual[l, 1.3e+194]]], N[(N[(J * N[(l * N[Power[K, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 1750:\\
\;\;\;\;U + \ell \cdot \left(\left(J \cdot 2\right) \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+73}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 4.3 \cdot 10^{+83} \lor \neg \left(\ell \leq 4.5 \cdot 10^{+172}\right) \land \ell \leq 1.3 \cdot 10^{+194}:\\
\;\;\;\;\left(J \cdot \left(\ell \cdot {K}^{2}\right)\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\end{array}
\end{array}
if l < -8.4999999999999999e-6Initial program 99.7%
Taylor expanded in l around 0 83.8%
distribute-rgt-in83.8%
fma-define83.8%
associate-*l*83.8%
pow-plus83.8%
metadata-eval83.8%
Simplified83.8%
Taylor expanded in K around 0 74.2%
Taylor expanded in U around 0 74.1%
if -8.4999999999999999e-6 < l < 1750Initial program 70.8%
Taylor expanded in l around 0 98.3%
*-commutative98.3%
associate-*r*98.3%
associate-*l*98.3%
*-commutative98.3%
associate-*r*98.3%
*-commutative98.3%
Simplified98.3%
if 1750 < l < 3.69999999999999973e73Initial program 100.0%
Applied egg-rr37.0%
if 3.69999999999999973e73 < l < 4.3e83 or 4.5000000000000002e172 < l < 1.2999999999999999e194Initial program 100.0%
Taylor expanded in l around 0 51.9%
Taylor expanded in K around 0 87.6%
Taylor expanded in K around inf 87.6%
*-commutative87.6%
*-commutative87.6%
Simplified87.6%
if 4.3e83 < l < 4.5000000000000002e172 or 1.2999999999999999e194 < l Initial program 100.0%
Taylor expanded in l around 0 95.0%
distribute-rgt-in95.0%
fma-define95.0%
associate-*l*95.0%
pow-plus95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in K around 0 73.4%
Taylor expanded in l around inf 73.4%
*-commutative73.4%
*-commutative73.4%
associate-*r*73.4%
Simplified73.4%
Final simplification85.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -8.5e-6)
(* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))
(if (<= l 850.0)
(+ U (* (cos (/ K 2.0)) (* l (* J 2.0))))
(if (<= l 2.05e+72)
(* U (- U -4.0))
(if (or (<= l 6.5e+83) (and (not (<= l 2.8e+172)) (<= l 1.3e+194)))
(* (* J (* l (pow K 2.0))) -0.25)
(+ U (* (pow l 3.0) (* J 0.3333333333333333))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -8.5e-6) {
tmp = J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0));
} else if (l <= 850.0) {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 2.05e+72) {
tmp = U * (U - -4.0);
} else if ((l <= 6.5e+83) || (!(l <= 2.8e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * pow(K, 2.0))) * -0.25;
} else {
tmp = U + (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) :: tmp
if (l <= (-8.5d-6)) then
tmp = j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))
else if (l <= 850.0d0) then
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
else if (l <= 2.05d+72) then
tmp = u * (u - (-4.0d0))
else if ((l <= 6.5d+83) .or. (.not. (l <= 2.8d+172)) .and. (l <= 1.3d+194)) then
tmp = (j * (l * (k ** 2.0d0))) * (-0.25d0)
else
tmp = u + ((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 tmp;
if (l <= -8.5e-6) {
tmp = J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0));
} else if (l <= 850.0) {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 2.05e+72) {
tmp = U * (U - -4.0);
} else if ((l <= 6.5e+83) || (!(l <= 2.8e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * Math.pow(K, 2.0))) * -0.25;
} else {
tmp = U + (Math.pow(l, 3.0) * (J * 0.3333333333333333));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -8.5e-6: tmp = J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)) elif l <= 850.0: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) elif l <= 2.05e+72: tmp = U * (U - -4.0) elif (l <= 6.5e+83) or (not (l <= 2.8e+172) and (l <= 1.3e+194)): tmp = (J * (l * math.pow(K, 2.0))) * -0.25 else: tmp = U + (math.pow(l, 3.0) * (J * 0.3333333333333333)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -8.5e-6) tmp = Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))); elseif (l <= 850.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); elseif (l <= 2.05e+72) tmp = Float64(U * Float64(U - -4.0)); elseif ((l <= 6.5e+83) || (!(l <= 2.8e+172) && (l <= 1.3e+194))) tmp = Float64(Float64(J * Float64(l * (K ^ 2.0))) * -0.25); else tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -8.5e-6) tmp = J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)); elseif (l <= 850.0) tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); elseif (l <= 2.05e+72) tmp = U * (U - -4.0); elseif ((l <= 6.5e+83) || (~((l <= 2.8e+172)) && (l <= 1.3e+194))) tmp = (J * (l * (K ^ 2.0))) * -0.25; else tmp = U + ((l ^ 3.0) * (J * 0.3333333333333333)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -8.5e-6], N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 850.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.05e+72], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 6.5e+83], And[N[Not[LessEqual[l, 2.8e+172]], $MachinePrecision], LessEqual[l, 1.3e+194]]], N[(N[(J * N[(l * N[Power[K, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 850:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 2.05 \cdot 10^{+72}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 6.5 \cdot 10^{+83} \lor \neg \left(\ell \leq 2.8 \cdot 10^{+172}\right) \land \ell \leq 1.3 \cdot 10^{+194}:\\
\;\;\;\;\left(J \cdot \left(\ell \cdot {K}^{2}\right)\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\end{array}
\end{array}
if l < -8.4999999999999999e-6Initial program 99.7%
Taylor expanded in l around 0 83.8%
distribute-rgt-in83.8%
fma-define83.8%
associate-*l*83.8%
pow-plus83.8%
metadata-eval83.8%
Simplified83.8%
Taylor expanded in K around 0 74.2%
Taylor expanded in U around 0 74.1%
if -8.4999999999999999e-6 < l < 850Initial program 70.8%
Taylor expanded in l around 0 98.4%
associate-*r*98.4%
*-commutative98.4%
Simplified98.4%
if 850 < l < 2.04999999999999982e72Initial program 100.0%
Applied egg-rr37.0%
if 2.04999999999999982e72 < l < 6.5000000000000003e83 or 2.8e172 < l < 1.2999999999999999e194Initial program 100.0%
Taylor expanded in l around 0 51.9%
Taylor expanded in K around 0 87.6%
Taylor expanded in K around inf 87.6%
*-commutative87.6%
*-commutative87.6%
Simplified87.6%
if 6.5000000000000003e83 < l < 2.8e172 or 1.2999999999999999e194 < l Initial program 100.0%
Taylor expanded in l around 0 95.0%
distribute-rgt-in95.0%
fma-define95.0%
associate-*l*95.0%
pow-plus95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in K around 0 73.4%
Taylor expanded in l around inf 73.4%
*-commutative73.4%
*-commutative73.4%
associate-*r*73.4%
Simplified73.4%
Final simplification85.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (pow l 3.0) (* J 0.3333333333333333))))
(if (<= l -1.7e+35)
(* U (+ 1.0 (/ t_0 U)))
(if (<= l 6600000.0)
(+ U (* (cos (/ K 2.0)) (* l (* J 2.0))))
(if (<= l 3.55e+74)
(* U (- U -4.0))
(if (or (<= l 4.3e+83) (and (not (<= l 4.5e+172)) (<= l 1.3e+194)))
(* (* J (* l (pow K 2.0))) -0.25)
(+ U t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = pow(l, 3.0) * (J * 0.3333333333333333);
double tmp;
if (l <= -1.7e+35) {
tmp = U * (1.0 + (t_0 / U));
} else if (l <= 6600000.0) {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 3.55e+74) {
tmp = U * (U - -4.0);
} else if ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * pow(K, 2.0))) * -0.25;
} else {
tmp = U + 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 = (l ** 3.0d0) * (j * 0.3333333333333333d0)
if (l <= (-1.7d+35)) then
tmp = u * (1.0d0 + (t_0 / u))
else if (l <= 6600000.0d0) then
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
else if (l <= 3.55d+74) then
tmp = u * (u - (-4.0d0))
else if ((l <= 4.3d+83) .or. (.not. (l <= 4.5d+172)) .and. (l <= 1.3d+194)) then
tmp = (j * (l * (k ** 2.0d0))) * (-0.25d0)
else
tmp = u + t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.pow(l, 3.0) * (J * 0.3333333333333333);
double tmp;
if (l <= -1.7e+35) {
tmp = U * (1.0 + (t_0 / U));
} else if (l <= 6600000.0) {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 3.55e+74) {
tmp = U * (U - -4.0);
} else if ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) {
tmp = (J * (l * Math.pow(K, 2.0))) * -0.25;
} else {
tmp = U + t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.pow(l, 3.0) * (J * 0.3333333333333333) tmp = 0 if l <= -1.7e+35: tmp = U * (1.0 + (t_0 / U)) elif l <= 6600000.0: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) elif l <= 3.55e+74: tmp = U * (U - -4.0) elif (l <= 4.3e+83) or (not (l <= 4.5e+172) and (l <= 1.3e+194)): tmp = (J * (l * math.pow(K, 2.0))) * -0.25 else: tmp = U + t_0 return tmp
function code(J, l, K, U) t_0 = Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)) tmp = 0.0 if (l <= -1.7e+35) tmp = Float64(U * Float64(1.0 + Float64(t_0 / U))); elseif (l <= 6600000.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); elseif (l <= 3.55e+74) tmp = Float64(U * Float64(U - -4.0)); elseif ((l <= 4.3e+83) || (!(l <= 4.5e+172) && (l <= 1.3e+194))) tmp = Float64(Float64(J * Float64(l * (K ^ 2.0))) * -0.25); else tmp = Float64(U + t_0); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (l ^ 3.0) * (J * 0.3333333333333333); tmp = 0.0; if (l <= -1.7e+35) tmp = U * (1.0 + (t_0 / U)); elseif (l <= 6600000.0) tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); elseif (l <= 3.55e+74) tmp = U * (U - -4.0); elseif ((l <= 4.3e+83) || (~((l <= 4.5e+172)) && (l <= 1.3e+194))) tmp = (J * (l * (K ^ 2.0))) * -0.25; else tmp = U + t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.7e+35], N[(U * N[(1.0 + N[(t$95$0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6600000.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.55e+74], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 4.3e+83], And[N[Not[LessEqual[l, 4.5e+172]], $MachinePrecision], LessEqual[l, 1.3e+194]]], N[(N[(J * N[(l * N[Power[K, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], N[(U + t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{+35}:\\
\;\;\;\;U \cdot \left(1 + \frac{t\_0}{U}\right)\\
\mathbf{elif}\;\ell \leq 6600000:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 3.55 \cdot 10^{+74}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 4.3 \cdot 10^{+83} \lor \neg \left(\ell \leq 4.5 \cdot 10^{+172}\right) \land \ell \leq 1.3 \cdot 10^{+194}:\\
\;\;\;\;\left(J \cdot \left(\ell \cdot {K}^{2}\right)\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;U + t\_0\\
\end{array}
\end{array}
if l < -1.7000000000000001e35Initial program 100.0%
Taylor expanded in l around 0 88.8%
distribute-rgt-in88.8%
fma-define88.8%
associate-*l*88.8%
pow-plus88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in K around 0 78.5%
Taylor expanded in U around inf 83.3%
Taylor expanded in l around inf 83.3%
*-commutative78.5%
*-commutative78.5%
associate-*r*78.5%
Simplified83.3%
if -1.7000000000000001e35 < l < 6.6e6Initial program 71.7%
Taylor expanded in l around 0 95.5%
associate-*r*95.5%
*-commutative95.5%
Simplified95.5%
if 6.6e6 < l < 3.55000000000000001e74Initial program 100.0%
Applied egg-rr37.0%
if 3.55000000000000001e74 < l < 4.3e83 or 4.5000000000000002e172 < l < 1.2999999999999999e194Initial program 100.0%
Taylor expanded in l around 0 51.9%
Taylor expanded in K around 0 87.6%
Taylor expanded in K around inf 87.6%
*-commutative87.6%
*-commutative87.6%
Simplified87.6%
if 4.3e83 < l < 4.5000000000000002e172 or 1.2999999999999999e194 < l Initial program 100.0%
Taylor expanded in l around 0 95.0%
distribute-rgt-in95.0%
fma-define95.0%
associate-*l*95.0%
pow-plus95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in K around 0 73.4%
Taylor expanded in l around inf 73.4%
*-commutative73.4%
*-commutative73.4%
associate-*r*73.4%
Simplified73.4%
Final simplification86.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (pow l 3.0) (* J 0.3333333333333333))))
(if (<= l -2.15e+32)
(* U (+ 1.0 (/ t_0 U)))
(if (<= l 0.000175)
(+ U (* (cos (/ K 2.0)) (* l (* J 2.0))))
(if (<= l 1.45e+208)
(+ U (* 2.0 (* J (+ l (* -0.125 (* l (pow K 2.0)))))))
(+ U t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = pow(l, 3.0) * (J * 0.3333333333333333);
double tmp;
if (l <= -2.15e+32) {
tmp = U * (1.0 + (t_0 / U));
} else if (l <= 0.000175) {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 1.45e+208) {
tmp = U + (2.0 * (J * (l + (-0.125 * (l * pow(K, 2.0))))));
} else {
tmp = U + 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 = (l ** 3.0d0) * (j * 0.3333333333333333d0)
if (l <= (-2.15d+32)) then
tmp = u * (1.0d0 + (t_0 / u))
else if (l <= 0.000175d0) then
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
else if (l <= 1.45d+208) then
tmp = u + (2.0d0 * (j * (l + ((-0.125d0) * (l * (k ** 2.0d0))))))
else
tmp = u + t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.pow(l, 3.0) * (J * 0.3333333333333333);
double tmp;
if (l <= -2.15e+32) {
tmp = U * (1.0 + (t_0 / U));
} else if (l <= 0.000175) {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 1.45e+208) {
tmp = U + (2.0 * (J * (l + (-0.125 * (l * Math.pow(K, 2.0))))));
} else {
tmp = U + t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.pow(l, 3.0) * (J * 0.3333333333333333) tmp = 0 if l <= -2.15e+32: tmp = U * (1.0 + (t_0 / U)) elif l <= 0.000175: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) elif l <= 1.45e+208: tmp = U + (2.0 * (J * (l + (-0.125 * (l * math.pow(K, 2.0)))))) else: tmp = U + t_0 return tmp
function code(J, l, K, U) t_0 = Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)) tmp = 0.0 if (l <= -2.15e+32) tmp = Float64(U * Float64(1.0 + Float64(t_0 / U))); elseif (l <= 0.000175) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); elseif (l <= 1.45e+208) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l + Float64(-0.125 * Float64(l * (K ^ 2.0))))))); else tmp = Float64(U + t_0); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (l ^ 3.0) * (J * 0.3333333333333333); tmp = 0.0; if (l <= -2.15e+32) tmp = U * (1.0 + (t_0 / U)); elseif (l <= 0.000175) tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); elseif (l <= 1.45e+208) tmp = U + (2.0 * (J * (l + (-0.125 * (l * (K ^ 2.0)))))); else tmp = U + t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.15e+32], N[(U * N[(1.0 + N[(t$95$0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.000175], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.45e+208], N[(U + N[(2.0 * N[(J * N[(l + N[(-0.125 * N[(l * N[Power[K, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{if}\;\ell \leq -2.15 \cdot 10^{+32}:\\
\;\;\;\;U \cdot \left(1 + \frac{t\_0}{U}\right)\\
\mathbf{elif}\;\ell \leq 0.000175:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{+208}:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell + -0.125 \cdot \left(\ell \cdot {K}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t\_0\\
\end{array}
\end{array}
if l < -2.1499999999999999e32Initial program 100.0%
Taylor expanded in l around 0 88.8%
distribute-rgt-in88.8%
fma-define88.8%
associate-*l*88.8%
pow-plus88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in K around 0 78.5%
Taylor expanded in U around inf 83.3%
Taylor expanded in l around inf 83.3%
*-commutative78.5%
*-commutative78.5%
associate-*r*78.5%
Simplified83.3%
if -2.1499999999999999e32 < l < 1.74999999999999998e-4Initial program 71.0%
Taylor expanded in l around 0 96.9%
associate-*r*96.9%
*-commutative96.9%
Simplified96.9%
if 1.74999999999999998e-4 < l < 1.45000000000000004e208Initial program 99.6%
Taylor expanded in l around 0 25.5%
Taylor expanded in K around 0 49.1%
if 1.45000000000000004e208 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
distribute-rgt-in100.0%
fma-define100.0%
associate-*l*100.0%
pow-plus100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in K around 0 89.5%
Taylor expanded in l around inf 89.5%
*-commutative89.5%
*-commutative89.5%
associate-*r*89.5%
Simplified89.5%
Final simplification85.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -9500000000000.0)
(* J (* 0.3333333333333333 (pow l 3.0)))
(if (<= l 1650.0)
(fma J (* l 2.0) U)
(if (<= l 1.3e+146)
(* U (- U -4.0))
(+ U (* (pow l 3.0) (* J 0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -9500000000000.0) {
tmp = J * (0.3333333333333333 * pow(l, 3.0));
} else if (l <= 1650.0) {
tmp = fma(J, (l * 2.0), U);
} else if (l <= 1.3e+146) {
tmp = U * (U - -4.0);
} else {
tmp = U + (pow(l, 3.0) * (J * 0.3333333333333333));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -9500000000000.0) tmp = Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))); elseif (l <= 1650.0) tmp = fma(J, Float64(l * 2.0), U); elseif (l <= 1.3e+146) tmp = Float64(U * Float64(U - -4.0)); else tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -9500000000000.0], N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1650.0], N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 1.3e+146], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9500000000000:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\\
\mathbf{elif}\;\ell \leq 1650:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+146}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{else}:\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\end{array}
\end{array}
if l < -9.5e12Initial program 100.0%
Taylor expanded in l around 0 86.0%
distribute-rgt-in86.0%
fma-define86.0%
associate-*l*86.0%
pow-plus86.0%
metadata-eval86.0%
Simplified86.0%
Taylor expanded in K around 0 76.0%
Taylor expanded in U around inf 80.6%
Taylor expanded in l around inf 76.0%
associate-*r*76.0%
*-commutative76.0%
associate-*r*76.0%
Simplified76.0%
if -9.5e12 < l < 1650Initial program 71.3%
Taylor expanded in l around 0 96.8%
Taylor expanded in K around 0 83.2%
+-commutative83.2%
*-commutative83.2%
associate-*l*83.2%
*-commutative83.2%
fma-define83.2%
*-commutative83.2%
Simplified83.2%
if 1650 < l < 1.30000000000000007e146Initial program 100.0%
Applied egg-rr41.7%
if 1.30000000000000007e146 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
distribute-rgt-in100.0%
fma-define100.0%
associate-*l*100.0%
pow-plus100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in K around 0 75.0%
Taylor expanded in l around inf 75.0%
*-commutative75.0%
*-commutative75.0%
associate-*r*75.0%
Simplified75.0%
Final simplification76.1%
(FPCore (J l K U)
:precision binary64
(if (<= l -8.5e-6)
(* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))
(if (<= l 980000.0)
(fma J (* l 2.0) U)
(if (<= l 1.3e+146)
(* U (- U -4.0))
(+ U (* (pow l 3.0) (* J 0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -8.5e-6) {
tmp = J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0));
} else if (l <= 980000.0) {
tmp = fma(J, (l * 2.0), U);
} else if (l <= 1.3e+146) {
tmp = U * (U - -4.0);
} else {
tmp = U + (pow(l, 3.0) * (J * 0.3333333333333333));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -8.5e-6) tmp = Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))); elseif (l <= 980000.0) tmp = fma(J, Float64(l * 2.0), U); elseif (l <= 1.3e+146) tmp = Float64(U * Float64(U - -4.0)); else tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -8.5e-6], N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 980000.0], N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 1.3e+146], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 980000:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+146}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{else}:\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\end{array}
\end{array}
if l < -8.4999999999999999e-6Initial program 99.7%
Taylor expanded in l around 0 83.8%
distribute-rgt-in83.8%
fma-define83.8%
associate-*l*83.8%
pow-plus83.8%
metadata-eval83.8%
Simplified83.8%
Taylor expanded in K around 0 74.2%
Taylor expanded in U around 0 74.1%
if -8.4999999999999999e-6 < l < 9.8e5Initial program 70.8%
Taylor expanded in l around 0 98.3%
Taylor expanded in K around 0 84.3%
+-commutative84.3%
*-commutative84.3%
associate-*l*84.3%
*-commutative84.3%
fma-define84.4%
*-commutative84.4%
Simplified84.4%
if 9.8e5 < l < 1.30000000000000007e146Initial program 100.0%
Applied egg-rr41.7%
if 1.30000000000000007e146 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
distribute-rgt-in100.0%
fma-define100.0%
associate-*l*100.0%
pow-plus100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in K around 0 75.0%
Taylor expanded in l around inf 75.0%
*-commutative75.0%
*-commutative75.0%
associate-*r*75.0%
Simplified75.0%
Final simplification76.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* 0.3333333333333333 (pow l 3.0)))))
(if (<= l -650000000000.0)
t_0
(if (<= l 1050.0)
(fma J (* l 2.0) U)
(if (<= l 1.3e+146) (* U (- U -4.0)) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * pow(l, 3.0));
double tmp;
if (l <= -650000000000.0) {
tmp = t_0;
} else if (l <= 1050.0) {
tmp = fma(J, (l * 2.0), U);
} else if (l <= 1.3e+146) {
tmp = U * (U - -4.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))) tmp = 0.0 if (l <= -650000000000.0) tmp = t_0; elseif (l <= 1050.0) tmp = fma(J, Float64(l * 2.0), U); elseif (l <= 1.3e+146) tmp = Float64(U * Float64(U - -4.0)); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -650000000000.0], t$95$0, If[LessEqual[l, 1050.0], N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 1.3e+146], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\\
\mathbf{if}\;\ell \leq -650000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1050:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+146}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -6.5e11 or 1.30000000000000007e146 < l Initial program 100.0%
Taylor expanded in l around 0 90.8%
distribute-rgt-in90.8%
fma-define90.8%
associate-*l*90.8%
pow-plus90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in K around 0 75.6%
Taylor expanded in U around inf 78.7%
Taylor expanded in l around inf 75.7%
associate-*r*75.7%
*-commutative75.7%
associate-*r*75.7%
Simplified75.7%
if -6.5e11 < l < 1050Initial program 71.3%
Taylor expanded in l around 0 96.8%
Taylor expanded in K around 0 83.2%
+-commutative83.2%
*-commutative83.2%
associate-*l*83.2%
*-commutative83.2%
fma-define83.2%
*-commutative83.2%
Simplified83.2%
if 1050 < l < 1.30000000000000007e146Initial program 100.0%
Applied egg-rr41.7%
Final simplification76.1%
(FPCore (J l K U) :precision binary64 (if (or (<= l 2050000000.0) (not (<= l 1.3e+146))) (* U (+ 1.0 (* 2.0 (* J (/ l U))))) (* U (- U -4.0))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= 2050000000.0) || !(l <= 1.3e+146)) {
tmp = U * (1.0 + (2.0 * (J * (l / U))));
} else {
tmp = U * (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 <= 2050000000.0d0) .or. (.not. (l <= 1.3d+146))) then
tmp = u * (1.0d0 + (2.0d0 * (j * (l / u))))
else
tmp = u * (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 <= 2050000000.0) || !(l <= 1.3e+146)) {
tmp = U * (1.0 + (2.0 * (J * (l / U))));
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= 2050000000.0) or not (l <= 1.3e+146): tmp = U * (1.0 + (2.0 * (J * (l / U)))) else: tmp = U * (U - -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= 2050000000.0) || !(l <= 1.3e+146)) tmp = Float64(U * Float64(1.0 + Float64(2.0 * Float64(J * Float64(l / U))))); else tmp = Float64(U * Float64(U - -4.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= 2050000000.0) || ~((l <= 1.3e+146))) tmp = U * (1.0 + (2.0 * (J * (l / U)))); else tmp = U * (U - -4.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, 2050000000.0], N[Not[LessEqual[l, 1.3e+146]], $MachinePrecision]], N[(U * N[(1.0 + N[(2.0 * N[(J * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2050000000 \lor \neg \left(\ell \leq 1.3 \cdot 10^{+146}\right):\\
\;\;\;\;U \cdot \left(1 + 2 \cdot \left(J \cdot \frac{\ell}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\end{array}
\end{array}
if l < 2.05e9 or 1.30000000000000007e146 < l Initial program 82.9%
Taylor expanded in l around 0 94.7%
distribute-rgt-in94.7%
fma-define94.7%
associate-*l*94.7%
pow-plus94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in K around 0 80.4%
Taylor expanded in U around inf 80.8%
Taylor expanded in l around 0 64.6%
associate-/l*68.8%
Simplified68.8%
if 2.05e9 < l < 1.30000000000000007e146Initial program 100.0%
Applied egg-rr41.7%
Final simplification65.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* 2.0 (* l J))))
(if (<= l -3.1e-9)
t_0
(if (<= l 500.0) U (if (<= l 1.8e+146) (* U U) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (l * J);
double tmp;
if (l <= -3.1e-9) {
tmp = t_0;
} else if (l <= 500.0) {
tmp = U;
} else if (l <= 1.8e+146) {
tmp = U * U;
} 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 = 2.0d0 * (l * j)
if (l <= (-3.1d-9)) then
tmp = t_0
else if (l <= 500.0d0) then
tmp = u
else if (l <= 1.8d+146) then
tmp = u * u
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 = 2.0 * (l * J);
double tmp;
if (l <= -3.1e-9) {
tmp = t_0;
} else if (l <= 500.0) {
tmp = U;
} else if (l <= 1.8e+146) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = 2.0 * (l * J) tmp = 0 if l <= -3.1e-9: tmp = t_0 elif l <= 500.0: tmp = U elif l <= 1.8e+146: tmp = U * U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(2.0 * Float64(l * J)) tmp = 0.0 if (l <= -3.1e-9) tmp = t_0; elseif (l <= 500.0) tmp = U; elseif (l <= 1.8e+146) tmp = Float64(U * U); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 2.0 * (l * J); tmp = 0.0; if (l <= -3.1e-9) tmp = t_0; elseif (l <= 500.0) tmp = U; elseif (l <= 1.8e+146) tmp = U * U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.1e-9], t$95$0, If[LessEqual[l, 500.0], U, If[LessEqual[l, 1.8e+146], N[(U * U), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{if}\;\ell \leq -3.1 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 500:\\
\;\;\;\;U\\
\mathbf{elif}\;\ell \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -3.10000000000000005e-9 or 1.7999999999999999e146 < l Initial program 99.4%
Taylor expanded in l around 0 39.6%
Taylor expanded in J around inf 43.4%
Taylor expanded in J around inf 39.7%
associate-*r*39.7%
Simplified39.7%
Taylor expanded in K around 0 32.1%
if -3.10000000000000005e-9 < l < 500Initial program 70.9%
Taylor expanded in J around 0 68.8%
if 500 < l < 1.7999999999999999e146Initial program 100.0%
Applied egg-rr41.6%
Final simplification52.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* 2.0 (* l J))))
(if (<= l -3.1e-9)
t_0
(if (<= l 760.0) U (if (<= l 1.3e+146) (* U (- U -4.0)) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (l * J);
double tmp;
if (l <= -3.1e-9) {
tmp = t_0;
} else if (l <= 760.0) {
tmp = U;
} else if (l <= 1.3e+146) {
tmp = U * (U - -4.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 = 2.0d0 * (l * j)
if (l <= (-3.1d-9)) then
tmp = t_0
else if (l <= 760.0d0) then
tmp = u
else if (l <= 1.3d+146) then
tmp = u * (u - (-4.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 = 2.0 * (l * J);
double tmp;
if (l <= -3.1e-9) {
tmp = t_0;
} else if (l <= 760.0) {
tmp = U;
} else if (l <= 1.3e+146) {
tmp = U * (U - -4.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = 2.0 * (l * J) tmp = 0 if l <= -3.1e-9: tmp = t_0 elif l <= 760.0: tmp = U elif l <= 1.3e+146: tmp = U * (U - -4.0) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(2.0 * Float64(l * J)) tmp = 0.0 if (l <= -3.1e-9) tmp = t_0; elseif (l <= 760.0) tmp = U; elseif (l <= 1.3e+146) tmp = Float64(U * Float64(U - -4.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 2.0 * (l * J); tmp = 0.0; if (l <= -3.1e-9) tmp = t_0; elseif (l <= 760.0) tmp = U; elseif (l <= 1.3e+146) tmp = U * (U - -4.0); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.1e-9], t$95$0, If[LessEqual[l, 760.0], U, If[LessEqual[l, 1.3e+146], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{if}\;\ell \leq -3.1 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 760:\\
\;\;\;\;U\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+146}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -3.10000000000000005e-9 or 1.30000000000000007e146 < l Initial program 99.4%
Taylor expanded in l around 0 39.6%
Taylor expanded in J around inf 43.4%
Taylor expanded in J around inf 39.7%
associate-*r*39.7%
Simplified39.7%
Taylor expanded in K around 0 32.1%
if -3.10000000000000005e-9 < l < 760Initial program 70.9%
Taylor expanded in J around 0 68.8%
if 760 < l < 1.30000000000000007e146Initial program 100.0%
Applied egg-rr41.7%
Final simplification52.0%
(FPCore (J l K U) :precision binary64 (if (<= l 520.0) (+ U (* J (* l 2.0))) (if (<= l 1.55e+146) (* U (- U -4.0)) (* J (+ (* l 2.0) (/ U J))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 520.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 1.55e+146) {
tmp = U * (U - -4.0);
} else {
tmp = J * ((l * 2.0) + (U / 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 <= 520.0d0) then
tmp = u + (j * (l * 2.0d0))
else if (l <= 1.55d+146) then
tmp = u * (u - (-4.0d0))
else
tmp = j * ((l * 2.0d0) + (u / j))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 520.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 1.55e+146) {
tmp = U * (U - -4.0);
} else {
tmp = J * ((l * 2.0) + (U / J));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 520.0: tmp = U + (J * (l * 2.0)) elif l <= 1.55e+146: tmp = U * (U - -4.0) else: tmp = J * ((l * 2.0) + (U / J)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 520.0) tmp = Float64(U + Float64(J * Float64(l * 2.0))); elseif (l <= 1.55e+146) tmp = Float64(U * Float64(U - -4.0)); else tmp = Float64(J * Float64(Float64(l * 2.0) + Float64(U / J))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 520.0) tmp = U + (J * (l * 2.0)); elseif (l <= 1.55e+146) tmp = U * (U - -4.0); else tmp = J * ((l * 2.0) + (U / J)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 520.0], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.55e+146], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], N[(J * N[(N[(l * 2.0), $MachinePrecision] + N[(U / J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 520:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 1.55 \cdot 10^{+146}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\ell \cdot 2 + \frac{U}{J}\right)\\
\end{array}
\end{array}
if l < 520Initial program 80.2%
Taylor expanded in l around 0 78.4%
Taylor expanded in K around 0 66.9%
+-commutative66.9%
*-commutative66.9%
associate-*r*66.9%
Simplified66.9%
if 520 < l < 1.5500000000000001e146Initial program 100.0%
Applied egg-rr41.7%
if 1.5500000000000001e146 < l Initial program 100.0%
Taylor expanded in l around 0 43.0%
Taylor expanded in J around inf 48.8%
Taylor expanded in K around 0 39.3%
Final simplification60.8%
(FPCore (J l K U) :precision binary64 (if (<= l 1100.0) (+ U (* J (* l 2.0))) (if (<= l 1.45e+146) (* U (- U -4.0)) (* 2.0 (* l J)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1100.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 1.45e+146) {
tmp = U * (U - -4.0);
} else {
tmp = 2.0 * (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 <= 1100.0d0) then
tmp = u + (j * (l * 2.0d0))
else if (l <= 1.45d+146) then
tmp = u * (u - (-4.0d0))
else
tmp = 2.0d0 * (l * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1100.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 1.45e+146) {
tmp = U * (U - -4.0);
} else {
tmp = 2.0 * (l * J);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1100.0: tmp = U + (J * (l * 2.0)) elif l <= 1.45e+146: tmp = U * (U - -4.0) else: tmp = 2.0 * (l * J) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1100.0) tmp = Float64(U + Float64(J * Float64(l * 2.0))); elseif (l <= 1.45e+146) tmp = Float64(U * Float64(U - -4.0)); else tmp = Float64(2.0 * Float64(l * J)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1100.0) tmp = U + (J * (l * 2.0)); elseif (l <= 1.45e+146) tmp = U * (U - -4.0); else tmp = 2.0 * (l * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1100.0], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.45e+146], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1100:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{+146}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot J\right)\\
\end{array}
\end{array}
if l < 1100Initial program 80.2%
Taylor expanded in l around 0 78.4%
Taylor expanded in K around 0 66.9%
+-commutative66.9%
*-commutative66.9%
associate-*r*66.9%
Simplified66.9%
if 1100 < l < 1.4499999999999999e146Initial program 100.0%
Applied egg-rr41.7%
if 1.4499999999999999e146 < l Initial program 100.0%
Taylor expanded in l around 0 43.0%
Taylor expanded in J around inf 48.8%
Taylor expanded in J around inf 43.3%
associate-*r*43.3%
Simplified43.3%
Taylor expanded in K around 0 33.5%
Final simplification60.0%
(FPCore (J l K U) :precision binary64 (if (or (<= l -1020000000.0) (not (<= l 14000.0))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1020000000.0) || !(l <= 14000.0)) {
tmp = U * U;
} else {
tmp = 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 <= (-1020000000.0d0)) .or. (.not. (l <= 14000.0d0))) then
tmp = u * u
else
tmp = u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1020000000.0) || !(l <= 14000.0)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -1020000000.0) or not (l <= 14000.0): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -1020000000.0) || !(l <= 14000.0)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -1020000000.0) || ~((l <= 14000.0))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -1020000000.0], N[Not[LessEqual[l, 14000.0]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1020000000 \lor \neg \left(\ell \leq 14000\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -1.02e9 or 14000 < l Initial program 100.0%
Applied egg-rr20.2%
if -1.02e9 < l < 14000Initial program 71.1%
Taylor expanded in J around 0 67.3%
Final simplification45.1%
(FPCore (J l K U) :precision binary64 1.0)
double code(double J, double l, double K, double U) {
return 1.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 = 1.0d0
end function
public static double code(double J, double l, double K, double U) {
return 1.0;
}
def code(J, l, K, U): return 1.0
function code(J, l, K, U) return 1.0 end
function tmp = code(J, l, K, U) tmp = 1.0; end
code[J_, l_, K_, U_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 84.7%
Applied egg-rr2.9%
*-inverses2.9%
Simplified2.9%
Final simplification2.9%
(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.7%
Taylor expanded in J around 0 36.6%
Final simplification36.6%
herbie shell --seed 2024075
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))