
(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 21 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)))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 5e-10)))
(+ (* (cos (/ K 2.0)) (* t_0 J)) U)
(+
U
(*
(* J (cos (* K 0.5)))
(fma 0.3333333333333333 (pow l 3.0) (* l 2.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 5e-10)) {
tmp = (cos((K / 2.0)) * (t_0 * J)) + U;
} else {
tmp = U + ((J * cos((K * 0.5))) * fma(0.3333333333333333, pow(l, 3.0), (l * 2.0)));
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 5e-10)) tmp = Float64(Float64(cos(Float64(K / 2.0)) * Float64(t_0 * J)) + U); else tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * fma(0.3333333333333333, (l ^ 3.0), Float64(l * 2.0)))); end return 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, (-Infinity)], N[Not[LessEqual[t$95$0, 5e-10]], $MachinePrecision]], N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 5 \cdot 10^{-10}\right):\\
\;\;\;\;\cos \left(\frac{K}{2}\right) \cdot \left(t_0 \cdot J\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \mathsf{fma}\left(0.3333333333333333, {\ell}^{3}, \ell \cdot 2\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 5.00000000000000031e-10 < (-.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.00000000000000031e-10Initial program 71.8%
Taylor expanded in l around 0 99.9%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in J around 0 99.9%
*-commutative99.9%
fma-def99.9%
*-commutative99.9%
associate-*r*100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 5e-10)))
(+ (* (cos (/ K 2.0)) (* t_0 J)) U)
(+
U
(*
J
(* (cos (* K 0.5)) (fma 0.3333333333333333 (pow l 3.0) (* l 2.0))))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 5e-10)) {
tmp = (cos((K / 2.0)) * (t_0 * J)) + U;
} else {
tmp = U + (J * (cos((K * 0.5)) * fma(0.3333333333333333, pow(l, 3.0), (l * 2.0))));
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 5e-10)) tmp = Float64(Float64(cos(Float64(K / 2.0)) * Float64(t_0 * J)) + U); else tmp = Float64(U + Float64(J * Float64(cos(Float64(K * 0.5)) * fma(0.3333333333333333, (l ^ 3.0), Float64(l * 2.0))))); end return 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, (-Infinity)], N[Not[LessEqual[t$95$0, 5e-10]], $MachinePrecision]], N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(J * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 5 \cdot 10^{-10}\right):\\
\;\;\;\;\cos \left(\frac{K}{2}\right) \cdot \left(t_0 \cdot J\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \mathsf{fma}\left(0.3333333333333333, {\ell}^{3}, \ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 5.00000000000000031e-10 < (-.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.00000000000000031e-10Initial program 71.8%
Taylor expanded in l around 0 99.9%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 5e-10)))
(+ (* (cos (/ K 2.0)) (* t_0 J)) U)
(+ U (* (* J (cos (* K 0.5))) (* l 2.0))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 5e-10)) {
tmp = (cos((K / 2.0)) * (t_0 * J)) + U;
} else {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 5e-10)) {
tmp = (Math.cos((K / 2.0)) * (t_0 * J)) + U;
} else {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) tmp = 0 if (t_0 <= -math.inf) or not (t_0 <= 5e-10): tmp = (math.cos((K / 2.0)) * (t_0 * J)) + U else: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) return tmp
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 5e-10)) tmp = Float64(Float64(cos(Float64(K / 2.0)) * Float64(t_0 * J)) + U); else tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 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 <= -Inf) || ~((t_0 <= 5e-10))) tmp = (cos((K / 2.0)) * (t_0 * J)) + U; else tmp = U + ((J * cos((K * 0.5))) * (l * 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, (-Infinity)], N[Not[LessEqual[t$95$0, 5e-10]], $MachinePrecision]], N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 5 \cdot 10^{-10}\right):\\
\;\;\;\;\cos \left(\frac{K}{2}\right) \cdot \left(t_0 \cdot J\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 5.00000000000000031e-10 < (-.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.00000000000000031e-10Initial program 71.8%
Taylor expanded in l around 0 99.9%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in J around 0 99.9%
*-commutative99.9%
fma-def99.9%
*-commutative99.9%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.3)
(+ U (* (* J (cos (* K 0.5))) (* l 2.0)))
(if (<= t_0 -0.005)
(+ U (* (* l J) (* (* K K) -0.25)))
(+ U (* J (+ (* l 2.0) (* 0.3333333333333333 (pow l 3.0)))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.3) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else if (t_0 <= -0.005) {
tmp = U + ((l * J) * ((K * K) * -0.25));
} else {
tmp = U + (J * ((l * 2.0) + (0.3333333333333333 * 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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= (-0.3d0)) then
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
else if (t_0 <= (-0.005d0)) then
tmp = u + ((l * j) * ((k * k) * (-0.25d0)))
else
tmp = u + (j * ((l * 2.0d0) + (0.3333333333333333d0 * (l ** 3.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.3) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else if (t_0 <= -0.005) {
tmp = U + ((l * J) * ((K * K) * -0.25));
} else {
tmp = U + (J * ((l * 2.0) + (0.3333333333333333 * Math.pow(l, 3.0))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.3: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) elif t_0 <= -0.005: tmp = U + ((l * J) * ((K * K) * -0.25)) else: tmp = U + (J * ((l * 2.0) + (0.3333333333333333 * math.pow(l, 3.0)))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.3) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); elseif (t_0 <= -0.005) tmp = Float64(U + Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25))); else tmp = Float64(U + Float64(J * Float64(Float64(l * 2.0) + Float64(0.3333333333333333 * (l ^ 3.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.3) tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); elseif (t_0 <= -0.005) tmp = U + ((l * J) * ((K * K) * -0.25)); else tmp = U + (J * ((l * 2.0) + (0.3333333333333333 * (l ^ 3.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.3], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.005], N[(U + N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[(l * 2.0), $MachinePrecision] + N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t_0 \leq -0.3:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;t_0 \leq -0.005:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2 + 0.3333333333333333 \cdot {\ell}^{3}\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.299999999999999989Initial program 81.9%
Taylor expanded in l around 0 88.0%
associate-*r*88.1%
associate-*r*88.1%
associate-*r*88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r*88.1%
distribute-rgt-out88.1%
+-commutative88.1%
fma-def88.1%
Simplified88.1%
Taylor expanded in J around 0 88.0%
*-commutative88.0%
fma-def88.0%
*-commutative88.0%
associate-*r*88.1%
Simplified88.1%
Taylor expanded in l around 0 66.1%
*-commutative66.1%
Simplified66.1%
if -0.299999999999999989 < (cos.f64 (/.f64 K 2)) < -0.0050000000000000001Initial program 100.0%
Taylor expanded in l around 0 36.2%
Taylor expanded in K around 0 58.8%
+-commutative58.8%
associate-*r*58.8%
distribute-rgt-out75.5%
*-commutative75.5%
unpow275.5%
Simplified75.5%
Taylor expanded in K around inf 75.5%
*-commutative75.5%
*-commutative75.5%
*-commutative75.5%
associate-*r*75.5%
*-commutative75.5%
unpow275.5%
Simplified75.5%
if -0.0050000000000000001 < (cos.f64 (/.f64 K 2)) Initial program 85.4%
Taylor expanded in l around 0 92.1%
associate-*r*92.1%
associate-*r*92.1%
associate-*r*92.1%
associate-*r*92.1%
distribute-rgt-out92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
associate-*r*92.1%
distribute-rgt-out92.1%
+-commutative92.1%
fma-def92.1%
Simplified92.1%
Taylor expanded in K around 0 88.2%
Final simplification83.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (+ (* -0.125 (* K K)) 1.0) (* (- (exp l) (exp (- l))) J))))
(t_1 (cos (* K 0.5))))
(if (<= l -1.6e+114)
(+ U (* t_1 (* (pow l 3.0) (* J 0.3333333333333333))))
(if (<= l -58000000.0)
t_0
(if (<= l 13.2)
(+ U (* (* J t_1) (* l 2.0)))
(if (<= l 3e+68)
t_0
(+
U
(*
(cos (/ K 2.0))
(* J (+ (* l 2.0) (* 0.3333333333333333 (pow l 3.0))))))))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (((-0.125 * (K * K)) + 1.0) * ((exp(l) - exp(-l)) * J));
double t_1 = cos((K * 0.5));
double tmp;
if (l <= -1.6e+114) {
tmp = U + (t_1 * (pow(l, 3.0) * (J * 0.3333333333333333)));
} else if (l <= -58000000.0) {
tmp = t_0;
} else if (l <= 13.2) {
tmp = U + ((J * t_1) * (l * 2.0));
} else if (l <= 3e+68) {
tmp = t_0;
} else {
tmp = U + (cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = u + ((((-0.125d0) * (k * k)) + 1.0d0) * ((exp(l) - exp(-l)) * j))
t_1 = cos((k * 0.5d0))
if (l <= (-1.6d+114)) then
tmp = u + (t_1 * ((l ** 3.0d0) * (j * 0.3333333333333333d0)))
else if (l <= (-58000000.0d0)) then
tmp = t_0
else if (l <= 13.2d0) then
tmp = u + ((j * t_1) * (l * 2.0d0))
else if (l <= 3d+68) then
tmp = t_0
else
tmp = u + (cos((k / 2.0d0)) * (j * ((l * 2.0d0) + (0.3333333333333333d0 * (l ** 3.0d0)))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (((-0.125 * (K * K)) + 1.0) * ((Math.exp(l) - Math.exp(-l)) * J));
double t_1 = Math.cos((K * 0.5));
double tmp;
if (l <= -1.6e+114) {
tmp = U + (t_1 * (Math.pow(l, 3.0) * (J * 0.3333333333333333)));
} else if (l <= -58000000.0) {
tmp = t_0;
} else if (l <= 13.2) {
tmp = U + ((J * t_1) * (l * 2.0));
} else if (l <= 3e+68) {
tmp = t_0;
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * Math.pow(l, 3.0)))));
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (((-0.125 * (K * K)) + 1.0) * ((math.exp(l) - math.exp(-l)) * J)) t_1 = math.cos((K * 0.5)) tmp = 0 if l <= -1.6e+114: tmp = U + (t_1 * (math.pow(l, 3.0) * (J * 0.3333333333333333))) elif l <= -58000000.0: tmp = t_0 elif l <= 13.2: tmp = U + ((J * t_1) * (l * 2.0)) elif l <= 3e+68: tmp = t_0 else: tmp = U + (math.cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * math.pow(l, 3.0))))) return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(Float64(-0.125 * Float64(K * K)) + 1.0) * Float64(Float64(exp(l) - exp(Float64(-l))) * J))) t_1 = cos(Float64(K * 0.5)) tmp = 0.0 if (l <= -1.6e+114) tmp = Float64(U + Float64(t_1 * Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)))); elseif (l <= -58000000.0) tmp = t_0; elseif (l <= 13.2) tmp = Float64(U + Float64(Float64(J * t_1) * Float64(l * 2.0))); elseif (l <= 3e+68) tmp = t_0; else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(Float64(l * 2.0) + Float64(0.3333333333333333 * (l ^ 3.0)))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (((-0.125 * (K * K)) + 1.0) * ((exp(l) - exp(-l)) * J)); t_1 = cos((K * 0.5)); tmp = 0.0; if (l <= -1.6e+114) tmp = U + (t_1 * ((l ^ 3.0) * (J * 0.3333333333333333))); elseif (l <= -58000000.0) tmp = t_0; elseif (l <= 13.2) tmp = U + ((J * t_1) * (l * 2.0)); elseif (l <= 3e+68) tmp = t_0; else tmp = U + (cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * (l ^ 3.0))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.6e+114], N[(U + N[(t$95$1 * N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -58000000.0], t$95$0, If[LessEqual[l, 13.2], N[(U + N[(N[(J * t$95$1), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3e+68], t$95$0, N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(N[(l * 2.0), $MachinePrecision] + N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(-0.125 \cdot \left(K \cdot K\right) + 1\right) \cdot \left(\left(e^{\ell} - e^{-\ell}\right) \cdot J\right)\\
t_1 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{+114}:\\
\;\;\;\;U + t_1 \cdot \left({\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
\mathbf{elif}\;\ell \leq -58000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 13.2:\\
\;\;\;\;U + \left(J \cdot t_1\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 3 \cdot 10^{+68}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2 + 0.3333333333333333 \cdot {\ell}^{3}\right)\right)\\
\end{array}
\end{array}
if l < -1.6e114Initial program 100.0%
Taylor expanded in l around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -1.6e114 < l < -5.8e7 or 13.199999999999999 < l < 3.0000000000000002e68Initial program 100.0%
Taylor expanded in K around 0 0.0%
associate-*r*0.0%
distribute-rgt1-in87.5%
unpow287.5%
Simplified87.5%
if -5.8e7 < l < 13.199999999999999Initial program 72.4%
Taylor expanded in l around 0 99.2%
associate-*r*99.2%
associate-*r*99.2%
associate-*r*99.2%
associate-*r*99.2%
distribute-rgt-out99.2%
*-commutative99.2%
associate-*r*99.2%
*-commutative99.2%
associate-*r*99.2%
distribute-rgt-out99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Taylor expanded in J around 0 99.2%
*-commutative99.2%
fma-def99.2%
*-commutative99.2%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in l around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 3.0000000000000002e68 < l Initial program 100.0%
Taylor expanded in l around 0 98.2%
Final simplification97.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (* K 0.5)))
(t_1 (+ U (* t_0 (* (pow l 3.0) (* J 0.3333333333333333))))))
(if (<= l -1.1e+99)
t_1
(if (<= l -0.00033)
(+ U (* (- (exp l) (exp (- l))) J))
(if (<= l 760.0)
(+ U (* (* J t_0) (* l 2.0)))
(if (<= l 9e+53) (pow U -8.0) t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K * 0.5));
double t_1 = U + (t_0 * (pow(l, 3.0) * (J * 0.3333333333333333)));
double tmp;
if (l <= -1.1e+99) {
tmp = t_1;
} else if (l <= -0.00033) {
tmp = U + ((exp(l) - exp(-l)) * J);
} else if (l <= 760.0) {
tmp = U + ((J * t_0) * (l * 2.0));
} else if (l <= 9e+53) {
tmp = pow(U, -8.0);
} 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) :: tmp
t_0 = cos((k * 0.5d0))
t_1 = u + (t_0 * ((l ** 3.0d0) * (j * 0.3333333333333333d0)))
if (l <= (-1.1d+99)) then
tmp = t_1
else if (l <= (-0.00033d0)) then
tmp = u + ((exp(l) - exp(-l)) * j)
else if (l <= 760.0d0) then
tmp = u + ((j * t_0) * (l * 2.0d0))
else if (l <= 9d+53) then
tmp = u ** (-8.0d0)
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 * 0.5));
double t_1 = U + (t_0 * (Math.pow(l, 3.0) * (J * 0.3333333333333333)));
double tmp;
if (l <= -1.1e+99) {
tmp = t_1;
} else if (l <= -0.00033) {
tmp = U + ((Math.exp(l) - Math.exp(-l)) * J);
} else if (l <= 760.0) {
tmp = U + ((J * t_0) * (l * 2.0));
} else if (l <= 9e+53) {
tmp = Math.pow(U, -8.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K * 0.5)) t_1 = U + (t_0 * (math.pow(l, 3.0) * (J * 0.3333333333333333))) tmp = 0 if l <= -1.1e+99: tmp = t_1 elif l <= -0.00033: tmp = U + ((math.exp(l) - math.exp(-l)) * J) elif l <= 760.0: tmp = U + ((J * t_0) * (l * 2.0)) elif l <= 9e+53: tmp = math.pow(U, -8.0) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K * 0.5)) t_1 = Float64(U + Float64(t_0 * Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)))) tmp = 0.0 if (l <= -1.1e+99) tmp = t_1; elseif (l <= -0.00033) tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)); elseif (l <= 760.0) tmp = Float64(U + Float64(Float64(J * t_0) * Float64(l * 2.0))); elseif (l <= 9e+53) tmp = U ^ -8.0; else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K * 0.5)); t_1 = U + (t_0 * ((l ^ 3.0) * (J * 0.3333333333333333))); tmp = 0.0; if (l <= -1.1e+99) tmp = t_1; elseif (l <= -0.00033) tmp = U + ((exp(l) - exp(-l)) * J); elseif (l <= 760.0) tmp = U + ((J * t_0) * (l * 2.0)); elseif (l <= 9e+53) tmp = U ^ -8.0; else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(t$95$0 * N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.1e+99], t$95$1, If[LessEqual[l, -0.00033], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 760.0], N[(U + N[(N[(J * t$95$0), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9e+53], N[Power[U, -8.0], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(K \cdot 0.5\right)\\
t_1 := U + t_0 \cdot \left({\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -0.00033:\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{elif}\;\ell \leq 760:\\
\;\;\;\;U + \left(J \cdot t_0\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 9 \cdot 10^{+53}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -1.09999999999999989e99 or 9.0000000000000004e53 < l Initial program 100.0%
Taylor expanded in l around 0 97.9%
associate-*r*97.9%
associate-*r*97.9%
associate-*r*97.9%
associate-*r*97.9%
distribute-rgt-out97.9%
*-commutative97.9%
associate-*r*97.9%
*-commutative97.9%
associate-*r*97.9%
distribute-rgt-out97.9%
+-commutative97.9%
fma-def97.9%
Simplified97.9%
Taylor expanded in l around inf 97.9%
*-commutative97.9%
associate-*r*97.9%
associate-*l*97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*97.9%
Simplified97.9%
if -1.09999999999999989e99 < l < -3.3e-4Initial program 100.0%
Taylor expanded in K around 0 73.7%
if -3.3e-4 < l < 760Initial program 72.2%
Taylor expanded in l around 0 99.9%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in J around 0 99.9%
*-commutative99.9%
fma-def99.9%
*-commutative99.9%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
Simplified99.9%
if 760 < l < 9.0000000000000004e53Initial program 100.0%
Applied egg-rr70.7%
Final simplification96.1%
(FPCore (J l K U) :precision binary64 (+ U (* (cos (/ K 2.0)) (* J (+ (* l 2.0) (* 0.3333333333333333 (pow l 3.0)))))))
double code(double J, double l, double K, double U) {
return U + (cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * pow(l, 3.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 + (cos((k / 2.0d0)) * (j * ((l * 2.0d0) + (0.3333333333333333d0 * (l ** 3.0d0)))))
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 * Math.pow(l, 3.0)))));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * math.pow(l, 3.0)))))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(Float64(l * 2.0) + Float64(0.3333333333333333 * (l ^ 3.0)))))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * (l ^ 3.0))))); end
code[J_, l_, K_, U_] := N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(N[(l * 2.0), $MachinePrecision] + N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2 + 0.3333333333333333 \cdot {\ell}^{3}\right)\right)
\end{array}
Initial program 85.5%
Taylor expanded in l around 0 91.0%
Final simplification91.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -5e+149)
(+
U
(*
(* J (pow l 3.0))
(+ 0.3333333333333333 (* (* K K) -0.041666666666666664))))
(if (or (<= l -0.0028) (not (<= l 0.000215)))
(+ U (* (- (exp l) (exp (- l))) J))
(+ U (* (* J (cos (* K 0.5))) (* l 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -5e+149) {
tmp = U + ((J * pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
} else if ((l <= -0.0028) || !(l <= 0.000215)) {
tmp = U + ((exp(l) - exp(-l)) * J);
} else {
tmp = U + ((J * cos((K * 0.5))) * (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) :: tmp
if (l <= (-5d+149)) then
tmp = u + ((j * (l ** 3.0d0)) * (0.3333333333333333d0 + ((k * k) * (-0.041666666666666664d0))))
else if ((l <= (-0.0028d0)) .or. (.not. (l <= 0.000215d0))) then
tmp = u + ((exp(l) - exp(-l)) * j)
else
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -5e+149) {
tmp = U + ((J * Math.pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
} else if ((l <= -0.0028) || !(l <= 0.000215)) {
tmp = U + ((Math.exp(l) - Math.exp(-l)) * J);
} else {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -5e+149: tmp = U + ((J * math.pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664))) elif (l <= -0.0028) or not (l <= 0.000215): tmp = U + ((math.exp(l) - math.exp(-l)) * J) else: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -5e+149) tmp = Float64(U + Float64(Float64(J * (l ^ 3.0)) * Float64(0.3333333333333333 + Float64(Float64(K * K) * -0.041666666666666664)))); elseif ((l <= -0.0028) || !(l <= 0.000215)) tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)); else tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -5e+149) tmp = U + ((J * (l ^ 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664))); elseif ((l <= -0.0028) || ~((l <= 0.000215))) tmp = U + ((exp(l) - exp(-l)) * J); else tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -5e+149], N[(U + N[(N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(K * K), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, -0.0028], N[Not[LessEqual[l, 0.000215]], $MachinePrecision]], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{+149}:\\
\;\;\;\;U + \left(J \cdot {\ell}^{3}\right) \cdot \left(0.3333333333333333 + \left(K \cdot K\right) \cdot -0.041666666666666664\right)\\
\mathbf{elif}\;\ell \leq -0.0028 \lor \neg \left(\ell \leq 0.000215\right):\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\end{array}
\end{array}
if l < -4.9999999999999999e149Initial program 100.0%
Taylor expanded in l around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in J around 0 100.0%
*-commutative100.0%
fma-def100.0%
*-commutative100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
Taylor expanded in K around 0 0.0%
+-commutative0.0%
associate-*r*0.0%
distribute-rgt-out83.9%
unpow283.9%
Simplified83.9%
if -4.9999999999999999e149 < l < -0.00279999999999999997 or 2.14999999999999995e-4 < l Initial program 100.0%
Taylor expanded in K around 0 79.6%
if -0.00279999999999999997 < l < 2.14999999999999995e-4Initial program 71.8%
Taylor expanded in l around 0 99.9%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in J around 0 99.9%
*-commutative99.9%
fma-def99.9%
*-commutative99.9%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification90.6%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.005) (+ U (* (* l J) (* (* K K) -0.25))) (+ U (* 0.3333333333333333 (* J (pow l 3.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.005) {
tmp = U + ((l * J) * ((K * K) * -0.25));
} else {
tmp = 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 (cos((k / 2.0d0)) <= (-0.005d0)) then
tmp = u + ((l * j) * ((k * k) * (-0.25d0)))
else
tmp = 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 (Math.cos((K / 2.0)) <= -0.005) {
tmp = U + ((l * J) * ((K * K) * -0.25));
} else {
tmp = U + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.005: tmp = U + ((l * J) * ((K * K) * -0.25)) else: tmp = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.005) tmp = Float64(U + Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25))); else tmp = 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 (cos((K / 2.0)) <= -0.005) tmp = U + ((l * J) * ((K * K) * -0.25)); else tmp = U + (0.3333333333333333 * (J * (l ^ 3.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.005], N[(U + N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.005:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.0050000000000000001Initial program 85.6%
Taylor expanded in l around 0 60.1%
Taylor expanded in K around 0 44.9%
+-commutative44.9%
associate-*r*44.9%
distribute-rgt-out58.2%
*-commutative58.2%
unpow258.2%
Simplified58.2%
Taylor expanded in K around inf 58.2%
*-commutative58.2%
*-commutative58.2%
*-commutative58.2%
associate-*r*58.2%
*-commutative58.2%
unpow258.2%
Simplified58.2%
if -0.0050000000000000001 < (cos.f64 (/.f64 K 2)) Initial program 85.4%
Taylor expanded in l around 0 92.1%
associate-*r*92.1%
associate-*r*92.1%
associate-*r*92.1%
associate-*r*92.1%
distribute-rgt-out92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
associate-*r*92.1%
distribute-rgt-out92.1%
+-commutative92.1%
fma-def92.1%
Simplified92.1%
Taylor expanded in J around 0 92.1%
*-commutative92.1%
fma-def92.1%
*-commutative92.1%
associate-*r*92.1%
Simplified92.1%
Taylor expanded in l around inf 76.9%
Taylor expanded in K around 0 76.9%
Final simplification72.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* 0.3333333333333333 (* J (pow l 3.0))))))
(if (<= l -2.6e+184)
t_0
(if (<= l -1.8e+160)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))
(if (<= l -3000000000.0)
t_0
(if (<= l 800.0)
(+ U (* J (* (cos (* K 0.5)) (* l 2.0))))
(if (<= l 2.3e+60) (pow U -8.0) t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (0.3333333333333333 * (J * pow(l, 3.0)));
double tmp;
if (l <= -2.6e+184) {
tmp = t_0;
} else if (l <= -1.8e+160) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if (l <= -3000000000.0) {
tmp = t_0;
} else if (l <= 800.0) {
tmp = U + (J * (cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 2.3e+60) {
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 + (0.3333333333333333d0 * (j * (l ** 3.0d0)))
if (l <= (-2.6d+184)) then
tmp = t_0
else if (l <= (-1.8d+160)) then
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
else if (l <= (-3000000000.0d0)) then
tmp = t_0
else if (l <= 800.0d0) then
tmp = u + (j * (cos((k * 0.5d0)) * (l * 2.0d0)))
else if (l <= 2.3d+60) 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 + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
double tmp;
if (l <= -2.6e+184) {
tmp = t_0;
} else if (l <= -1.8e+160) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if (l <= -3000000000.0) {
tmp = t_0;
} else if (l <= 800.0) {
tmp = U + (J * (Math.cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 2.3e+60) {
tmp = Math.pow(U, -8.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) tmp = 0 if l <= -2.6e+184: tmp = t_0 elif l <= -1.8e+160: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) elif l <= -3000000000.0: tmp = t_0 elif l <= 800.0: tmp = U + (J * (math.cos((K * 0.5)) * (l * 2.0))) elif l <= 2.3e+60: tmp = math.pow(U, -8.0) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))) tmp = 0.0 if (l <= -2.6e+184) tmp = t_0; elseif (l <= -1.8e+160) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); elseif (l <= -3000000000.0) tmp = t_0; elseif (l <= 800.0) tmp = Float64(U + Float64(J * Float64(cos(Float64(K * 0.5)) * Float64(l * 2.0)))); elseif (l <= 2.3e+60) tmp = U ^ -8.0; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (0.3333333333333333 * (J * (l ^ 3.0))); tmp = 0.0; if (l <= -2.6e+184) tmp = t_0; elseif (l <= -1.8e+160) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); elseif (l <= -3000000000.0) tmp = t_0; elseif (l <= 800.0) tmp = U + (J * (cos((K * 0.5)) * (l * 2.0))); elseif (l <= 2.3e+60) 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[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.6e+184], t$95$0, If[LessEqual[l, -1.8e+160], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3000000000.0], t$95$0, If[LessEqual[l, 800.0], N[(U + N[(J * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.3e+60], N[Power[U, -8.0], $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\mathbf{if}\;\ell \leq -2.6 \cdot 10^{+184}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -1.8 \cdot 10^{+160}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{elif}\;\ell \leq -3000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 800:\\
\;\;\;\;U + J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{+60}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -2.59999999999999993e184 or -1.80000000000000011e160 < l < -3e9 or 2.30000000000000017e60 < l Initial program 100.0%
Taylor expanded in l around 0 87.9%
associate-*r*87.9%
associate-*r*87.9%
associate-*r*87.9%
associate-*r*87.9%
distribute-rgt-out87.9%
*-commutative87.9%
associate-*r*87.9%
*-commutative87.9%
associate-*r*87.9%
distribute-rgt-out87.9%
+-commutative87.9%
fma-def87.9%
Simplified87.9%
Taylor expanded in J around 0 87.9%
*-commutative87.9%
fma-def87.9%
*-commutative87.9%
associate-*r*87.9%
Simplified87.9%
Taylor expanded in l around inf 87.9%
Taylor expanded in K around 0 69.2%
if -2.59999999999999993e184 < l < -1.80000000000000011e160Initial program 100.0%
Taylor expanded in l around 0 51.5%
Taylor expanded in K around 0 25.0%
+-commutative25.0%
associate-*r*25.0%
distribute-rgt-out75.0%
*-commutative75.0%
unpow275.0%
Simplified75.0%
if -3e9 < l < 800Initial program 72.6%
Taylor expanded in l around 0 98.5%
associate-*r*98.5%
associate-*r*98.5%
associate-*r*98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
*-commutative98.5%
associate-*r*98.5%
*-commutative98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
+-commutative98.5%
fma-def98.5%
Simplified98.5%
Taylor expanded in l around 0 98.4%
*-commutative98.4%
associate-*r*98.4%
Simplified98.4%
if 800 < l < 2.30000000000000017e60Initial program 100.0%
Applied egg-rr70.7%
Final simplification85.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* 0.3333333333333333 (* J (pow l 3.0))))))
(if (<= l -2.7e+184)
t_0
(if (<= l -1.8e+160)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))
(if (<= l -8500000000.0)
t_0
(if (<= l 550.0)
(+ U (* (* J (cos (* K 0.5))) (* l 2.0)))
(if (<= l 4.6e+57) (pow U -8.0) t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (0.3333333333333333 * (J * pow(l, 3.0)));
double tmp;
if (l <= -2.7e+184) {
tmp = t_0;
} else if (l <= -1.8e+160) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if (l <= -8500000000.0) {
tmp = t_0;
} else if (l <= 550.0) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else if (l <= 4.6e+57) {
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 + (0.3333333333333333d0 * (j * (l ** 3.0d0)))
if (l <= (-2.7d+184)) then
tmp = t_0
else if (l <= (-1.8d+160)) then
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
else if (l <= (-8500000000.0d0)) then
tmp = t_0
else if (l <= 550.0d0) then
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
else if (l <= 4.6d+57) 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 + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
double tmp;
if (l <= -2.7e+184) {
tmp = t_0;
} else if (l <= -1.8e+160) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if (l <= -8500000000.0) {
tmp = t_0;
} else if (l <= 550.0) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else if (l <= 4.6e+57) {
tmp = Math.pow(U, -8.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) tmp = 0 if l <= -2.7e+184: tmp = t_0 elif l <= -1.8e+160: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) elif l <= -8500000000.0: tmp = t_0 elif l <= 550.0: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) elif l <= 4.6e+57: tmp = math.pow(U, -8.0) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))) tmp = 0.0 if (l <= -2.7e+184) tmp = t_0; elseif (l <= -1.8e+160) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); elseif (l <= -8500000000.0) tmp = t_0; elseif (l <= 550.0) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); elseif (l <= 4.6e+57) tmp = U ^ -8.0; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (0.3333333333333333 * (J * (l ^ 3.0))); tmp = 0.0; if (l <= -2.7e+184) tmp = t_0; elseif (l <= -1.8e+160) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); elseif (l <= -8500000000.0) tmp = t_0; elseif (l <= 550.0) tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); elseif (l <= 4.6e+57) 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[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.7e+184], t$95$0, If[LessEqual[l, -1.8e+160], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -8500000000.0], t$95$0, If[LessEqual[l, 550.0], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.6e+57], N[Power[U, -8.0], $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{+184}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -1.8 \cdot 10^{+160}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{elif}\;\ell \leq -8500000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 550:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 4.6 \cdot 10^{+57}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -2.6999999999999999e184 or -1.80000000000000011e160 < l < -8.5e9 or 4.5999999999999998e57 < l Initial program 100.0%
Taylor expanded in l around 0 87.9%
associate-*r*87.9%
associate-*r*87.9%
associate-*r*87.9%
associate-*r*87.9%
distribute-rgt-out87.9%
*-commutative87.9%
associate-*r*87.9%
*-commutative87.9%
associate-*r*87.9%
distribute-rgt-out87.9%
+-commutative87.9%
fma-def87.9%
Simplified87.9%
Taylor expanded in J around 0 87.9%
*-commutative87.9%
fma-def87.9%
*-commutative87.9%
associate-*r*87.9%
Simplified87.9%
Taylor expanded in l around inf 87.9%
Taylor expanded in K around 0 69.2%
if -2.6999999999999999e184 < l < -1.80000000000000011e160Initial program 100.0%
Taylor expanded in l around 0 51.5%
Taylor expanded in K around 0 25.0%
+-commutative25.0%
associate-*r*25.0%
distribute-rgt-out75.0%
*-commutative75.0%
unpow275.0%
Simplified75.0%
if -8.5e9 < l < 550Initial program 72.6%
Taylor expanded in l around 0 98.5%
associate-*r*98.5%
associate-*r*98.5%
associate-*r*98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
*-commutative98.5%
associate-*r*98.5%
*-commutative98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
+-commutative98.5%
fma-def98.5%
Simplified98.5%
Taylor expanded in J around 0 98.5%
*-commutative98.5%
fma-def98.5%
*-commutative98.5%
associate-*r*98.6%
Simplified98.6%
Taylor expanded in l around 0 98.5%
*-commutative98.5%
Simplified98.5%
if 550 < l < 4.5999999999999998e57Initial program 100.0%
Applied egg-rr70.7%
Final simplification85.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (pow l 3.0))))
(if (<= l -58000000.0)
(+ U (* t_0 (+ 0.3333333333333333 (* (* K K) -0.041666666666666664))))
(if (<= l 620.0)
(+ U (* (* J (cos (* K 0.5))) (* l 2.0)))
(if (<= l 7.5e+67) (pow U -8.0) (+ U (* 0.3333333333333333 t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = J * pow(l, 3.0);
double tmp;
if (l <= -58000000.0) {
tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
} else if (l <= 620.0) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else if (l <= 7.5e+67) {
tmp = pow(U, -8.0);
} else {
tmp = U + (0.3333333333333333 * 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 = j * (l ** 3.0d0)
if (l <= (-58000000.0d0)) then
tmp = u + (t_0 * (0.3333333333333333d0 + ((k * k) * (-0.041666666666666664d0))))
else if (l <= 620.0d0) then
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
else if (l <= 7.5d+67) then
tmp = u ** (-8.0d0)
else
tmp = u + (0.3333333333333333d0 * t_0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * Math.pow(l, 3.0);
double tmp;
if (l <= -58000000.0) {
tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
} else if (l <= 620.0) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else if (l <= 7.5e+67) {
tmp = Math.pow(U, -8.0);
} else {
tmp = U + (0.3333333333333333 * t_0);
}
return tmp;
}
def code(J, l, K, U): t_0 = J * math.pow(l, 3.0) tmp = 0 if l <= -58000000.0: tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664))) elif l <= 620.0: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) elif l <= 7.5e+67: tmp = math.pow(U, -8.0) else: tmp = U + (0.3333333333333333 * t_0) return tmp
function code(J, l, K, U) t_0 = Float64(J * (l ^ 3.0)) tmp = 0.0 if (l <= -58000000.0) tmp = Float64(U + Float64(t_0 * Float64(0.3333333333333333 + Float64(Float64(K * K) * -0.041666666666666664)))); elseif (l <= 620.0) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); elseif (l <= 7.5e+67) tmp = U ^ -8.0; else tmp = Float64(U + Float64(0.3333333333333333 * t_0)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (l ^ 3.0); tmp = 0.0; if (l <= -58000000.0) tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664))); elseif (l <= 620.0) tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); elseif (l <= 7.5e+67) tmp = U ^ -8.0; else tmp = U + (0.3333333333333333 * t_0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -58000000.0], N[(U + N[(t$95$0 * N[(0.3333333333333333 + N[(N[(K * K), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 620.0], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.5e+67], N[Power[U, -8.0], $MachinePrecision], N[(U + N[(0.3333333333333333 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot {\ell}^{3}\\
\mathbf{if}\;\ell \leq -58000000:\\
\;\;\;\;U + t_0 \cdot \left(0.3333333333333333 + \left(K \cdot K\right) \cdot -0.041666666666666664\right)\\
\mathbf{elif}\;\ell \leq 620:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 7.5 \cdot 10^{+67}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot t_0\\
\end{array}
\end{array}
if l < -5.8e7Initial program 100.0%
Taylor expanded in l around 0 78.0%
associate-*r*78.0%
associate-*r*78.0%
associate-*r*78.0%
associate-*r*78.0%
distribute-rgt-out78.0%
*-commutative78.0%
associate-*r*78.0%
*-commutative78.0%
associate-*r*78.0%
distribute-rgt-out78.0%
+-commutative78.0%
fma-def78.0%
Simplified78.0%
Taylor expanded in J around 0 78.0%
*-commutative78.0%
fma-def78.0%
*-commutative78.0%
associate-*r*78.0%
Simplified78.0%
Taylor expanded in l around inf 78.0%
Taylor expanded in K around 0 6.0%
+-commutative6.0%
associate-*r*6.0%
distribute-rgt-out68.5%
unpow268.5%
Simplified68.5%
if -5.8e7 < l < 620Initial program 72.4%
Taylor expanded in l around 0 99.2%
associate-*r*99.2%
associate-*r*99.2%
associate-*r*99.2%
associate-*r*99.2%
distribute-rgt-out99.2%
*-commutative99.2%
associate-*r*99.2%
*-commutative99.2%
associate-*r*99.2%
distribute-rgt-out99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Taylor expanded in J around 0 99.2%
*-commutative99.2%
fma-def99.2%
*-commutative99.2%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in l around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 620 < l < 7.5000000000000005e67Initial program 100.0%
Applied egg-rr70.7%
if 7.5000000000000005e67 < l Initial program 100.0%
Taylor expanded in l around 0 98.2%
associate-*r*98.2%
associate-*r*98.2%
associate-*r*98.2%
associate-*r*98.2%
distribute-rgt-out98.2%
*-commutative98.2%
associate-*r*98.2%
*-commutative98.2%
associate-*r*98.2%
distribute-rgt-out98.2%
+-commutative98.2%
fma-def98.2%
Simplified98.2%
Taylor expanded in J around 0 98.2%
*-commutative98.2%
fma-def98.2%
*-commutative98.2%
associate-*r*98.2%
Simplified98.2%
Taylor expanded in l around inf 98.2%
Taylor expanded in K around 0 83.6%
Final simplification88.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -60000000.0)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))
(if (<= l 1020.0)
(fma J (* l 2.0) U)
(if (<= l 1.16e+231) (pow U -8.0) (+ U (* l (* J 2.0)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -60000000.0) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if (l <= 1020.0) {
tmp = fma(J, (l * 2.0), U);
} else if (l <= 1.16e+231) {
tmp = pow(U, -8.0);
} else {
tmp = U + (l * (J * 2.0));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -60000000.0) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); elseif (l <= 1020.0) tmp = fma(J, Float64(l * 2.0), U); elseif (l <= 1.16e+231) tmp = U ^ -8.0; else tmp = Float64(U + Float64(l * Float64(J * 2.0))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -60000000.0], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1020.0], N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 1.16e+231], N[Power[U, -8.0], $MachinePrecision], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -60000000:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{elif}\;\ell \leq 1020:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 1.16 \cdot 10^{+231}:\\
\;\;\;\;{U}^{-8}\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\end{array}
\end{array}
if l < -6e7Initial program 100.0%
Taylor expanded in l around 0 27.1%
Taylor expanded in K around 0 21.7%
+-commutative21.7%
associate-*r*21.7%
distribute-rgt-out41.3%
*-commutative41.3%
unpow241.3%
Simplified41.3%
if -6e7 < l < 1020Initial program 72.4%
Taylor expanded in l around 0 99.1%
Taylor expanded in K around 0 86.9%
*-commutative86.9%
*-commutative86.9%
associate-*l*86.9%
fma-def86.9%
Simplified86.9%
if 1020 < l < 1.16e231Initial program 100.0%
Applied egg-rr41.2%
if 1.16e231 < l Initial program 100.0%
Taylor expanded in l around 0 47.5%
Taylor expanded in K around 0 47.0%
*-commutative47.0%
associate-*l*47.0%
*-commutative47.0%
Simplified47.0%
Final simplification65.7%
(FPCore (J l K U)
:precision binary64
(if (<= l -72000000.0)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))
(if (or (<= l 620.0) (not (<= l 4.2e+230)))
(+ U (* l (* J 2.0)))
(pow U -8.0))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -72000000.0) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if ((l <= 620.0) || !(l <= 4.2e+230)) {
tmp = U + (l * (J * 2.0));
} 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 <= (-72000000.0d0)) then
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
else if ((l <= 620.0d0) .or. (.not. (l <= 4.2d+230))) then
tmp = u + (l * (j * 2.0d0))
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 <= -72000000.0) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if ((l <= 620.0) || !(l <= 4.2e+230)) {
tmp = U + (l * (J * 2.0));
} else {
tmp = Math.pow(U, -8.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -72000000.0: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) elif (l <= 620.0) or not (l <= 4.2e+230): tmp = U + (l * (J * 2.0)) else: tmp = math.pow(U, -8.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -72000000.0) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); elseif ((l <= 620.0) || !(l <= 4.2e+230)) tmp = Float64(U + Float64(l * Float64(J * 2.0))); else tmp = U ^ -8.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -72000000.0) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); elseif ((l <= 620.0) || ~((l <= 4.2e+230))) tmp = U + (l * (J * 2.0)); else tmp = U ^ -8.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -72000000.0], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 620.0], N[Not[LessEqual[l, 4.2e+230]], $MachinePrecision]], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[U, -8.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -72000000:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{elif}\;\ell \leq 620 \lor \neg \left(\ell \leq 4.2 \cdot 10^{+230}\right):\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;{U}^{-8}\\
\end{array}
\end{array}
if l < -7.2e7Initial program 100.0%
Taylor expanded in l around 0 27.1%
Taylor expanded in K around 0 21.7%
+-commutative21.7%
associate-*r*21.7%
distribute-rgt-out41.3%
*-commutative41.3%
unpow241.3%
Simplified41.3%
if -7.2e7 < l < 620 or 4.19999999999999986e230 < l Initial program 75.7%
Taylor expanded in l around 0 93.0%
Taylor expanded in K around 0 82.2%
*-commutative82.2%
associate-*l*82.2%
*-commutative82.2%
Simplified82.2%
if 620 < l < 4.19999999999999986e230Initial program 100.0%
Applied egg-rr41.2%
Final simplification65.7%
(FPCore (J l K U) :precision binary64 (if (or (<= l -64000000.0) (and (not (<= l 470.0)) (<= l 1.95e+246))) (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25)))) (+ U (* l (* J 2.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -64000000.0) || (!(l <= 470.0) && (l <= 1.95e+246))) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (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) :: tmp
if ((l <= (-64000000.0d0)) .or. (.not. (l <= 470.0d0)) .and. (l <= 1.95d+246)) then
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
else
tmp = u + (l * (j * 2.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -64000000.0) || (!(l <= 470.0) && (l <= 1.95e+246))) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (l * (J * 2.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -64000000.0) or (not (l <= 470.0) and (l <= 1.95e+246)): tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) else: tmp = U + (l * (J * 2.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -64000000.0) || (!(l <= 470.0) && (l <= 1.95e+246))) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); else tmp = Float64(U + Float64(l * Float64(J * 2.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -64000000.0) || (~((l <= 470.0)) && (l <= 1.95e+246))) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); else tmp = U + (l * (J * 2.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -64000000.0], And[N[Not[LessEqual[l, 470.0]], $MachinePrecision], LessEqual[l, 1.95e+246]]], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -64000000 \lor \neg \left(\ell \leq 470\right) \land \ell \leq 1.95 \cdot 10^{+246}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\end{array}
\end{array}
if l < -6.4e7 or 470 < l < 1.95e246Initial program 100.0%
Taylor expanded in l around 0 24.3%
Taylor expanded in K around 0 17.3%
+-commutative17.3%
associate-*r*17.3%
distribute-rgt-out35.3%
*-commutative35.3%
unpow235.3%
Simplified35.3%
if -6.4e7 < l < 470 or 1.95e246 < l Initial program 75.2%
Taylor expanded in l around 0 94.1%
Taylor expanded in K around 0 83.1%
*-commutative83.1%
associate-*l*83.1%
*-commutative83.1%
Simplified83.1%
Final simplification63.3%
(FPCore (J l K U) :precision binary64 (if (<= l -60000000.0) (+ U (* (* l J) (* (* K K) -0.25))) (+ U (* l (* J 2.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -60000000.0) {
tmp = U + ((l * J) * ((K * K) * -0.25));
} else {
tmp = U + (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) :: tmp
if (l <= (-60000000.0d0)) then
tmp = u + ((l * j) * ((k * k) * (-0.25d0)))
else
tmp = u + (l * (j * 2.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -60000000.0) {
tmp = U + ((l * J) * ((K * K) * -0.25));
} else {
tmp = U + (l * (J * 2.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -60000000.0: tmp = U + ((l * J) * ((K * K) * -0.25)) else: tmp = U + (l * (J * 2.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -60000000.0) tmp = Float64(U + Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25))); else tmp = Float64(U + Float64(l * Float64(J * 2.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -60000000.0) tmp = U + ((l * J) * ((K * K) * -0.25)); else tmp = U + (l * (J * 2.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -60000000.0], N[(U + N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -60000000:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\end{array}
\end{array}
if l < -6e7Initial program 100.0%
Taylor expanded in l around 0 27.1%
Taylor expanded in K around 0 21.7%
+-commutative21.7%
associate-*r*21.7%
distribute-rgt-out41.3%
*-commutative41.3%
unpow241.3%
Simplified41.3%
Taylor expanded in K around inf 33.0%
*-commutative33.0%
*-commutative33.0%
*-commutative33.0%
associate-*r*33.0%
*-commutative33.0%
unpow233.0%
Simplified33.0%
if -6e7 < l Initial program 81.4%
Taylor expanded in l around 0 75.9%
Taylor expanded in K around 0 67.0%
*-commutative67.0%
associate-*l*67.0%
*-commutative67.0%
Simplified67.0%
Final simplification59.6%
(FPCore (J l K U) :precision binary64 (if (or (<= l -3.4e-7) (not (<= l 1.3e+85))) (* U (- U -8.0)) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -3.4e-7) || !(l <= 1.3e+85)) {
tmp = U * (U - -8.0);
} 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 <= (-3.4d-7)) .or. (.not. (l <= 1.3d+85))) then
tmp = u * (u - (-8.0d0))
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 <= -3.4e-7) || !(l <= 1.3e+85)) {
tmp = U * (U - -8.0);
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -3.4e-7) or not (l <= 1.3e+85): tmp = U * (U - -8.0) else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -3.4e-7) || !(l <= 1.3e+85)) tmp = Float64(U * Float64(U - -8.0)); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -3.4e-7) || ~((l <= 1.3e+85))) tmp = U * (U - -8.0); else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -3.4e-7], N[Not[LessEqual[l, 1.3e+85]], $MachinePrecision]], N[(U * N[(U - -8.0), $MachinePrecision]), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{-7} \lor \neg \left(\ell \leq 1.3 \cdot 10^{+85}\right):\\
\;\;\;\;U \cdot \left(U - -8\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -3.39999999999999974e-7 or 1.30000000000000005e85 < l Initial program 99.7%
Applied egg-rr15.9%
if -3.39999999999999974e-7 < l < 1.30000000000000005e85Initial program 74.5%
Taylor expanded in J around 0 65.7%
Final simplification44.1%
(FPCore (J l K U) :precision binary64 (if (<= l -2700000000.0) (* U U) (if (<= l 5.6e+68) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2700000000.0) {
tmp = U * U;
} else if (l <= 5.6e+68) {
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 <= (-2700000000.0d0)) then
tmp = u * u
else if (l <= 5.6d+68) 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 <= -2700000000.0) {
tmp = U * U;
} else if (l <= 5.6e+68) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -2700000000.0: tmp = U * U elif l <= 5.6e+68: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -2700000000.0) tmp = Float64(U * U); elseif (l <= 5.6e+68) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -2700000000.0) tmp = U * U; elseif (l <= 5.6e+68) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -2700000000.0], N[(U * U), $MachinePrecision], If[LessEqual[l, 5.6e+68], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2700000000:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+68}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -2.7e9 or 5.6e68 < l Initial program 100.0%
Applied egg-rr16.1%
if -2.7e9 < l < 5.6e68Initial program 74.7%
Taylor expanded in J around 0 64.8%
Final simplification44.1%
(FPCore (J l K U) :precision binary64 (+ U (* l (* J 2.0))))
double code(double J, double l, double K, double U) {
return U + (l * (J * 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 + (l * (j * 2.0d0))
end function
public static double code(double J, double l, double K, double U) {
return U + (l * (J * 2.0));
}
def code(J, l, K, U): return U + (l * (J * 2.0))
function code(J, l, K, U) return Float64(U + Float64(l * Float64(J * 2.0))) end
function tmp = code(J, l, K, U) tmp = U + (l * (J * 2.0)); end
code[J_, l_, K_, U_] := N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \ell \cdot \left(J \cdot 2\right)
\end{array}
Initial program 85.5%
Taylor expanded in l around 0 65.2%
Taylor expanded in K around 0 55.4%
*-commutative55.4%
associate-*l*55.4%
*-commutative55.4%
Simplified55.4%
Final simplification55.4%
(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 85.5%
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 85.5%
Taylor expanded in J around 0 38.3%
Final simplification38.3%
herbie shell --seed 2023213
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))