
(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 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e-7)))
(+ (* t_0 (* t_1 J)) U)
(+ U (* t_0 (* 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 t_1 = exp(l) - exp(-l);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e-7)) {
tmp = (t_0 * (t_1 * J)) + U;
} else {
tmp = U + (t_0 * (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 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 <= 5e-7)) {
tmp = (t_0 * (t_1 * J)) + U;
} else {
tmp = U + (t_0 * (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)) t_1 = math.exp(l) - math.exp(-l) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e-7): tmp = (t_0 * (t_1 * J)) + U else: tmp = U + (t_0 * (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)) t_1 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e-7)) tmp = Float64(Float64(t_0 * Float64(t_1 * J)) + U); else tmp = Float64(U + Float64(t_0 * 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)); t_1 = exp(l) - exp(-l); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e-7))) tmp = (t_0 * (t_1 * J)) + U; else tmp = U + (t_0 * (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]}, 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, 5e-7]], $MachinePrecision]], N[(N[(t$95$0 * N[(t$95$1 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 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 5 \cdot 10^{-7}\right):\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot J\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 4.99999999999999977e-7 < (-.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))) < 4.99999999999999977e-7Initial program 67.6%
Taylor expanded in l around 0 99.9%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= t_0 -0.985)
(+ U (* (* J 2.0) (* l (cos (* K 0.5)))))
(if (<= t_0 -0.9)
t_1
(if (<= t_0 -0.82)
(+ U (* t_0 (* J (* l 2.0))))
(if (<= t_0 -0.01)
t_1
(+ 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 t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (t_0 <= -0.985) {
tmp = U + ((J * 2.0) * (l * cos((K * 0.5))));
} else if (t_0 <= -0.9) {
tmp = t_1;
} else if (t_0 <= -0.82) {
tmp = U + (t_0 * (J * (l * 2.0)));
} else if (t_0 <= -0.01) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
if (t_0 <= (-0.985d0)) then
tmp = u + ((j * 2.0d0) * (l * cos((k * 0.5d0))))
else if (t_0 <= (-0.9d0)) then
tmp = t_1
else if (t_0 <= (-0.82d0)) then
tmp = u + (t_0 * (j * (l * 2.0d0)))
else if (t_0 <= (-0.01d0)) then
tmp = t_1
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 t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (t_0 <= -0.985) {
tmp = U + ((J * 2.0) * (l * Math.cos((K * 0.5))));
} else if (t_0 <= -0.9) {
tmp = t_1;
} else if (t_0 <= -0.82) {
tmp = U + (t_0 * (J * (l * 2.0)));
} else if (t_0 <= -0.01) {
tmp = t_1;
} 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)) t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25))) tmp = 0 if t_0 <= -0.985: tmp = U + ((J * 2.0) * (l * math.cos((K * 0.5)))) elif t_0 <= -0.9: tmp = t_1 elif t_0 <= -0.82: tmp = U + (t_0 * (J * (l * 2.0))) elif t_0 <= -0.01: tmp = t_1 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)) t_1 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) tmp = 0.0 if (t_0 <= -0.985) tmp = Float64(U + Float64(Float64(J * 2.0) * Float64(l * cos(Float64(K * 0.5))))); elseif (t_0 <= -0.9) tmp = t_1; elseif (t_0 <= -0.82) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * 2.0)))); elseif (t_0 <= -0.01) tmp = t_1; 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)); t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25))); tmp = 0.0; if (t_0 <= -0.985) tmp = U + ((J * 2.0) * (l * cos((K * 0.5)))); elseif (t_0 <= -0.9) tmp = t_1; elseif (t_0 <= -0.82) tmp = U + (t_0 * (J * (l * 2.0))); elseif (t_0 <= -0.01) tmp = t_1; 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]}, Block[{t$95$1 = N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.985], N[(U + N[(N[(J * 2.0), $MachinePrecision] * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.9], t$95$1, If[LessEqual[t$95$0, -0.82], N[(U + N[(t$95$0 * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.01], t$95$1, 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)\\
t_1 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{if}\;t_0 \leq -0.985:\\
\;\;\;\;U + \left(J \cdot 2\right) \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{elif}\;t_0 \leq -0.9:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq -0.82:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;t_0 \leq -0.01:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.984999999999999987Initial program 67.4%
Taylor expanded in l around 0 90.2%
Taylor expanded in l around 0 80.2%
associate-*r*80.2%
*-commutative80.2%
*-commutative80.2%
associate-*r*80.2%
*-commutative80.2%
*-commutative80.2%
Simplified80.2%
if -0.984999999999999987 < (cos.f64 (/.f64 K 2)) < -0.900000000000000022 or -0.819999999999999951 < (cos.f64 (/.f64 K 2)) < -0.0100000000000000002Initial program 90.8%
Taylor expanded in l around 0 40.5%
*-commutative40.5%
associate-*l*40.5%
*-commutative40.5%
Simplified40.5%
Taylor expanded in K around 0 57.8%
+-commutative57.8%
associate-*r*57.8%
distribute-rgt-out65.5%
*-commutative65.5%
unpow265.5%
Simplified65.5%
if -0.900000000000000022 < (cos.f64 (/.f64 K 2)) < -0.819999999999999951Initial program 90.4%
Taylor expanded in l around 0 80.5%
if -0.0100000000000000002 < (cos.f64 (/.f64 K 2)) Initial program 84.4%
Taylor expanded in l around 0 91.7%
Taylor expanded in K around 0 86.6%
Final simplification81.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.89)
(+ U (* 2.0 (* l (+ J (* (* K K) (* J -0.125))))))
(if (<= t_0 -0.82)
(+ U (* J 0.125))
(if (<= t_0 -0.01)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))
(+ U (* 0.3333333333333333 (* J (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.89) {
tmp = U + (2.0 * (l * (J + ((K * K) * (J * -0.125)))));
} else if (t_0 <= -0.82) {
tmp = U + (J * 0.125);
} else if (t_0 <= -0.01) {
tmp = U + ((l * J) * (2.0 + ((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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= (-0.89d0)) then
tmp = u + (2.0d0 * (l * (j + ((k * k) * (j * (-0.125d0))))))
else if (t_0 <= (-0.82d0)) then
tmp = u + (j * 0.125d0)
else if (t_0 <= (-0.01d0)) then
tmp = u + ((l * j) * (2.0d0 + ((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 t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= -0.89) {
tmp = U + (2.0 * (l * (J + ((K * K) * (J * -0.125)))));
} else if (t_0 <= -0.82) {
tmp = U + (J * 0.125);
} else if (t_0 <= -0.01) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (0.3333333333333333 * (J * 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.89: tmp = U + (2.0 * (l * (J + ((K * K) * (J * -0.125))))) elif t_0 <= -0.82: tmp = U + (J * 0.125) elif t_0 <= -0.01: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) else: tmp = U + (0.3333333333333333 * (J * 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.89) tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J + Float64(Float64(K * K) * Float64(J * -0.125)))))); elseif (t_0 <= -0.82) tmp = Float64(U + Float64(J * 0.125)); elseif (t_0 <= -0.01) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + 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) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= -0.89) tmp = U + (2.0 * (l * (J + ((K * K) * (J * -0.125))))); elseif (t_0 <= -0.82) tmp = U + (J * 0.125); elseif (t_0 <= -0.01) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); else tmp = U + (0.3333333333333333 * (J * (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.89], N[(U + N[(2.0 * N[(l * N[(J + N[(N[(K * K), $MachinePrecision] * N[(J * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.82], N[(U + N[(J * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.01], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $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}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t_0 \leq -0.89:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J + \left(K \cdot K\right) \cdot \left(J \cdot -0.125\right)\right)\right)\\
\mathbf{elif}\;t_0 \leq -0.82:\\
\;\;\;\;U + J \cdot 0.125\\
\mathbf{elif}\;t_0 \leq -0.01:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \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.890000000000000013Initial program 82.8%
Taylor expanded in l around 0 48.6%
*-commutative48.6%
associate-*l*48.5%
*-commutative48.5%
Simplified48.5%
Taylor expanded in K around 0 0.7%
associate-+r+0.7%
+-commutative0.7%
associate-*r*0.7%
associate-*r*0.7%
distribute-rgt-out0.7%
unpow20.7%
Simplified0.7%
Taylor expanded in K around 0 44.5%
+-commutative44.5%
unpow244.5%
associate-*r*44.5%
*-commutative44.5%
associate-*l*44.5%
distribute-lft-out55.1%
associate-*r*55.1%
Simplified55.1%
if -0.890000000000000013 < (cos.f64 (/.f64 K 2)) < -0.819999999999999951Initial program 89.3%
Applied egg-rr67.3%
Taylor expanded in K around 0 67.7%
*-commutative67.7%
Simplified67.7%
if -0.819999999999999951 < (cos.f64 (/.f64 K 2)) < -0.0100000000000000002Initial program 89.2%
Taylor expanded in l around 0 47.3%
*-commutative47.3%
associate-*l*47.3%
*-commutative47.3%
Simplified47.3%
Taylor expanded in K around 0 54.5%
+-commutative54.5%
associate-*r*54.5%
distribute-rgt-out63.5%
*-commutative63.5%
unpow263.5%
Simplified63.5%
if -0.0100000000000000002 < (cos.f64 (/.f64 K 2)) Initial program 84.4%
Taylor expanded in l around 0 91.7%
Taylor expanded in K around 0 86.6%
Taylor expanded in l around inf 75.7%
Final simplification71.8%
(FPCore (J l K U)
:precision binary64
(if (or (<= l -2.9e+90)
(and (not (<= l -52.0)) (or (<= l 7.4) (not (<= l 5.8e+102)))))
(+
U
(* (cos (/ K 2.0)) (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))))
(+ U (* (- (exp l) (exp (- l))) (+ J (* J (* -0.125 (* K K))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.9e+90) || (!(l <= -52.0) && ((l <= 7.4) || !(l <= 5.8e+102)))) {
tmp = U + (cos((K / 2.0)) * (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0))));
} else {
tmp = U + ((exp(l) - exp(-l)) * (J + (J * (-0.125 * (K * K)))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-2.9d+90)) .or. (.not. (l <= (-52.0d0))) .and. (l <= 7.4d0) .or. (.not. (l <= 5.8d+102))) then
tmp = u + (cos((k / 2.0d0)) * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))))
else
tmp = u + ((exp(l) - exp(-l)) * (j + (j * ((-0.125d0) * (k * k)))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.9e+90) || (!(l <= -52.0) && ((l <= 7.4) || !(l <= 5.8e+102)))) {
tmp = U + (Math.cos((K / 2.0)) * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))));
} else {
tmp = U + ((Math.exp(l) - Math.exp(-l)) * (J + (J * (-0.125 * (K * K)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -2.9e+90) or (not (l <= -52.0) and ((l <= 7.4) or not (l <= 5.8e+102))): tmp = U + (math.cos((K / 2.0)) * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)))) else: tmp = U + ((math.exp(l) - math.exp(-l)) * (J + (J * (-0.125 * (K * K))))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -2.9e+90) || (!(l <= -52.0) && ((l <= 7.4) || !(l <= 5.8e+102)))) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))))); else tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * Float64(J + Float64(J * Float64(-0.125 * Float64(K * K)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -2.9e+90) || (~((l <= -52.0)) && ((l <= 7.4) || ~((l <= 5.8e+102))))) tmp = U + (cos((K / 2.0)) * (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)))); else tmp = U + ((exp(l) - exp(-l)) * (J + (J * (-0.125 * (K * K))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -2.9e+90], And[N[Not[LessEqual[l, -52.0]], $MachinePrecision], Or[LessEqual[l, 7.4], N[Not[LessEqual[l, 5.8e+102]], $MachinePrecision]]]], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * N[(J + N[(J * N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.9 \cdot 10^{+90} \lor \neg \left(\ell \leq -52\right) \land \left(\ell \leq 7.4 \lor \neg \left(\ell \leq 5.8 \cdot 10^{+102}\right)\right):\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot \left(J + J \cdot \left(-0.125 \cdot \left(K \cdot K\right)\right)\right)\\
\end{array}
\end{array}
if l < -2.9000000000000001e90 or -52 < l < 7.4000000000000004 or 5.8000000000000005e102 < l Initial program 82.9%
Taylor expanded in l around 0 99.1%
if -2.9000000000000001e90 < l < -52 or 7.4000000000000004 < l < 5.8000000000000005e102Initial program 100.0%
Taylor expanded in K around 0 0.0%
*-commutative0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r*0.0%
distribute-rgt-out86.1%
*-commutative86.1%
unpow286.1%
Simplified86.1%
Final simplification97.3%
(FPCore (J l K U) :precision binary64 (+ U (* (cos (/ K 2.0)) (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))))
double code(double J, double l, double K, double U) {
return U + (cos((K / 2.0)) * (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0))));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (cos((k / 2.0d0)) * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))))
end function
public static double code(double J, double l, double K, double U) {
return U + (Math.cos((K / 2.0)) * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)))); end
code[J_, l_, K_, U_] := N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)
\end{array}
Initial program 85.3%
Taylor expanded in l around 0 89.1%
Final simplification89.1%
(FPCore (J l K U) :precision binary64 (if (or (<= l -165000.0) (not (<= l 1800.0))) (+ U (* (- (exp l) (exp (- l))) J)) (+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -165000.0) || !(l <= 1800.0)) {
tmp = U + ((exp(l) - exp(-l)) * J);
} else {
tmp = U + (cos((K / 2.0)) * (J * (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 <= (-165000.0d0)) .or. (.not. (l <= 1800.0d0))) then
tmp = u + ((exp(l) - exp(-l)) * j)
else
tmp = u + (cos((k / 2.0d0)) * (j * (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 <= -165000.0) || !(l <= 1800.0)) {
tmp = U + ((Math.exp(l) - Math.exp(-l)) * J);
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -165000.0) or not (l <= 1800.0): tmp = U + ((math.exp(l) - math.exp(-l)) * J) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -165000.0) || !(l <= 1800.0)) tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -165000.0) || ~((l <= 1800.0))) tmp = U + ((exp(l) - exp(-l)) * J); else tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -165000.0], N[Not[LessEqual[l, 1800.0]], $MachinePrecision]], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -165000 \lor \neg \left(\ell \leq 1800\right):\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -165000 or 1800 < l Initial program 100.0%
Taylor expanded in K around 0 70.4%
if -165000 < l < 1800Initial program 68.9%
Taylor expanded in l around 0 98.2%
Final simplification83.5%
(FPCore (J l K U)
:precision binary64
(if (<= l -4.5e+92)
(+ U (* 0.3333333333333333 (* J (pow l 3.0))))
(if (<= l -3850000.0)
(log1p (expm1 (- (/ -8.0 U) U)))
(if (<= l 2.1e-7)
(+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))
(+ U (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.5e+92) {
tmp = U + (0.3333333333333333 * (J * pow(l, 3.0)));
} else if (l <= -3850000.0) {
tmp = log1p(expm1(((-8.0 / U) - U)));
} else if (l <= 2.1e-7) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0)));
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.5e+92) {
tmp = U + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
} else if (l <= -3850000.0) {
tmp = Math.log1p(Math.expm1(((-8.0 / U) - U)));
} else if (l <= 2.1e-7) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -4.5e+92: tmp = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) elif l <= -3850000.0: tmp = math.log1p(math.expm1(((-8.0 / U) - U))) elif l <= 2.1e-7: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) else: tmp = U + (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -4.5e+92) tmp = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))); elseif (l <= -3850000.0) tmp = log1p(expm1(Float64(Float64(-8.0 / U) - U))); elseif (l <= 2.1e-7) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); else tmp = Float64(U + Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0)))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.5e+92], N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3850000.0], N[Log[1 + N[(Exp[N[(N[(-8.0 / U), $MachinePrecision] - U), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.1e-7], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 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}
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+92}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\mathbf{elif}\;\ell \leq -3850000:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{-8}{U} - U\right)\right)\\
\mathbf{elif}\;\ell \leq 2.1 \cdot 10^{-7}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\end{array}
\end{array}
if l < -4.4999999999999999e92Initial program 100.0%
Taylor expanded in l around 0 98.2%
Taylor expanded in K around 0 65.5%
Taylor expanded in l around inf 65.5%
if -4.4999999999999999e92 < l < -3.85e6Initial program 100.0%
Applied egg-rr4.4%
log1p-expm1-u80.0%
Applied egg-rr80.0%
if -3.85e6 < l < 2.1e-7Initial program 68.1%
Taylor expanded in l around 0 98.3%
if 2.1e-7 < l Initial program 99.6%
Taylor expanded in l around 0 80.1%
Taylor expanded in K around 0 64.5%
Final simplification81.1%
(FPCore (J l K U) :precision binary64 (if (or (<= l -1.16e+20) (not (<= l 3.2e-7))) (+ U (* 0.3333333333333333 (* J (pow l 3.0)))) (+ U (* 2.0 (* l (* J (cos (* K 0.5))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.16e+20) || !(l <= 3.2e-7)) {
tmp = U + (0.3333333333333333 * (J * pow(l, 3.0)));
} else {
tmp = U + (2.0 * (l * (J * cos((K * 0.5)))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-1.16d+20)) .or. (.not. (l <= 3.2d-7))) then
tmp = u + (0.3333333333333333d0 * (j * (l ** 3.0d0)))
else
tmp = u + (2.0d0 * (l * (j * cos((k * 0.5d0)))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.16e+20) || !(l <= 3.2e-7)) {
tmp = U + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
} else {
tmp = U + (2.0 * (l * (J * Math.cos((K * 0.5)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -1.16e+20) or not (l <= 3.2e-7): tmp = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) else: tmp = U + (2.0 * (l * (J * math.cos((K * 0.5))))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -1.16e+20) || !(l <= 3.2e-7)) tmp = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))); else tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J * cos(Float64(K * 0.5)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -1.16e+20) || ~((l <= 3.2e-7))) tmp = U + (0.3333333333333333 * (J * (l ^ 3.0))); else tmp = U + (2.0 * (l * (J * cos((K * 0.5))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -1.16e+20], N[Not[LessEqual[l, 3.2e-7]], $MachinePrecision]], N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(2.0 * N[(l * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.16 \cdot 10^{+20} \lor \neg \left(\ell \leq 3.2 \cdot 10^{-7}\right):\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\end{array}
\end{array}
if l < -1.16e20 or 3.2000000000000001e-7 < l Initial program 100.0%
Taylor expanded in l around 0 81.8%
Taylor expanded in K around 0 60.5%
Taylor expanded in l around inf 60.5%
if -1.16e20 < l < 3.2000000000000001e-7Initial program 68.4%
Taylor expanded in l around 0 97.4%
*-commutative97.4%
associate-*l*97.4%
*-commutative97.4%
Simplified97.4%
Final simplification77.6%
(FPCore (J l K U) :precision binary64 (if (or (<= l -4.5e+19) (not (<= l 3.2e-7))) (+ U (* 0.3333333333333333 (* J (pow l 3.0)))) (+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -4.5e+19) || !(l <= 3.2e-7)) {
tmp = U + (0.3333333333333333 * (J * pow(l, 3.0)));
} else {
tmp = U + (cos((K / 2.0)) * (J * (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 <= (-4.5d+19)) .or. (.not. (l <= 3.2d-7))) then
tmp = u + (0.3333333333333333d0 * (j * (l ** 3.0d0)))
else
tmp = u + (cos((k / 2.0d0)) * (j * (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 <= -4.5e+19) || !(l <= 3.2e-7)) {
tmp = U + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -4.5e+19) or not (l <= 3.2e-7): tmp = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -4.5e+19) || !(l <= 3.2e-7)) tmp = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -4.5e+19) || ~((l <= 3.2e-7))) tmp = U + (0.3333333333333333 * (J * (l ^ 3.0))); else tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -4.5e+19], N[Not[LessEqual[l, 3.2e-7]], $MachinePrecision]], N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+19} \lor \neg \left(\ell \leq 3.2 \cdot 10^{-7}\right):\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -4.5e19 or 3.2000000000000001e-7 < l Initial program 100.0%
Taylor expanded in l around 0 81.8%
Taylor expanded in K around 0 60.5%
Taylor expanded in l around inf 60.5%
if -4.5e19 < l < 3.2000000000000001e-7Initial program 68.4%
Taylor expanded in l around 0 97.4%
Final simplification77.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25)))))
(t_1 (/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))))
(if (<= l -1.2e+133)
t_0
(if (<= l -7.8e+89)
(+ U (* J (+ 0.125 (* (* K K) -0.015625))))
(if (<= l -620.0)
t_1
(if (<= l 660.0)
(fma l (* J 2.0) U)
(if (<= l 6e+168)
t_0
(if (<= l 1.65e+232) t_1 (+ U (* 2.0 (* l J)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double t_1 = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
double tmp;
if (l <= -1.2e+133) {
tmp = t_0;
} else if (l <= -7.8e+89) {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
} else if (l <= -620.0) {
tmp = t_1;
} else if (l <= 660.0) {
tmp = fma(l, (J * 2.0), U);
} else if (l <= 6e+168) {
tmp = t_0;
} else if (l <= 1.65e+232) {
tmp = t_1;
} else {
tmp = U + (2.0 * (l * J));
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) t_1 = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))) tmp = 0.0 if (l <= -1.2e+133) tmp = t_0; elseif (l <= -7.8e+89) tmp = Float64(U + Float64(J * Float64(0.125 + Float64(Float64(K * K) * -0.015625)))); elseif (l <= -620.0) tmp = t_1; elseif (l <= 660.0) tmp = fma(l, Float64(J * 2.0), U); elseif (l <= 6e+168) tmp = t_0; elseif (l <= 1.65e+232) tmp = t_1; else tmp = Float64(U + Float64(2.0 * Float64(l * J))); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.2e+133], t$95$0, If[LessEqual[l, -7.8e+89], N[(U + N[(J * N[(0.125 + N[(N[(K * K), $MachinePrecision] * -0.015625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -620.0], t$95$1, If[LessEqual[l, 660.0], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 6e+168], t$95$0, If[LessEqual[l, 1.65e+232], t$95$1, N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
t_1 := \frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{if}\;\ell \leq -1.2 \cdot 10^{+133}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -7.8 \cdot 10^{+89}:\\
\;\;\;\;U + J \cdot \left(0.125 + \left(K \cdot K\right) \cdot -0.015625\right)\\
\mathbf{elif}\;\ell \leq -620:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 660:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+168}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 1.65 \cdot 10^{+232}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot J\right)\\
\end{array}
\end{array}
if l < -1.1999999999999999e133 or 660 < l < 5.9999999999999996e168Initial program 100.0%
Taylor expanded in l around 0 29.1%
*-commutative29.1%
associate-*l*29.1%
*-commutative29.1%
Simplified29.1%
Taylor expanded in K around 0 24.0%
+-commutative24.0%
associate-*r*24.0%
distribute-rgt-out43.2%
*-commutative43.2%
unpow243.2%
Simplified43.2%
if -1.1999999999999999e133 < l < -7.80000000000000021e89Initial program 100.0%
Applied egg-rr1.5%
Taylor expanded in K around 0 56.8%
associate-*r*56.8%
distribute-rgt-out56.8%
unpow256.8%
Simplified56.8%
if -7.80000000000000021e89 < l < -620 or 5.9999999999999996e168 < l < 1.65e232Initial program 100.0%
Applied egg-rr3.9%
flip--44.9%
frac-times44.9%
metadata-eval44.9%
Applied egg-rr44.9%
if -620 < l < 660Initial program 68.4%
Taylor expanded in l around 0 99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in K around 0 83.9%
*-commutative83.9%
associate-*r*83.9%
*-commutative83.9%
fma-def83.9%
Simplified83.9%
if 1.65e232 < l Initial program 100.0%
Taylor expanded in l around 0 47.3%
*-commutative47.3%
associate-*l*47.3%
*-commutative47.3%
Simplified47.3%
Taylor expanded in K around 0 46.8%
Final simplification63.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25)))))
(t_1 (+ U (* 2.0 (* l J))))
(t_2 (/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))))
(if (<= l -3.3e+132)
t_0
(if (<= l -4.7e+89)
(+ U (* J (+ 0.125 (* (* K K) -0.015625))))
(if (<= l -1050.0)
t_2
(if (<= l 270.0)
t_1
(if (<= l 5e+167) t_0 (if (<= l 1.55e+232) t_2 t_1))))))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double t_1 = U + (2.0 * (l * J));
double t_2 = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
double tmp;
if (l <= -3.3e+132) {
tmp = t_0;
} else if (l <= -4.7e+89) {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
} else if (l <= -1050.0) {
tmp = t_2;
} else if (l <= 270.0) {
tmp = t_1;
} else if (l <= 5e+167) {
tmp = t_0;
} else if (l <= 1.55e+232) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
t_1 = u + (2.0d0 * (l * j))
t_2 = ((64.0d0 / (u * u)) - (u * u)) / (u + ((-8.0d0) / u))
if (l <= (-3.3d+132)) then
tmp = t_0
else if (l <= (-4.7d+89)) then
tmp = u + (j * (0.125d0 + ((k * k) * (-0.015625d0))))
else if (l <= (-1050.0d0)) then
tmp = t_2
else if (l <= 270.0d0) then
tmp = t_1
else if (l <= 5d+167) then
tmp = t_0
else if (l <= 1.55d+232) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double t_1 = U + (2.0 * (l * J));
double t_2 = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
double tmp;
if (l <= -3.3e+132) {
tmp = t_0;
} else if (l <= -4.7e+89) {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
} else if (l <= -1050.0) {
tmp = t_2;
} else if (l <= 270.0) {
tmp = t_1;
} else if (l <= 5e+167) {
tmp = t_0;
} else if (l <= 1.55e+232) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25))) t_1 = U + (2.0 * (l * J)) t_2 = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)) tmp = 0 if l <= -3.3e+132: tmp = t_0 elif l <= -4.7e+89: tmp = U + (J * (0.125 + ((K * K) * -0.015625))) elif l <= -1050.0: tmp = t_2 elif l <= 270.0: tmp = t_1 elif l <= 5e+167: tmp = t_0 elif l <= 1.55e+232: tmp = t_2 else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) t_1 = Float64(U + Float64(2.0 * Float64(l * J))) t_2 = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))) tmp = 0.0 if (l <= -3.3e+132) tmp = t_0; elseif (l <= -4.7e+89) tmp = Float64(U + Float64(J * Float64(0.125 + Float64(Float64(K * K) * -0.015625)))); elseif (l <= -1050.0) tmp = t_2; elseif (l <= 270.0) tmp = t_1; elseif (l <= 5e+167) tmp = t_0; elseif (l <= 1.55e+232) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25))); t_1 = U + (2.0 * (l * J)); t_2 = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)); tmp = 0.0; if (l <= -3.3e+132) tmp = t_0; elseif (l <= -4.7e+89) tmp = U + (J * (0.125 + ((K * K) * -0.015625))); elseif (l <= -1050.0) tmp = t_2; elseif (l <= 270.0) tmp = t_1; elseif (l <= 5e+167) tmp = t_0; elseif (l <= 1.55e+232) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.3e+132], t$95$0, If[LessEqual[l, -4.7e+89], N[(U + N[(J * N[(0.125 + N[(N[(K * K), $MachinePrecision] * -0.015625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1050.0], t$95$2, If[LessEqual[l, 270.0], t$95$1, If[LessEqual[l, 5e+167], t$95$0, If[LessEqual[l, 1.55e+232], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
t_1 := U + 2 \cdot \left(\ell \cdot J\right)\\
t_2 := \frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{if}\;\ell \leq -3.3 \cdot 10^{+132}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -4.7 \cdot 10^{+89}:\\
\;\;\;\;U + J \cdot \left(0.125 + \left(K \cdot K\right) \cdot -0.015625\right)\\
\mathbf{elif}\;\ell \leq -1050:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq 270:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+167}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 1.55 \cdot 10^{+232}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -3.3000000000000003e132 or 270 < l < 4.9999999999999997e167Initial program 100.0%
Taylor expanded in l around 0 29.1%
*-commutative29.1%
associate-*l*29.1%
*-commutative29.1%
Simplified29.1%
Taylor expanded in K around 0 24.0%
+-commutative24.0%
associate-*r*24.0%
distribute-rgt-out43.2%
*-commutative43.2%
unpow243.2%
Simplified43.2%
if -3.3000000000000003e132 < l < -4.70000000000000022e89Initial program 100.0%
Applied egg-rr1.5%
Taylor expanded in K around 0 56.8%
associate-*r*56.8%
distribute-rgt-out56.8%
unpow256.8%
Simplified56.8%
if -4.70000000000000022e89 < l < -1050 or 4.9999999999999997e167 < l < 1.54999999999999992e232Initial program 100.0%
Applied egg-rr3.9%
flip--44.9%
frac-times44.9%
metadata-eval44.9%
Applied egg-rr44.9%
if -1050 < l < 270 or 1.54999999999999992e232 < l Initial program 72.6%
Taylor expanded in l around 0 92.9%
*-commutative92.9%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in K around 0 79.0%
Final simplification63.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (/ 64.0 (* U U)) (* U U)))
(t_1 (* t_0 (* U -0.125)))
(t_2 (* t_0 (/ 1.0 U))))
(if (<= l -1.7e+295)
t_2
(if (<= l -3.35e+193)
t_1
(if (<= l -2.05e+73)
t_2
(if (<= l -850.0)
t_1
(if (or (<= l 2.8e+32) (not (<= l 4.8e+132)))
(+ U (* 2.0 (* l J)))
(+ U (* J (+ 0.125 (* (* K K) -0.015625)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = (64.0 / (U * U)) - (U * U);
double t_1 = t_0 * (U * -0.125);
double t_2 = t_0 * (1.0 / U);
double tmp;
if (l <= -1.7e+295) {
tmp = t_2;
} else if (l <= -3.35e+193) {
tmp = t_1;
} else if (l <= -2.05e+73) {
tmp = t_2;
} else if (l <= -850.0) {
tmp = t_1;
} else if ((l <= 2.8e+32) || !(l <= 4.8e+132)) {
tmp = U + (2.0 * (l * J));
} else {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (64.0d0 / (u * u)) - (u * u)
t_1 = t_0 * (u * (-0.125d0))
t_2 = t_0 * (1.0d0 / u)
if (l <= (-1.7d+295)) then
tmp = t_2
else if (l <= (-3.35d+193)) then
tmp = t_1
else if (l <= (-2.05d+73)) then
tmp = t_2
else if (l <= (-850.0d0)) then
tmp = t_1
else if ((l <= 2.8d+32) .or. (.not. (l <= 4.8d+132))) then
tmp = u + (2.0d0 * (l * j))
else
tmp = u + (j * (0.125d0 + ((k * k) * (-0.015625d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = (64.0 / (U * U)) - (U * U);
double t_1 = t_0 * (U * -0.125);
double t_2 = t_0 * (1.0 / U);
double tmp;
if (l <= -1.7e+295) {
tmp = t_2;
} else if (l <= -3.35e+193) {
tmp = t_1;
} else if (l <= -2.05e+73) {
tmp = t_2;
} else if (l <= -850.0) {
tmp = t_1;
} else if ((l <= 2.8e+32) || !(l <= 4.8e+132)) {
tmp = U + (2.0 * (l * J));
} else {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
}
return tmp;
}
def code(J, l, K, U): t_0 = (64.0 / (U * U)) - (U * U) t_1 = t_0 * (U * -0.125) t_2 = t_0 * (1.0 / U) tmp = 0 if l <= -1.7e+295: tmp = t_2 elif l <= -3.35e+193: tmp = t_1 elif l <= -2.05e+73: tmp = t_2 elif l <= -850.0: tmp = t_1 elif (l <= 2.8e+32) or not (l <= 4.8e+132): tmp = U + (2.0 * (l * J)) else: tmp = U + (J * (0.125 + ((K * K) * -0.015625))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) t_1 = Float64(t_0 * Float64(U * -0.125)) t_2 = Float64(t_0 * Float64(1.0 / U)) tmp = 0.0 if (l <= -1.7e+295) tmp = t_2; elseif (l <= -3.35e+193) tmp = t_1; elseif (l <= -2.05e+73) tmp = t_2; elseif (l <= -850.0) tmp = t_1; elseif ((l <= 2.8e+32) || !(l <= 4.8e+132)) tmp = Float64(U + Float64(2.0 * Float64(l * J))); else tmp = Float64(U + Float64(J * Float64(0.125 + Float64(Float64(K * K) * -0.015625)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (64.0 / (U * U)) - (U * U); t_1 = t_0 * (U * -0.125); t_2 = t_0 * (1.0 / U); tmp = 0.0; if (l <= -1.7e+295) tmp = t_2; elseif (l <= -3.35e+193) tmp = t_1; elseif (l <= -2.05e+73) tmp = t_2; elseif (l <= -850.0) tmp = t_1; elseif ((l <= 2.8e+32) || ~((l <= 4.8e+132))) tmp = U + (2.0 * (l * J)); else tmp = U + (J * (0.125 + ((K * K) * -0.015625))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(U * -0.125), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[(1.0 / U), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.7e+295], t$95$2, If[LessEqual[l, -3.35e+193], t$95$1, If[LessEqual[l, -2.05e+73], t$95$2, If[LessEqual[l, -850.0], t$95$1, If[Or[LessEqual[l, 2.8e+32], N[Not[LessEqual[l, 4.8e+132]], $MachinePrecision]], N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(0.125 + N[(N[(K * K), $MachinePrecision] * -0.015625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{64}{U \cdot U} - U \cdot U\\
t_1 := t_0 \cdot \left(U \cdot -0.125\right)\\
t_2 := t_0 \cdot \frac{1}{U}\\
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{+295}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq -3.35 \cdot 10^{+193}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -2.05 \cdot 10^{+73}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq -850:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 2.8 \cdot 10^{+32} \lor \neg \left(\ell \leq 4.8 \cdot 10^{+132}\right):\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(0.125 + \left(K \cdot K\right) \cdot -0.015625\right)\\
\end{array}
\end{array}
if l < -1.70000000000000001e295 or -3.3500000000000001e193 < l < -2.0499999999999999e73Initial program 100.0%
Applied egg-rr2.7%
flip--29.7%
div-inv29.7%
frac-times29.7%
metadata-eval29.7%
Applied egg-rr29.7%
Taylor expanded in U around inf 41.0%
if -1.70000000000000001e295 < l < -3.3500000000000001e193 or -2.0499999999999999e73 < l < -850Initial program 100.0%
Applied egg-rr3.4%
flip--36.0%
div-inv36.0%
frac-times36.0%
metadata-eval36.0%
Applied egg-rr36.0%
Taylor expanded in U around 0 48.7%
*-commutative48.7%
Simplified48.7%
if -850 < l < 2.8e32 or 4.8000000000000002e132 < l Initial program 77.1%
Taylor expanded in l around 0 82.9%
*-commutative82.9%
associate-*l*82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in K around 0 70.6%
if 2.8e32 < l < 4.8000000000000002e132Initial program 100.0%
Applied egg-rr4.6%
Taylor expanded in K around 0 45.0%
associate-*r*45.0%
distribute-rgt-out45.0%
unpow245.0%
Simplified45.0%
Final simplification61.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= l -1.4e+129)
t_0
(if (<= l -2.65e+73)
(+ U (* J (+ 0.125 (* (* K K) -0.015625))))
(if (<= l -750.0)
(* (- (/ 64.0 (* U U)) (* U U)) (* U -0.125))
(if (<= l 270.0) (+ U (* 2.0 (* l J))) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -1.4e+129) {
tmp = t_0;
} else if (l <= -2.65e+73) {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
} else if (l <= -750.0) {
tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125);
} else if (l <= 270.0) {
tmp = U + (2.0 * (l * J));
} 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 + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
if (l <= (-1.4d+129)) then
tmp = t_0
else if (l <= (-2.65d+73)) then
tmp = u + (j * (0.125d0 + ((k * k) * (-0.015625d0))))
else if (l <= (-750.0d0)) then
tmp = ((64.0d0 / (u * u)) - (u * u)) * (u * (-0.125d0))
else if (l <= 270.0d0) then
tmp = u + (2.0d0 * (l * j))
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 + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -1.4e+129) {
tmp = t_0;
} else if (l <= -2.65e+73) {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
} else if (l <= -750.0) {
tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125);
} else if (l <= 270.0) {
tmp = U + (2.0 * (l * J));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25))) tmp = 0 if l <= -1.4e+129: tmp = t_0 elif l <= -2.65e+73: tmp = U + (J * (0.125 + ((K * K) * -0.015625))) elif l <= -750.0: tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125) elif l <= 270.0: tmp = U + (2.0 * (l * J)) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) tmp = 0.0 if (l <= -1.4e+129) tmp = t_0; elseif (l <= -2.65e+73) tmp = Float64(U + Float64(J * Float64(0.125 + Float64(Float64(K * K) * -0.015625)))); elseif (l <= -750.0) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) * Float64(U * -0.125)); elseif (l <= 270.0) tmp = Float64(U + Float64(2.0 * Float64(l * J))); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25))); tmp = 0.0; if (l <= -1.4e+129) tmp = t_0; elseif (l <= -2.65e+73) tmp = U + (J * (0.125 + ((K * K) * -0.015625))); elseif (l <= -750.0) tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125); elseif (l <= 270.0) tmp = U + (2.0 * (l * J)); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$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, -1.4e+129], t$95$0, If[LessEqual[l, -2.65e+73], N[(U + N[(J * N[(0.125 + N[(N[(K * K), $MachinePrecision] * -0.015625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -750.0], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] * N[(U * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 270.0], N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{+129}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -2.65 \cdot 10^{+73}:\\
\;\;\;\;U + J \cdot \left(0.125 + \left(K \cdot K\right) \cdot -0.015625\right)\\
\mathbf{elif}\;\ell \leq -750:\\
\;\;\;\;\left(\frac{64}{U \cdot U} - U \cdot U\right) \cdot \left(U \cdot -0.125\right)\\
\mathbf{elif}\;\ell \leq 270:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -1.39999999999999987e129 or 270 < l Initial program 100.0%
Taylor expanded in l around 0 32.5%
*-commutative32.5%
associate-*l*32.5%
*-commutative32.5%
Simplified32.5%
Taylor expanded in K around 0 20.7%
+-commutative20.7%
associate-*r*20.7%
distribute-rgt-out40.3%
*-commutative40.3%
unpow240.3%
Simplified40.3%
if -1.39999999999999987e129 < l < -2.64999999999999998e73Initial program 100.0%
Applied egg-rr1.3%
Taylor expanded in K around 0 36.8%
associate-*r*36.8%
distribute-rgt-out36.8%
unpow236.8%
Simplified36.8%
if -2.64999999999999998e73 < l < -750Initial program 100.0%
Applied egg-rr4.3%
flip--46.3%
div-inv46.3%
frac-times46.3%
metadata-eval46.3%
Applied egg-rr46.3%
Taylor expanded in U around 0 48.0%
*-commutative48.0%
Simplified48.0%
if -750 < l < 270Initial program 68.4%
Taylor expanded in l around 0 99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in K around 0 83.9%
Final simplification60.7%
(FPCore (J l K U)
:precision binary64
(if (<= l -5.7e+134)
(* U (- U -8.0))
(if (or (<= l -3.2e-30) (and (not (<= l 5.8e+31)) (<= l 4e+132)))
(+ U (* J (+ 0.125 (* (* K K) -0.015625))))
(+ U (* 2.0 (* l J))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -5.7e+134) {
tmp = U * (U - -8.0);
} else if ((l <= -3.2e-30) || (!(l <= 5.8e+31) && (l <= 4e+132))) {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
} else {
tmp = U + (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 <= (-5.7d+134)) then
tmp = u * (u - (-8.0d0))
else if ((l <= (-3.2d-30)) .or. (.not. (l <= 5.8d+31)) .and. (l <= 4d+132)) then
tmp = u + (j * (0.125d0 + ((k * k) * (-0.015625d0))))
else
tmp = u + (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 <= -5.7e+134) {
tmp = U * (U - -8.0);
} else if ((l <= -3.2e-30) || (!(l <= 5.8e+31) && (l <= 4e+132))) {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
} else {
tmp = U + (2.0 * (l * J));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -5.7e+134: tmp = U * (U - -8.0) elif (l <= -3.2e-30) or (not (l <= 5.8e+31) and (l <= 4e+132)): tmp = U + (J * (0.125 + ((K * K) * -0.015625))) else: tmp = U + (2.0 * (l * J)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -5.7e+134) tmp = Float64(U * Float64(U - -8.0)); elseif ((l <= -3.2e-30) || (!(l <= 5.8e+31) && (l <= 4e+132))) tmp = Float64(U + Float64(J * Float64(0.125 + Float64(Float64(K * K) * -0.015625)))); else tmp = Float64(U + Float64(2.0 * Float64(l * J))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -5.7e+134) tmp = U * (U - -8.0); elseif ((l <= -3.2e-30) || (~((l <= 5.8e+31)) && (l <= 4e+132))) tmp = U + (J * (0.125 + ((K * K) * -0.015625))); else tmp = U + (2.0 * (l * J)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -5.7e+134], N[(U * N[(U - -8.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, -3.2e-30], And[N[Not[LessEqual[l, 5.8e+31]], $MachinePrecision], LessEqual[l, 4e+132]]], N[(U + N[(J * N[(0.125 + N[(N[(K * K), $MachinePrecision] * -0.015625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.7 \cdot 10^{+134}:\\
\;\;\;\;U \cdot \left(U - -8\right)\\
\mathbf{elif}\;\ell \leq -3.2 \cdot 10^{-30} \lor \neg \left(\ell \leq 5.8 \cdot 10^{+31}\right) \land \ell \leq 4 \cdot 10^{+132}:\\
\;\;\;\;U + J \cdot \left(0.125 + \left(K \cdot K\right) \cdot -0.015625\right)\\
\mathbf{else}:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot J\right)\\
\end{array}
\end{array}
if l < -5.70000000000000038e134Initial program 100.0%
Applied egg-rr24.1%
if -5.70000000000000038e134 < l < -3.2e-30 or 5.8000000000000001e31 < l < 3.99999999999999996e132Initial program 98.7%
Applied egg-rr4.9%
Taylor expanded in K around 0 35.4%
associate-*r*35.4%
distribute-rgt-out35.4%
unpow235.4%
Simplified35.4%
if -3.2e-30 < l < 5.8000000000000001e31 or 3.99999999999999996e132 < l Initial program 77.2%
Taylor expanded in l around 0 82.7%
*-commutative82.7%
associate-*l*82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in K around 0 70.8%
Final simplification55.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* 2.0 (* l J)))))
(if (<= l -3.05e+293)
t_0
(if (<= l -1050.0)
(* (- (/ 64.0 (* U U)) (* U U)) (* U -0.125))
(if (or (<= l 2.3e+31) (not (<= l 2.55e+132)))
t_0
(+ U (* J (+ 0.125 (* (* K K) -0.015625)))))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (2.0 * (l * J));
double tmp;
if (l <= -3.05e+293) {
tmp = t_0;
} else if (l <= -1050.0) {
tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125);
} else if ((l <= 2.3e+31) || !(l <= 2.55e+132)) {
tmp = t_0;
} else {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
}
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 + (2.0d0 * (l * j))
if (l <= (-3.05d+293)) then
tmp = t_0
else if (l <= (-1050.0d0)) then
tmp = ((64.0d0 / (u * u)) - (u * u)) * (u * (-0.125d0))
else if ((l <= 2.3d+31) .or. (.not. (l <= 2.55d+132))) then
tmp = t_0
else
tmp = u + (j * (0.125d0 + ((k * k) * (-0.015625d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (2.0 * (l * J));
double tmp;
if (l <= -3.05e+293) {
tmp = t_0;
} else if (l <= -1050.0) {
tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125);
} else if ((l <= 2.3e+31) || !(l <= 2.55e+132)) {
tmp = t_0;
} else {
tmp = U + (J * (0.125 + ((K * K) * -0.015625)));
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (2.0 * (l * J)) tmp = 0 if l <= -3.05e+293: tmp = t_0 elif l <= -1050.0: tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125) elif (l <= 2.3e+31) or not (l <= 2.55e+132): tmp = t_0 else: tmp = U + (J * (0.125 + ((K * K) * -0.015625))) return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(2.0 * Float64(l * J))) tmp = 0.0 if (l <= -3.05e+293) tmp = t_0; elseif (l <= -1050.0) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) * Float64(U * -0.125)); elseif ((l <= 2.3e+31) || !(l <= 2.55e+132)) tmp = t_0; else tmp = Float64(U + Float64(J * Float64(0.125 + Float64(Float64(K * K) * -0.015625)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (2.0 * (l * J)); tmp = 0.0; if (l <= -3.05e+293) tmp = t_0; elseif (l <= -1050.0) tmp = ((64.0 / (U * U)) - (U * U)) * (U * -0.125); elseif ((l <= 2.3e+31) || ~((l <= 2.55e+132))) tmp = t_0; else tmp = U + (J * (0.125 + ((K * K) * -0.015625))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.05e+293], t$95$0, If[LessEqual[l, -1050.0], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] * N[(U * -0.125), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.3e+31], N[Not[LessEqual[l, 2.55e+132]], $MachinePrecision]], t$95$0, N[(U + N[(J * N[(0.125 + N[(N[(K * K), $MachinePrecision] * -0.015625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{if}\;\ell \leq -3.05 \cdot 10^{+293}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -1050:\\
\;\;\;\;\left(\frac{64}{U \cdot U} - U \cdot U\right) \cdot \left(U \cdot -0.125\right)\\
\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{+31} \lor \neg \left(\ell \leq 2.55 \cdot 10^{+132}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(0.125 + \left(K \cdot K\right) \cdot -0.015625\right)\\
\end{array}
\end{array}
if l < -3.0499999999999998e293 or -1050 < l < 2.3e31 or 2.55e132 < l Initial program 77.9%
Taylor expanded in l around 0 82.4%
*-commutative82.4%
associate-*l*82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in K around 0 70.5%
if -3.0499999999999998e293 < l < -1050Initial program 100.0%
Applied egg-rr3.1%
flip--31.1%
div-inv31.1%
frac-times31.1%
metadata-eval31.1%
Applied egg-rr31.1%
Taylor expanded in U around 0 33.3%
*-commutative33.3%
Simplified33.3%
if 2.3e31 < l < 2.55e132Initial program 100.0%
Applied egg-rr4.6%
Taylor expanded in K around 0 45.0%
associate-*r*45.0%
distribute-rgt-out45.0%
unpow245.0%
Simplified45.0%
Final simplification59.1%
(FPCore (J l K U) :precision binary64 (if (<= l -1.28e+33) (* U (- U -8.0)) U))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.28e+33) {
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 <= (-1.28d+33)) 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 <= -1.28e+33) {
tmp = U * (U - -8.0);
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1.28e+33: tmp = U * (U - -8.0) else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1.28e+33) 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 <= -1.28e+33) tmp = U * (U - -8.0); else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.28e+33], N[(U * N[(U - -8.0), $MachinePrecision]), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.28 \cdot 10^{+33}:\\
\;\;\;\;U \cdot \left(U - -8\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -1.28e33Initial program 100.0%
Applied egg-rr20.0%
if -1.28e33 < l Initial program 80.3%
Taylor expanded in J around 0 42.6%
Final simplification36.9%
(FPCore (J l K U) :precision binary64 (+ U (* 2.0 (* l J))))
double code(double J, double l, double K, double U) {
return U + (2.0 * (l * J));
}
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 + (2.0d0 * (l * j))
end function
public static double code(double J, double l, double K, double U) {
return U + (2.0 * (l * J));
}
def code(J, l, K, U): return U + (2.0 * (l * J))
function code(J, l, K, U) return Float64(U + Float64(2.0 * Float64(l * J))) end
function tmp = code(J, l, K, U) tmp = U + (2.0 * (l * J)); end
code[J_, l_, K_, U_] := N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + 2 \cdot \left(\ell \cdot J\right)
\end{array}
Initial program 85.3%
Taylor expanded in l around 0 61.4%
*-commutative61.4%
associate-*l*61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in K around 0 51.3%
Final simplification51.3%
(FPCore (J l K U) :precision binary64 (if (<= l -1.28e+33) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.28e+33) {
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 <= (-1.28d+33)) 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 <= -1.28e+33) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1.28e+33: tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1.28e+33) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -1.28e+33) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.28e+33], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.28 \cdot 10^{+33}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -1.28e33Initial program 100.0%
Applied egg-rr20.0%
if -1.28e33 < l Initial program 80.3%
Taylor expanded in J around 0 42.6%
Final simplification36.9%
(FPCore (J l K U) :precision binary64 0.0)
double code(double J, double l, double K, double U) {
return 0.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 = 0.0d0
end function
public static double code(double J, double l, double K, double U) {
return 0.0;
}
def code(J, l, K, U): return 0.0
function code(J, l, K, U) return 0.0 end
function tmp = code(J, l, K, U) tmp = 0.0; end
code[J_, l_, K_, U_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 85.3%
Taylor expanded in K around 0 68.6%
Applied egg-rr2.3%
+-inverses2.3%
Simplified2.3%
Final simplification2.3%
(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.3%
Applied egg-rr2.6%
*-inverses2.6%
Simplified2.6%
Final simplification2.6%
(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.3%
Taylor expanded in J around 0 32.3%
Final simplification32.3%
herbie shell --seed 2023258
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))