
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (or (<= t_0 -0.1) (not (<= t_0 1e-13)))
(+ (* (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 <= -0.1) || !(t_0 <= 1e-13)) {
tmp = (cos((K / 2.0)) * (t_0 * J)) + U;
} 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) :: t_0
real(8) :: tmp
t_0 = exp(l) - exp(-l)
if ((t_0 <= (-0.1d0)) .or. (.not. (t_0 <= 1d-13))) then
tmp = (cos((k / 2.0d0)) * (t_0 * j)) + u
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 t_0 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_0 <= -0.1) || !(t_0 <= 1e-13)) {
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 <= -0.1) or not (t_0 <= 1e-13): 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 <= -0.1) || !(t_0 <= 1e-13)) 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)) * 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 <= -0.1) || ~((t_0 <= 1e-13))) 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, -0.1], N[Not[LessEqual[t$95$0, 1e-13]], $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[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_0 \leq -0.1 \lor \neg \left(t_0 \leq 10^{-13}\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 \left(\ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -0.10000000000000001 or 1e-13 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -0.10000000000000001 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 1e-13Initial program 69.5%
Taylor expanded in l around 0 99.9%
Taylor expanded in J around 0 99.9%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in l around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (* K 0.5))) (t_1 (cos (/ K 2.0))))
(if (<= t_1 -0.886)
(+ U (* J (* t_0 (* l 2.0))))
(if (<= t_1 -0.665)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))
(if (<= t_1 -0.04)
(+ U (* 2.0 (* l (* J t_0))))
(+ U (* J (+ (* (pow l 3.0) 0.3333333333333333) (* l 2.0)))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K * 0.5));
double t_1 = cos((K / 2.0));
double tmp;
if (t_1 <= -0.886) {
tmp = U + (J * (t_0 * (l * 2.0)));
} else if (t_1 <= -0.665) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if (t_1 <= -0.04) {
tmp = U + (2.0 * (l * (J * t_0)));
} else {
tmp = U + (J * ((pow(l, 3.0) * 0.3333333333333333) + (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 * 0.5d0))
t_1 = cos((k / 2.0d0))
if (t_1 <= (-0.886d0)) then
tmp = u + (j * (t_0 * (l * 2.0d0)))
else if (t_1 <= (-0.665d0)) then
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
else if (t_1 <= (-0.04d0)) then
tmp = u + (2.0d0 * (l * (j * t_0)))
else
tmp = u + (j * (((l ** 3.0d0) * 0.3333333333333333d0) + (l * 2.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K * 0.5));
double t_1 = Math.cos((K / 2.0));
double tmp;
if (t_1 <= -0.886) {
tmp = U + (J * (t_0 * (l * 2.0)));
} else if (t_1 <= -0.665) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else if (t_1 <= -0.04) {
tmp = U + (2.0 * (l * (J * t_0)));
} else {
tmp = U + (J * ((Math.pow(l, 3.0) * 0.3333333333333333) + (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K * 0.5)) t_1 = math.cos((K / 2.0)) tmp = 0 if t_1 <= -0.886: tmp = U + (J * (t_0 * (l * 2.0))) elif t_1 <= -0.665: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) elif t_1 <= -0.04: tmp = U + (2.0 * (l * (J * t_0))) else: tmp = U + (J * ((math.pow(l, 3.0) * 0.3333333333333333) + (l * 2.0))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K * 0.5)) t_1 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_1 <= -0.886) tmp = Float64(U + Float64(J * Float64(t_0 * Float64(l * 2.0)))); elseif (t_1 <= -0.665) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); elseif (t_1 <= -0.04) tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J * t_0)))); else tmp = Float64(U + Float64(J * Float64(Float64((l ^ 3.0) * 0.3333333333333333) + Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K * 0.5)); t_1 = cos((K / 2.0)); tmp = 0.0; if (t_1 <= -0.886) tmp = U + (J * (t_0 * (l * 2.0))); elseif (t_1 <= -0.665) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); elseif (t_1 <= -0.04) tmp = U + (2.0 * (l * (J * t_0))); else tmp = U + (J * (((l ^ 3.0) * 0.3333333333333333) + (l * 2.0))); 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[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -0.886], N[(U + N[(J * N[(t$95$0 * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.665], 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$1, -0.04], N[(U + N[(2.0 * N[(l * N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[(N[Power[l, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(K \cdot 0.5\right)\\
t_1 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t_1 \leq -0.886:\\
\;\;\;\;U + J \cdot \left(t_0 \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;t_1 \leq -0.665:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{elif}\;t_1 \leq -0.04:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J \cdot t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left({\ell}^{3} \cdot 0.3333333333333333 + \ell \cdot 2\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.88600000000000001Initial program 85.9%
Taylor expanded in l around 0 95.2%
Taylor expanded in J around 0 95.2%
associate-*r*95.3%
*-commutative95.3%
fma-def95.3%
*-commutative95.3%
*-commutative95.3%
*-commutative95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in l around 0 76.3%
*-commutative76.3%
Simplified76.3%
if -0.88600000000000001 < (cos.f64 (/.f64 K 2)) < -0.66500000000000004Initial program 92.1%
Taylor expanded in l around 0 83.9%
Taylor expanded in l around 0 37.0%
*-commutative37.0%
*-commutative37.0%
*-commutative37.0%
associate-*r*37.0%
*-commutative37.0%
associate-*r*37.0%
*-commutative37.0%
Simplified37.0%
Taylor expanded in K around 0 67.4%
associate-*r*67.4%
distribute-rgt-out75.8%
*-commutative75.8%
unpow275.8%
Simplified75.8%
if -0.66500000000000004 < (cos.f64 (/.f64 K 2)) < -0.0400000000000000008Initial program 78.9%
Taylor expanded in l around 0 74.4%
*-commutative74.4%
associate-*l*74.4%
*-commutative74.4%
Simplified74.4%
if -0.0400000000000000008 < (cos.f64 (/.f64 K 2)) Initial program 86.2%
Taylor expanded in l around 0 89.6%
Taylor expanded in K around 0 86.3%
Final simplification83.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= l -7e+79)
(+ U (* t_0 (* (pow l 3.0) (* J 0.3333333333333333))))
(if (or (<= l -9e+17) (and (not (<= l 0.054)) (<= l 1.46e+59)))
(+ U (* (- (exp l) (exp (- l))) J))
(+ U (* t_0 (* J (+ (* (pow l 3.0) 0.3333333333333333) (* l 2.0)))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (l <= -7e+79) {
tmp = U + (t_0 * (pow(l, 3.0) * (J * 0.3333333333333333)));
} else if ((l <= -9e+17) || (!(l <= 0.054) && (l <= 1.46e+59))) {
tmp = U + ((exp(l) - exp(-l)) * J);
} else {
tmp = U + (t_0 * (J * ((pow(l, 3.0) * 0.3333333333333333) + (l * 2.0))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (l <= (-7d+79)) then
tmp = u + (t_0 * ((l ** 3.0d0) * (j * 0.3333333333333333d0)))
else if ((l <= (-9d+17)) .or. (.not. (l <= 0.054d0)) .and. (l <= 1.46d+59)) then
tmp = u + ((exp(l) - exp(-l)) * j)
else
tmp = u + (t_0 * (j * (((l ** 3.0d0) * 0.3333333333333333d0) + (l * 2.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (l <= -7e+79) {
tmp = U + (t_0 * (Math.pow(l, 3.0) * (J * 0.3333333333333333)));
} else if ((l <= -9e+17) || (!(l <= 0.054) && (l <= 1.46e+59))) {
tmp = U + ((Math.exp(l) - Math.exp(-l)) * J);
} else {
tmp = U + (t_0 * (J * ((Math.pow(l, 3.0) * 0.3333333333333333) + (l * 2.0))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if l <= -7e+79: tmp = U + (t_0 * (math.pow(l, 3.0) * (J * 0.3333333333333333))) elif (l <= -9e+17) or (not (l <= 0.054) and (l <= 1.46e+59)): tmp = U + ((math.exp(l) - math.exp(-l)) * J) else: tmp = U + (t_0 * (J * ((math.pow(l, 3.0) * 0.3333333333333333) + (l * 2.0)))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (l <= -7e+79) tmp = Float64(U + Float64(t_0 * Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)))); elseif ((l <= -9e+17) || (!(l <= 0.054) && (l <= 1.46e+59))) tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(Float64((l ^ 3.0) * 0.3333333333333333) + Float64(l * 2.0))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (l <= -7e+79) tmp = U + (t_0 * ((l ^ 3.0) * (J * 0.3333333333333333))); elseif ((l <= -9e+17) || (~((l <= 0.054)) && (l <= 1.46e+59))) tmp = U + ((exp(l) - exp(-l)) * J); else tmp = U + (t_0 * (J * (((l ^ 3.0) * 0.3333333333333333) + (l * 2.0)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -7e+79], N[(U + N[(t$95$0 * N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, -9e+17], And[N[Not[LessEqual[l, 0.054]], $MachinePrecision], LessEqual[l, 1.46e+59]]], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(N[(N[Power[l, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;\ell \leq -7 \cdot 10^{+79}:\\
\;\;\;\;U + t_0 \cdot \left({\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
\mathbf{elif}\;\ell \leq -9 \cdot 10^{+17} \lor \neg \left(\ell \leq 0.054\right) \land \ell \leq 1.46 \cdot 10^{+59}:\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left({\ell}^{3} \cdot 0.3333333333333333 + \ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -6.99999999999999961e79Initial program 100.0%
Taylor expanded in l around 0 96.8%
Taylor expanded in l around inf 96.8%
associate-*r*96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
if -6.99999999999999961e79 < l < -9e17 or 0.0539999999999999994 < l < 1.45999999999999992e59Initial program 100.0%
Taylor expanded in K around 0 87.5%
if -9e17 < l < 0.0539999999999999994 or 1.45999999999999992e59 < l Initial program 78.7%
Taylor expanded in l around 0 98.0%
Final simplification96.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (cos (/ K 2.0)) (* (pow l 3.0) (* J 0.3333333333333333)))))
(t_1 (+ U (* (- (exp l) (exp (- l))) J))))
(if (<= l -7e+79)
t_0
(if (<= l -9e+17)
t_1
(if (<= l 0.00023)
(+ U (* J (* (cos (* K 0.5)) (* l 2.0))))
(if (<= l 1.46e+59) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (pow(l, 3.0) * (J * 0.3333333333333333)));
double t_1 = U + ((exp(l) - exp(-l)) * J);
double tmp;
if (l <= -7e+79) {
tmp = t_0;
} else if (l <= -9e+17) {
tmp = t_1;
} else if (l <= 0.00023) {
tmp = U + (J * (cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 1.46e+59) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = u + (cos((k / 2.0d0)) * ((l ** 3.0d0) * (j * 0.3333333333333333d0)))
t_1 = u + ((exp(l) - exp(-l)) * j)
if (l <= (-7d+79)) then
tmp = t_0
else if (l <= (-9d+17)) then
tmp = t_1
else if (l <= 0.00023d0) then
tmp = u + (j * (cos((k * 0.5d0)) * (l * 2.0d0)))
else if (l <= 1.46d+59) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (Math.cos((K / 2.0)) * (Math.pow(l, 3.0) * (J * 0.3333333333333333)));
double t_1 = U + ((Math.exp(l) - Math.exp(-l)) * J);
double tmp;
if (l <= -7e+79) {
tmp = t_0;
} else if (l <= -9e+17) {
tmp = t_1;
} else if (l <= 0.00023) {
tmp = U + (J * (Math.cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 1.46e+59) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (math.pow(l, 3.0) * (J * 0.3333333333333333))) t_1 = U + ((math.exp(l) - math.exp(-l)) * J) tmp = 0 if l <= -7e+79: tmp = t_0 elif l <= -9e+17: tmp = t_1 elif l <= 0.00023: tmp = U + (J * (math.cos((K * 0.5)) * (l * 2.0))) elif l <= 1.46e+59: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)))) t_1 = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)) tmp = 0.0 if (l <= -7e+79) tmp = t_0; elseif (l <= -9e+17) tmp = t_1; elseif (l <= 0.00023) tmp = Float64(U + Float64(J * Float64(cos(Float64(K * 0.5)) * Float64(l * 2.0)))); elseif (l <= 1.46e+59) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (cos((K / 2.0)) * ((l ^ 3.0) * (J * 0.3333333333333333))); t_1 = U + ((exp(l) - exp(-l)) * J); tmp = 0.0; if (l <= -7e+79) tmp = t_0; elseif (l <= -9e+17) tmp = t_1; elseif (l <= 0.00023) tmp = U + (J * (cos((K * 0.5)) * (l * 2.0))); elseif (l <= 1.46e+59) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7e+79], t$95$0, If[LessEqual[l, -9e+17], t$95$1, If[LessEqual[l, 0.00023], N[(U + N[(J * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.46e+59], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left({\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
t_1 := U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -7 \cdot 10^{+79}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -9 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 0.00023:\\
\;\;\;\;U + J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 1.46 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -6.99999999999999961e79 or 1.45999999999999992e59 < l Initial program 100.0%
Taylor expanded in l around 0 96.5%
Taylor expanded in l around inf 96.5%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.5%
Simplified96.5%
if -6.99999999999999961e79 < l < -9e17 or 2.3000000000000001e-4 < l < 1.45999999999999992e59Initial program 100.0%
Taylor expanded in K around 0 87.5%
if -9e17 < l < 2.3000000000000001e-4Initial program 70.2%
Taylor expanded in l around 0 98.8%
Taylor expanded in J around 0 98.8%
associate-*r*98.8%
*-commutative98.8%
fma-def98.8%
*-commutative98.8%
*-commutative98.8%
*-commutative98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in l around 0 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification96.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (log1p (expm1 (- (/ -8.0 U) U))))
(t_1 (+ U (* J (* (pow l 3.0) 0.3333333333333333)))))
(if (<= l -3.9e+102)
t_1
(if (<= l -520.0)
t_0
(if (<= l 6200000000.0)
(+ U (* J (* (cos (* K 0.5)) (* l 2.0))))
(if (<= l 1.9e+99) t_0 t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = log1p(expm1(((-8.0 / U) - U)));
double t_1 = U + (J * (pow(l, 3.0) * 0.3333333333333333));
double tmp;
if (l <= -3.9e+102) {
tmp = t_1;
} else if (l <= -520.0) {
tmp = t_0;
} else if (l <= 6200000000.0) {
tmp = U + (J * (cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 1.9e+99) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = Math.log1p(Math.expm1(((-8.0 / U) - U)));
double t_1 = U + (J * (Math.pow(l, 3.0) * 0.3333333333333333));
double tmp;
if (l <= -3.9e+102) {
tmp = t_1;
} else if (l <= -520.0) {
tmp = t_0;
} else if (l <= 6200000000.0) {
tmp = U + (J * (Math.cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 1.9e+99) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.log1p(math.expm1(((-8.0 / U) - U))) t_1 = U + (J * (math.pow(l, 3.0) * 0.3333333333333333)) tmp = 0 if l <= -3.9e+102: tmp = t_1 elif l <= -520.0: tmp = t_0 elif l <= 6200000000.0: tmp = U + (J * (math.cos((K * 0.5)) * (l * 2.0))) elif l <= 1.9e+99: tmp = t_0 else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = log1p(expm1(Float64(Float64(-8.0 / U) - U))) t_1 = Float64(U + Float64(J * Float64((l ^ 3.0) * 0.3333333333333333))) tmp = 0.0 if (l <= -3.9e+102) tmp = t_1; elseif (l <= -520.0) tmp = t_0; elseif (l <= 6200000000.0) tmp = Float64(U + Float64(J * Float64(cos(Float64(K * 0.5)) * Float64(l * 2.0)))); elseif (l <= 1.9e+99) tmp = t_0; else tmp = t_1; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Log[1 + N[(Exp[N[(N[(-8.0 / U), $MachinePrecision] - U), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(J * N[(N[Power[l, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.9e+102], t$95$1, If[LessEqual[l, -520.0], t$95$0, If[LessEqual[l, 6200000000.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, 1.9e+99], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{-8}{U} - U\right)\right)\\
t_1 := U + J \cdot \left({\ell}^{3} \cdot 0.3333333333333333\right)\\
\mathbf{if}\;\ell \leq -3.9 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -520:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 6200000000:\\
\;\;\;\;U + J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 1.9 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -3.8999999999999998e102 or 1.9e99 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in K around 0 79.8%
Taylor expanded in l around inf 79.8%
associate-*r*79.8%
*-commutative79.8%
Simplified79.8%
if -3.8999999999999998e102 < l < -520 or 6.2e9 < l < 1.9e99Initial program 100.0%
Applied egg-rr3.5%
log1p-expm1-u59.4%
Applied egg-rr59.4%
if -520 < l < 6.2e9Initial program 70.7%
Taylor expanded in l around 0 97.3%
Taylor expanded in J around 0 97.3%
associate-*r*97.3%
*-commutative97.3%
fma-def97.3%
*-commutative97.3%
*-commutative97.3%
*-commutative97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in l around 0 97.2%
*-commutative97.2%
Simplified97.2%
Final simplification85.7%
(FPCore (J l K U) :precision binary64 (if (or (<= l -9e+17) (not (<= l 0.00032))) (+ 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 <= -9e+17) || !(l <= 0.00032)) {
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 <= (-9d+17)) .or. (.not. (l <= 0.00032d0))) 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 <= -9e+17) || !(l <= 0.00032)) {
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 <= -9e+17) or not (l <= 0.00032): 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 <= -9e+17) || !(l <= 0.00032)) tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)); else tmp = Float64(U + Float64(J * Float64(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 <= -9e+17) || ~((l <= 0.00032))) 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[Or[LessEqual[l, -9e+17], N[Not[LessEqual[l, 0.00032]], $MachinePrecision]], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9 \cdot 10^{+17} \lor \neg \left(\ell \leq 0.00032\right):\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(\ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -9e17 or 3.20000000000000026e-4 < l Initial program 100.0%
Taylor expanded in K around 0 78.9%
if -9e17 < l < 3.20000000000000026e-4Initial program 70.2%
Taylor expanded in l around 0 98.8%
Taylor expanded in J around 0 98.8%
associate-*r*98.8%
*-commutative98.8%
fma-def98.8%
*-commutative98.8%
*-commutative98.8%
*-commutative98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in l around 0 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification88.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (pow l 3.0) 0.3333333333333333)))
(if (<= l -2.05e+90)
(* J (+ t_0 (* l 2.0)))
(if (<= l 6200000000.0)
(+ U (* 2.0 (* l (* J (cos (* K 0.5))))))
(if (<= l 6.5e+95)
(/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))
(+ U (* J t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = pow(l, 3.0) * 0.3333333333333333;
double tmp;
if (l <= -2.05e+90) {
tmp = J * (t_0 + (l * 2.0));
} else if (l <= 6200000000.0) {
tmp = U + (2.0 * (l * (J * cos((K * 0.5)))));
} else if (l <= 6.5e+95) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} else {
tmp = U + (J * t_0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = (l ** 3.0d0) * 0.3333333333333333d0
if (l <= (-2.05d+90)) then
tmp = j * (t_0 + (l * 2.0d0))
else if (l <= 6200000000.0d0) then
tmp = u + (2.0d0 * (l * (j * cos((k * 0.5d0)))))
else if (l <= 6.5d+95) then
tmp = ((64.0d0 / (u * u)) - (u * u)) / (u + ((-8.0d0) / u))
else
tmp = u + (j * t_0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.pow(l, 3.0) * 0.3333333333333333;
double tmp;
if (l <= -2.05e+90) {
tmp = J * (t_0 + (l * 2.0));
} else if (l <= 6200000000.0) {
tmp = U + (2.0 * (l * (J * Math.cos((K * 0.5)))));
} else if (l <= 6.5e+95) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} else {
tmp = U + (J * t_0);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.pow(l, 3.0) * 0.3333333333333333 tmp = 0 if l <= -2.05e+90: tmp = J * (t_0 + (l * 2.0)) elif l <= 6200000000.0: tmp = U + (2.0 * (l * (J * math.cos((K * 0.5))))) elif l <= 6.5e+95: tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)) else: tmp = U + (J * t_0) return tmp
function code(J, l, K, U) t_0 = Float64((l ^ 3.0) * 0.3333333333333333) tmp = 0.0 if (l <= -2.05e+90) tmp = Float64(J * Float64(t_0 + Float64(l * 2.0))); elseif (l <= 6200000000.0) tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J * cos(Float64(K * 0.5)))))); elseif (l <= 6.5e+95) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))); else tmp = Float64(U + Float64(J * t_0)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (l ^ 3.0) * 0.3333333333333333; tmp = 0.0; if (l <= -2.05e+90) tmp = J * (t_0 + (l * 2.0)); elseif (l <= 6200000000.0) tmp = U + (2.0 * (l * (J * cos((K * 0.5))))); elseif (l <= 6.5e+95) tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)); else tmp = U + (J * t_0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Power[l, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, If[LessEqual[l, -2.05e+90], N[(J * N[(t$95$0 + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6200000000.0], N[(U + N[(2.0 * N[(l * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.5e+95], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{3} \cdot 0.3333333333333333\\
\mathbf{if}\;\ell \leq -2.05 \cdot 10^{+90}:\\
\;\;\;\;J \cdot \left(t_0 + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6200000000:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 6.5 \cdot 10^{+95}:\\
\;\;\;\;\frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot t_0\\
\end{array}
\end{array}
if l < -2.05000000000000021e90Initial program 100.0%
Taylor expanded in l around 0 98.3%
Taylor expanded in K around 0 79.0%
Taylor expanded in J around inf 79.0%
if -2.05000000000000021e90 < l < 6.2e9Initial program 74.4%
Taylor expanded in l around 0 88.0%
*-commutative88.0%
associate-*l*88.0%
*-commutative88.0%
Simplified88.0%
if 6.2e9 < l < 6.5e95Initial program 100.0%
Applied egg-rr4.3%
flip--54.7%
div-inv54.7%
frac-times54.7%
metadata-eval54.7%
+-commutative54.7%
Applied egg-rr54.7%
associate-*r/54.7%
*-rgt-identity54.7%
Simplified54.7%
if 6.5e95 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in K around 0 79.1%
Taylor expanded in l around inf 79.1%
associate-*r*79.1%
*-commutative79.1%
Simplified79.1%
Final simplification82.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (pow l 3.0) 0.3333333333333333)))
(if (<= l -2.05e+90)
(* J (+ t_0 (* l 2.0)))
(if (<= l 6200000000.0)
(+ U (* J (* (cos (* K 0.5)) (* l 2.0))))
(if (<= l 5.2e+97)
(/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))
(+ U (* J t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = pow(l, 3.0) * 0.3333333333333333;
double tmp;
if (l <= -2.05e+90) {
tmp = J * (t_0 + (l * 2.0));
} else if (l <= 6200000000.0) {
tmp = U + (J * (cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 5.2e+97) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} else {
tmp = U + (J * t_0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = (l ** 3.0d0) * 0.3333333333333333d0
if (l <= (-2.05d+90)) then
tmp = j * (t_0 + (l * 2.0d0))
else if (l <= 6200000000.0d0) then
tmp = u + (j * (cos((k * 0.5d0)) * (l * 2.0d0)))
else if (l <= 5.2d+97) then
tmp = ((64.0d0 / (u * u)) - (u * u)) / (u + ((-8.0d0) / u))
else
tmp = u + (j * t_0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.pow(l, 3.0) * 0.3333333333333333;
double tmp;
if (l <= -2.05e+90) {
tmp = J * (t_0 + (l * 2.0));
} else if (l <= 6200000000.0) {
tmp = U + (J * (Math.cos((K * 0.5)) * (l * 2.0)));
} else if (l <= 5.2e+97) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} else {
tmp = U + (J * t_0);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.pow(l, 3.0) * 0.3333333333333333 tmp = 0 if l <= -2.05e+90: tmp = J * (t_0 + (l * 2.0)) elif l <= 6200000000.0: tmp = U + (J * (math.cos((K * 0.5)) * (l * 2.0))) elif l <= 5.2e+97: tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)) else: tmp = U + (J * t_0) return tmp
function code(J, l, K, U) t_0 = Float64((l ^ 3.0) * 0.3333333333333333) tmp = 0.0 if (l <= -2.05e+90) tmp = Float64(J * Float64(t_0 + Float64(l * 2.0))); elseif (l <= 6200000000.0) tmp = Float64(U + Float64(J * Float64(cos(Float64(K * 0.5)) * Float64(l * 2.0)))); elseif (l <= 5.2e+97) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))); else tmp = Float64(U + Float64(J * t_0)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (l ^ 3.0) * 0.3333333333333333; tmp = 0.0; if (l <= -2.05e+90) tmp = J * (t_0 + (l * 2.0)); elseif (l <= 6200000000.0) tmp = U + (J * (cos((K * 0.5)) * (l * 2.0))); elseif (l <= 5.2e+97) tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)); else tmp = U + (J * t_0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Power[l, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, If[LessEqual[l, -2.05e+90], N[(J * N[(t$95$0 + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6200000000.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, 5.2e+97], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{3} \cdot 0.3333333333333333\\
\mathbf{if}\;\ell \leq -2.05 \cdot 10^{+90}:\\
\;\;\;\;J \cdot \left(t_0 + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6200000000:\\
\;\;\;\;U + J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 5.2 \cdot 10^{+97}:\\
\;\;\;\;\frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot t_0\\
\end{array}
\end{array}
if l < -2.05000000000000021e90Initial program 100.0%
Taylor expanded in l around 0 98.3%
Taylor expanded in K around 0 79.0%
Taylor expanded in J around inf 79.0%
if -2.05000000000000021e90 < l < 6.2e9Initial program 74.4%
Taylor expanded in l around 0 88.9%
Taylor expanded in J around 0 88.9%
associate-*r*88.9%
*-commutative88.9%
fma-def88.9%
*-commutative88.9%
*-commutative88.9%
*-commutative88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in l around 0 88.1%
*-commutative88.1%
Simplified88.1%
if 6.2e9 < l < 5.2e97Initial program 100.0%
Applied egg-rr4.3%
flip--54.7%
div-inv54.7%
frac-times54.7%
metadata-eval54.7%
+-commutative54.7%
Applied egg-rr54.7%
associate-*r/54.7%
*-rgt-identity54.7%
Simplified54.7%
if 5.2e97 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in K around 0 79.1%
Taylor expanded in l around inf 79.1%
associate-*r*79.1%
*-commutative79.1%
Simplified79.1%
Final simplification82.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (* (pow l 3.0) 0.3333333333333333)))))
(if (<= l -9e+17)
t_0
(if (<= l 6200000000.0)
(fma l (* J 2.0) U)
(if (<= l 2e+96)
(/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))
t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * (pow(l, 3.0) * 0.3333333333333333));
double tmp;
if (l <= -9e+17) {
tmp = t_0;
} else if (l <= 6200000000.0) {
tmp = fma(l, (J * 2.0), U);
} else if (l <= 2e+96) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64((l ^ 3.0) * 0.3333333333333333))) tmp = 0.0 if (l <= -9e+17) tmp = t_0; elseif (l <= 6200000000.0) tmp = fma(l, Float64(J * 2.0), U); elseif (l <= 2e+96) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(N[Power[l, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -9e+17], t$95$0, If[LessEqual[l, 6200000000.0], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 2e+96], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left({\ell}^{3} \cdot 0.3333333333333333\right)\\
\mathbf{if}\;\ell \leq -9 \cdot 10^{+17}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 6200000000:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+96}:\\
\;\;\;\;\frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -9e17 or 2.0000000000000001e96 < l Initial program 100.0%
Taylor expanded in l around 0 89.3%
Taylor expanded in K around 0 70.5%
Taylor expanded in l around inf 70.5%
associate-*r*70.5%
*-commutative70.5%
Simplified70.5%
if -9e17 < l < 6.2e9Initial program 70.9%
Taylor expanded in l around 0 96.5%
Taylor expanded in l around 0 96.4%
*-commutative96.4%
*-commutative96.4%
*-commutative96.4%
associate-*r*96.4%
*-commutative96.4%
associate-*r*96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in K around 0 83.7%
associate-*r*83.7%
*-commutative83.7%
associate-*l*83.7%
fma-def83.7%
Simplified83.7%
if 6.2e9 < l < 2.0000000000000001e96Initial program 100.0%
Applied egg-rr4.3%
flip--54.7%
div-inv54.7%
frac-times54.7%
metadata-eval54.7%
+-commutative54.7%
Applied egg-rr54.7%
associate-*r/54.7%
*-rgt-identity54.7%
Simplified54.7%
Final simplification76.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (pow l 3.0) 0.3333333333333333)))
(if (<= l -1.4e+18)
(* J (+ t_0 (* l 2.0)))
(if (<= l 6200000000.0)
(fma l (* J 2.0) U)
(if (<= l 1.85e+96)
(/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))
(+ U (* J t_0)))))))
double code(double J, double l, double K, double U) {
double t_0 = pow(l, 3.0) * 0.3333333333333333;
double tmp;
if (l <= -1.4e+18) {
tmp = J * (t_0 + (l * 2.0));
} else if (l <= 6200000000.0) {
tmp = fma(l, (J * 2.0), U);
} else if (l <= 1.85e+96) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} else {
tmp = U + (J * t_0);
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64((l ^ 3.0) * 0.3333333333333333) tmp = 0.0 if (l <= -1.4e+18) tmp = Float64(J * Float64(t_0 + Float64(l * 2.0))); elseif (l <= 6200000000.0) tmp = fma(l, Float64(J * 2.0), U); elseif (l <= 1.85e+96) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))); else tmp = Float64(U + Float64(J * t_0)); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Power[l, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, If[LessEqual[l, -1.4e+18], N[(J * N[(t$95$0 + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6200000000.0], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 1.85e+96], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{3} \cdot 0.3333333333333333\\
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{+18}:\\
\;\;\;\;J \cdot \left(t_0 + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6200000000:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 1.85 \cdot 10^{+96}:\\
\;\;\;\;\frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot t_0\\
\end{array}
\end{array}
if l < -1.4e18Initial program 100.0%
Taylor expanded in l around 0 83.0%
Taylor expanded in K around 0 65.5%
Taylor expanded in J around inf 65.5%
if -1.4e18 < l < 6.2e9Initial program 70.9%
Taylor expanded in l around 0 96.5%
Taylor expanded in l around 0 96.4%
*-commutative96.4%
*-commutative96.4%
*-commutative96.4%
associate-*r*96.4%
*-commutative96.4%
associate-*r*96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in K around 0 83.7%
associate-*r*83.7%
*-commutative83.7%
associate-*l*83.7%
fma-def83.7%
Simplified83.7%
if 6.2e9 < l < 1.84999999999999996e96Initial program 100.0%
Applied egg-rr4.3%
flip--54.7%
div-inv54.7%
frac-times54.7%
metadata-eval54.7%
+-commutative54.7%
Applied egg-rr54.7%
associate-*r/54.7%
*-rgt-identity54.7%
Simplified54.7%
if 1.84999999999999996e96 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in K around 0 79.1%
Taylor expanded in l around inf 79.1%
associate-*r*79.1%
*-commutative79.1%
Simplified79.1%
Final simplification76.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= l -5.4e+251)
t_0
(if (<= l 6200000000.0)
(fma l (* J 2.0) U)
(if (<= l 9e+169)
(/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))
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 <= -5.4e+251) {
tmp = t_0;
} else if (l <= 6200000000.0) {
tmp = fma(l, (J * 2.0), U);
} else if (l <= 9e+169) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} 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 <= -5.4e+251) tmp = t_0; elseif (l <= 6200000000.0) tmp = fma(l, Float64(J * 2.0), U); elseif (l <= 9e+169) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))); else tmp = t_0; 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]}, If[LessEqual[l, -5.4e+251], t$95$0, If[LessEqual[l, 6200000000.0], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 9e+169], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $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 -5.4 \cdot 10^{+251}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 6200000000:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 9 \cdot 10^{+169}:\\
\;\;\;\;\frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -5.4000000000000002e251 or 8.9999999999999999e169 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in l around 0 36.1%
*-commutative36.1%
*-commutative36.1%
*-commutative36.1%
associate-*r*36.1%
*-commutative36.1%
associate-*r*36.1%
*-commutative36.1%
Simplified36.1%
Taylor expanded in K around 0 23.7%
associate-*r*23.7%
distribute-rgt-out53.7%
*-commutative53.7%
unpow253.7%
Simplified53.7%
if -5.4000000000000002e251 < l < 6.2e9Initial program 80.5%
Taylor expanded in l around 0 91.0%
Taylor expanded in l around 0 76.3%
*-commutative76.3%
*-commutative76.3%
*-commutative76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in K around 0 67.2%
associate-*r*67.2%
*-commutative67.2%
associate-*l*67.2%
fma-def67.2%
Simplified67.2%
if 6.2e9 < l < 8.9999999999999999e169Initial program 100.0%
Applied egg-rr3.7%
flip--40.6%
div-inv40.6%
frac-times40.6%
metadata-eval40.6%
+-commutative40.6%
Applied egg-rr40.6%
associate-*r/40.6%
*-rgt-identity40.6%
Simplified40.6%
Final simplification62.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= l -5.9e+251)
t_0
(if (<= l 6200000000.0)
(+ U (* l (* J 2.0)))
(if (<= l 8.5e+169)
(/ (- (/ 64.0 (* U U)) (* U U)) (+ U (/ -8.0 U)))
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 <= -5.9e+251) {
tmp = t_0;
} else if (l <= 6200000000.0) {
tmp = U + (l * (J * 2.0));
} else if (l <= 8.5e+169) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
if (l <= (-5.9d+251)) then
tmp = t_0
else if (l <= 6200000000.0d0) then
tmp = u + (l * (j * 2.0d0))
else if (l <= 8.5d+169) then
tmp = ((64.0d0 / (u * u)) - (u * u)) / (u + ((-8.0d0) / u))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -5.9e+251) {
tmp = t_0;
} else if (l <= 6200000000.0) {
tmp = U + (l * (J * 2.0));
} else if (l <= 8.5e+169) {
tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U));
} 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 <= -5.9e+251: tmp = t_0 elif l <= 6200000000.0: tmp = U + (l * (J * 2.0)) elif l <= 8.5e+169: tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)) 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 <= -5.9e+251) tmp = t_0; elseif (l <= 6200000000.0) tmp = Float64(U + Float64(l * Float64(J * 2.0))); elseif (l <= 8.5e+169) tmp = Float64(Float64(Float64(64.0 / Float64(U * U)) - Float64(U * U)) / Float64(U + Float64(-8.0 / U))); 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 <= -5.9e+251) tmp = t_0; elseif (l <= 6200000000.0) tmp = U + (l * (J * 2.0)); elseif (l <= 8.5e+169) tmp = ((64.0 / (U * U)) - (U * U)) / (U + (-8.0 / U)); 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, -5.9e+251], t$95$0, If[LessEqual[l, 6200000000.0], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e+169], N[(N[(N[(64.0 / N[(U * U), $MachinePrecision]), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + N[(-8.0 / U), $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 -5.9 \cdot 10^{+251}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 6200000000:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+169}:\\
\;\;\;\;\frac{\frac{64}{U \cdot U} - U \cdot U}{U + \frac{-8}{U}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -5.8999999999999999e251 or 8.5000000000000004e169 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in l around 0 36.1%
*-commutative36.1%
*-commutative36.1%
*-commutative36.1%
associate-*r*36.1%
*-commutative36.1%
associate-*r*36.1%
*-commutative36.1%
Simplified36.1%
Taylor expanded in K around 0 23.7%
associate-*r*23.7%
distribute-rgt-out53.7%
*-commutative53.7%
unpow253.7%
Simplified53.7%
if -5.8999999999999999e251 < l < 6.2e9Initial program 80.5%
Taylor expanded in l around 0 91.0%
Taylor expanded in l around 0 76.3%
*-commutative76.3%
*-commutative76.3%
*-commutative76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in K around 0 67.2%
associate-*r*67.2%
*-commutative67.2%
associate-*l*67.2%
Simplified67.2%
if 6.2e9 < l < 8.5000000000000004e169Initial program 100.0%
Applied egg-rr3.7%
flip--40.6%
div-inv40.6%
frac-times40.6%
metadata-eval40.6%
+-commutative40.6%
Applied egg-rr40.6%
associate-*r/40.6%
*-rgt-identity40.6%
Simplified40.6%
Final simplification62.1%
(FPCore (J l K U) :precision binary64 (if (or (<= l -2.05e+251) (not (<= l 3e+14))) (+ 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 <= -2.05e+251) || !(l <= 3e+14)) {
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 <= (-2.05d+251)) .or. (.not. (l <= 3d+14))) 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 <= -2.05e+251) || !(l <= 3e+14)) {
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 <= -2.05e+251) or not (l <= 3e+14): 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 <= -2.05e+251) || !(l <= 3e+14)) 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 <= -2.05e+251) || ~((l <= 3e+14))) 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, -2.05e+251], N[Not[LessEqual[l, 3e+14]], $MachinePrecision]], 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 -2.05 \cdot 10^{+251} \lor \neg \left(\ell \leq 3 \cdot 10^{+14}\right):\\
\;\;\;\;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 < -2.0500000000000001e251 or 3e14 < l Initial program 100.0%
Taylor expanded in l around 0 88.7%
Taylor expanded in l around 0 26.0%
*-commutative26.0%
*-commutative26.0%
*-commutative26.0%
associate-*r*26.0%
*-commutative26.0%
associate-*r*26.0%
*-commutative26.0%
Simplified26.0%
Taylor expanded in K around 0 21.2%
associate-*r*21.2%
distribute-rgt-out42.1%
*-commutative42.1%
unpow242.1%
Simplified42.1%
if -2.0500000000000001e251 < l < 3e14Initial program 80.6%
Taylor expanded in l around 0 90.5%
Taylor expanded in l around 0 75.9%
*-commutative75.9%
*-commutative75.9%
*-commutative75.9%
associate-*r*75.9%
*-commutative75.9%
associate-*r*75.9%
*-commutative75.9%
Simplified75.9%
Taylor expanded in K around 0 66.8%
associate-*r*66.8%
*-commutative66.8%
associate-*l*66.8%
Simplified66.8%
Final simplification60.3%
(FPCore (J l K U) :precision binary64 (if (<= K 8.2e+238) (+ U (* l (* J 2.0))) (+ U (* J (+ 512.0 (* (* K K) -64.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (K <= 8.2e+238) {
tmp = U + (l * (J * 2.0));
} else {
tmp = U + (J * (512.0 + ((K * K) * -64.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 (k <= 8.2d+238) then
tmp = u + (l * (j * 2.0d0))
else
tmp = u + (j * (512.0d0 + ((k * k) * (-64.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (K <= 8.2e+238) {
tmp = U + (l * (J * 2.0));
} else {
tmp = U + (J * (512.0 + ((K * K) * -64.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if K <= 8.2e+238: tmp = U + (l * (J * 2.0)) else: tmp = U + (J * (512.0 + ((K * K) * -64.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if (K <= 8.2e+238) tmp = Float64(U + Float64(l * Float64(J * 2.0))); else tmp = Float64(U + Float64(J * Float64(512.0 + Float64(Float64(K * K) * -64.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (K <= 8.2e+238) tmp = U + (l * (J * 2.0)); else tmp = U + (J * (512.0 + ((K * K) * -64.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[K, 8.2e+238], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(512.0 + N[(N[(K * K), $MachinePrecision] * -64.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;K \leq 8.2 \cdot 10^{+238}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(512 + \left(K \cdot K\right) \cdot -64\right)\\
\end{array}
\end{array}
if K < 8.1999999999999998e238Initial program 85.8%
Taylor expanded in l around 0 90.4%
Taylor expanded in l around 0 63.4%
*-commutative63.4%
*-commutative63.4%
*-commutative63.4%
associate-*r*63.4%
*-commutative63.4%
associate-*r*63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in K around 0 54.6%
associate-*r*54.6%
*-commutative54.6%
associate-*l*54.6%
Simplified54.6%
if 8.1999999999999998e238 < K Initial program 83.9%
Applied egg-rr3.8%
Taylor expanded in K around 0 42.1%
+-commutative42.1%
associate-*r*42.1%
distribute-rgt-out42.1%
*-commutative42.1%
unpow242.1%
Simplified42.1%
Final simplification54.0%
(FPCore (J l K U) :precision binary64 (if (<= l -4.8e+68) (* U U) (if (<= l 850.0) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.8e+68) {
tmp = U * U;
} else if (l <= 850.0) {
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 <= (-4.8d+68)) then
tmp = u * u
else if (l <= 850.0d0) 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 <= -4.8e+68) {
tmp = U * U;
} else if (l <= 850.0) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -4.8e+68: tmp = U * U elif l <= 850.0: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -4.8e+68) tmp = Float64(U * U); elseif (l <= 850.0) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -4.8e+68) tmp = U * U; elseif (l <= 850.0) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.8e+68], N[(U * U), $MachinePrecision], If[LessEqual[l, 850.0], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{+68}:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 850:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -4.80000000000000016e68 or 850 < l Initial program 100.0%
Applied egg-rr14.9%
if -4.80000000000000016e68 < l < 850Initial program 72.9%
Taylor expanded in J around 0 62.3%
Final simplification39.9%
(FPCore (J l K U) :precision binary64 (if (<= l -4.8e+68) (* U (- U -8.0)) (if (<= l 1050.0) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.8e+68) {
tmp = U * (U - -8.0);
} else if (l <= 1050.0) {
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 <= (-4.8d+68)) then
tmp = u * (u - (-8.0d0))
else if (l <= 1050.0d0) 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 <= -4.8e+68) {
tmp = U * (U - -8.0);
} else if (l <= 1050.0) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -4.8e+68: tmp = U * (U - -8.0) elif l <= 1050.0: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -4.8e+68) tmp = Float64(U * Float64(U - -8.0)); elseif (l <= 1050.0) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -4.8e+68) tmp = U * (U - -8.0); elseif (l <= 1050.0) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.8e+68], N[(U * N[(U - -8.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1050.0], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{+68}:\\
\;\;\;\;U \cdot \left(U - -8\right)\\
\mathbf{elif}\;\ell \leq 1050:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -4.80000000000000016e68Initial program 100.0%
Applied egg-rr14.6%
if -4.80000000000000016e68 < l < 1050Initial program 72.9%
Taylor expanded in J around 0 62.3%
if 1050 < l Initial program 100.0%
Applied egg-rr15.2%
Final simplification39.9%
(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.7%
Taylor expanded in l around 0 90.1%
Taylor expanded in l around 0 62.9%
*-commutative62.9%
*-commutative62.9%
*-commutative62.9%
associate-*r*62.9%
*-commutative62.9%
associate-*r*62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in K around 0 52.9%
associate-*r*52.9%
*-commutative52.9%
associate-*l*52.9%
Simplified52.9%
Final simplification52.9%
(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.7%
Applied egg-rr2.7%
*-inverses2.7%
Simplified2.7%
Final simplification2.7%
(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.7%
Taylor expanded in J around 0 34.0%
Final simplification34.0%
herbie shell --seed 2023224
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))