
(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 18 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 (+ (* (* (cos (/ K 2.0)) (* 2.0 (sinh l))) J) U))
double code(double J, double l, double K, double U) {
return ((cos((K / 2.0)) * (2.0 * sinh(l))) * J) + 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 = ((cos((k / 2.0d0)) * (2.0d0 * sinh(l))) * j) + u
end function
public static double code(double J, double l, double K, double U) {
return ((Math.cos((K / 2.0)) * (2.0 * Math.sinh(l))) * J) + U;
}
def code(J, l, K, U): return ((math.cos((K / 2.0)) * (2.0 * math.sinh(l))) * J) + U
function code(J, l, K, U) return Float64(Float64(Float64(cos(Float64(K / 2.0)) * Float64(2.0 * sinh(l))) * J) + U) end
function tmp = code(J, l, K, U) tmp = ((cos((K / 2.0)) * (2.0 * sinh(l))) * J) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(\cos \left(\frac{K}{2}\right) \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot J + U
\end{array}
Initial program 86.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.988)
(+ U (* t_0 (* l (* 2.0 J))))
(if (<= t_0 -0.62)
(+
U
(*
(* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))
(+
1.0
(*
K
(*
K
(+
-0.125
(*
(* K K)
(+
0.0026041666666666665
(* K (* K -2.170138888888889e-5))))))))))
(if (<= t_0 -0.04)
(+ U (* l (* t_0 (* 2.0 J))))
(+ U (* (* 2.0 (sinh l)) J)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.988) {
tmp = U + (t_0 * (l * (2.0 * J)));
} else if (t_0 <= -0.62) {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5)))))))));
} else if (t_0 <= -0.04) {
tmp = U + (l * (t_0 * (2.0 * J)));
} else {
tmp = U + ((2.0 * sinh(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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= (-0.988d0)) then
tmp = u + (t_0 * (l * (2.0d0 * j)))
else if (t_0 <= (-0.62d0)) then
tmp = u + ((j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))) * (1.0d0 + (k * (k * ((-0.125d0) + ((k * k) * (0.0026041666666666665d0 + (k * (k * (-2.170138888888889d-5))))))))))
else if (t_0 <= (-0.04d0)) then
tmp = u + (l * (t_0 * (2.0d0 * j)))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
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.988) {
tmp = U + (t_0 * (l * (2.0 * J)));
} else if (t_0 <= -0.62) {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5)))))))));
} else if (t_0 <= -0.04) {
tmp = U + (l * (t_0 * (2.0 * J)));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.988: tmp = U + (t_0 * (l * (2.0 * J))) elif t_0 <= -0.62: tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5))))))))) elif t_0 <= -0.04: tmp = U + (l * (t_0 * (2.0 * J))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.988) tmp = Float64(U + Float64(t_0 * Float64(l * Float64(2.0 * J)))); elseif (t_0 <= -0.62) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) * Float64(1.0 + Float64(K * Float64(K * Float64(-0.125 + Float64(Float64(K * K) * Float64(0.0026041666666666665 + Float64(K * Float64(K * -2.170138888888889e-5)))))))))); elseif (t_0 <= -0.04) tmp = Float64(U + Float64(l * Float64(t_0 * Float64(2.0 * J)))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); 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.988) tmp = U + (t_0 * (l * (2.0 * J))); elseif (t_0 <= -0.62) tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5))))))))); elseif (t_0 <= -0.04) tmp = U + (l * (t_0 * (2.0 * J))); else tmp = U + ((2.0 * sinh(l)) * J); 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.988], N[(U + N[(t$95$0 * N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.62], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * N[(-0.125 + N[(N[(K * K), $MachinePrecision] * N[(0.0026041666666666665 + N[(K * N[(K * -2.170138888888889e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.04], N[(U + N[(l * N[(t$95$0 * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -0.988:\\
\;\;\;\;U + t\_0 \cdot \left(\ell \cdot \left(2 \cdot J\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.62:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + K \cdot \left(K \cdot \left(-0.125 + \left(K \cdot K\right) \cdot \left(0.0026041666666666665 + K \cdot \left(K \cdot -2.170138888888889 \cdot 10^{-5}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.04:\\
\;\;\;\;U + \ell \cdot \left(t\_0 \cdot \left(2 \cdot J\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.98799999999999999Initial program 52.2%
Taylor expanded in l around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6489.8%
Simplified89.8%
if -0.98799999999999999 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.619999999999999996Initial program 97.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.5%
Simplified79.5%
Taylor expanded in K around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.0%
Simplified85.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6485.0%
Applied egg-rr85.0%
if -0.619999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 85.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.4%
Simplified92.4%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6465.2%
Simplified65.2%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6465.3%
Applied egg-rr65.3%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 86.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6486.5%
Simplified86.5%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6495.8%
Applied egg-rr95.8%
Final simplification91.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (+ U (* t_0 (* l (* 2.0 J))))))
(if (<= t_0 -0.988)
t_1
(if (<= t_0 -0.62)
(+
U
(*
(* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))
(+
1.0
(*
K
(*
K
(+
-0.125
(*
(* K K)
(+
0.0026041666666666665
(* K (* K -2.170138888888889e-5))))))))))
(if (<= t_0 -0.04) t_1 (+ U (* (* 2.0 (sinh l)) J)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = U + (t_0 * (l * (2.0 * J)));
double tmp;
if (t_0 <= -0.988) {
tmp = t_1;
} else if (t_0 <= -0.62) {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5)))))))));
} else if (t_0 <= -0.04) {
tmp = t_1;
} else {
tmp = U + ((2.0 * sinh(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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = u + (t_0 * (l * (2.0d0 * j)))
if (t_0 <= (-0.988d0)) then
tmp = t_1
else if (t_0 <= (-0.62d0)) then
tmp = u + ((j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))) * (1.0d0 + (k * (k * ((-0.125d0) + ((k * k) * (0.0026041666666666665d0 + (k * (k * (-2.170138888888889d-5))))))))))
else if (t_0 <= (-0.04d0)) then
tmp = t_1
else
tmp = u + ((2.0d0 * sinh(l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = U + (t_0 * (l * (2.0 * J)));
double tmp;
if (t_0 <= -0.988) {
tmp = t_1;
} else if (t_0 <= -0.62) {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5)))))))));
} else if (t_0 <= -0.04) {
tmp = t_1;
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = U + (t_0 * (l * (2.0 * J))) tmp = 0 if t_0 <= -0.988: tmp = t_1 elif t_0 <= -0.62: tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5))))))))) elif t_0 <= -0.04: tmp = t_1 else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(U + Float64(t_0 * Float64(l * Float64(2.0 * J)))) tmp = 0.0 if (t_0 <= -0.988) tmp = t_1; elseif (t_0 <= -0.62) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) * Float64(1.0 + Float64(K * Float64(K * Float64(-0.125 + Float64(Float64(K * K) * Float64(0.0026041666666666665 + Float64(K * Float64(K * -2.170138888888889e-5)))))))))); elseif (t_0 <= -0.04) tmp = t_1; else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = U + (t_0 * (l * (2.0 * J))); tmp = 0.0; if (t_0 <= -0.988) tmp = t_1; elseif (t_0 <= -0.62) tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (K * (K * (-0.125 + ((K * K) * (0.0026041666666666665 + (K * (K * -2.170138888888889e-5))))))))); elseif (t_0 <= -0.04) tmp = t_1; else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(t$95$0 * N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.988], t$95$1, If[LessEqual[t$95$0, -0.62], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * N[(-0.125 + N[(N[(K * K), $MachinePrecision] * N[(0.0026041666666666665 + N[(K * N[(K * -2.170138888888889e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.04], t$95$1, N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := U + t\_0 \cdot \left(\ell \cdot \left(2 \cdot J\right)\right)\\
\mathbf{if}\;t\_0 \leq -0.988:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq -0.62:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + K \cdot \left(K \cdot \left(-0.125 + \left(K \cdot K\right) \cdot \left(0.0026041666666666665 + K \cdot \left(K \cdot -2.170138888888889 \cdot 10^{-5}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.04:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.98799999999999999 or -0.619999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 75.7%
Taylor expanded in l around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6472.2%
Simplified72.2%
if -0.98799999999999999 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.619999999999999996Initial program 97.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.5%
Simplified79.5%
Taylor expanded in K around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.0%
Simplified85.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6485.0%
Applied egg-rr85.0%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 86.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6486.5%
Simplified86.5%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6495.8%
Applied egg-rr95.8%
Final simplification91.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.9825)
(+
U
(*
t_0
(*
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
l
(*
l
(+ 0.016666666666666666 (* l (* l 0.0003968253968253968))))))))
(* l J))))
(+ U (* (* 2.0 (sinh l)) J)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.9825) {
tmp = U + (t_0 * ((2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))) * (l * J)));
} else {
tmp = U + ((2.0 * sinh(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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.9825d0) then
tmp = u + (t_0 * ((2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + (l * (l * 0.0003968253968253968d0)))))))) * (l * j)))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
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.9825) {
tmp = U + (t_0 * ((2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))) * (l * J)));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.9825: tmp = U + (t_0 * ((2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))) * (l * J))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.9825) tmp = Float64(U + Float64(t_0 * Float64(Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * Float64(0.016666666666666666 + Float64(l * Float64(l * 0.0003968253968253968)))))))) * Float64(l * J)))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); 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.9825) tmp = U + (t_0 * ((2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))) * (l * J))); else tmp = U + ((2.0 * sinh(l)) * J); 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.9825], N[(U + N[(t$95$0 * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * N[(0.016666666666666666 + N[(l * N[(l * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.9825:\\
\;\;\;\;U + t\_0 \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\right) \cdot \left(\ell \cdot J\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.98250000000000004Initial program 85.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.6%
Simplified96.6%
*-lowering-*.f64N/A
Applied egg-rr96.6%
if 0.98250000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 87.8%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6487.8%
Simplified87.8%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Final simplification98.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.9825)
(+
U
(*
t_0
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
(* l l)
(+ 0.016666666666666666 (* l (* l 0.0003968253968253968)))))))))))
(+ U (* (* 2.0 (sinh l)) J)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.9825) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))))));
} else {
tmp = U + ((2.0 * sinh(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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.9825d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * (0.016666666666666666d0 + (l * (l * 0.0003968253968253968d0))))))))))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
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.9825) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))))));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.9825: tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.9825) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(l * Float64(l * 0.0003968253968253968))))))))))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); 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.9825) tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))))); else tmp = U + ((2.0 * sinh(l)) * J); 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.9825], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(l * N[(l * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.9825:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.98250000000000004Initial program 85.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.6%
Simplified96.6%
if 0.98250000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 87.8%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6487.8%
Simplified87.8%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Final simplification98.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.9825)
(+
U
(*
t_0
(*
J
(*
l
(+
2.0
(*
l
(* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))))
(+ U (* (* 2.0 (sinh l)) J)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.9825) {
tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))));
} else {
tmp = U + ((2.0 * sinh(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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.9825d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
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.9825) {
tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.9825: tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.9825) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); 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.9825) tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))); else tmp = U + ((2.0 * sinh(l)) * J); 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.9825], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.9825:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.98250000000000004Initial program 85.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
if 0.98250000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 87.8%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6487.8%
Simplified87.8%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Final simplification97.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.9825)
(+ U (* t_0 (* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))))
(+ U (* (* 2.0 (sinh l)) J)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.9825) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = U + ((2.0 * sinh(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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.9825d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
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.9825) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.9825: tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333))))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.9825) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); 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.9825) tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333))))); else tmp = U + ((2.0 * sinh(l)) * J); 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.9825], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.9825:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.98250000000000004Initial program 85.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.7%
Simplified85.7%
if 0.98250000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 87.8%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6487.8%
Simplified87.8%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Final simplification93.0%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.04) (+ U (* l (* (cos (* K 0.5)) (* J (+ 2.0 (* (* l l) 0.3333333333333333)))))) (+ U (* (* 2.0 (sinh l)) J))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = U + ((2.0 * sinh(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 (cos((k / 2.0d0)) <= (-0.04d0)) then
tmp = u + (l * (cos((k * 0.5d0)) * (j * (2.0d0 + ((l * l) * 0.3333333333333333d0)))))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= -0.04) {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.04: tmp = U + (l * (math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333))))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.04) tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333))))); else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 86.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified80.1%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 86.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6486.5%
Simplified86.5%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6495.8%
Applied egg-rr95.8%
Final simplification91.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(*
(* (* l J) (cos (* K 0.5)))
(+ 2.0 (* l (* l 0.3333333333333333))))))
(if (<= l -1.18e+113)
t_0
(if (<= l -0.0155)
(+ U (* (* 2.0 (sinh l)) J))
(if (<= l 1.62e-21)
(+ U (* (cos (/ K 2.0)) (* l (* 2.0 J))))
(if (<= l 1.4e+144)
(+ U (* J (+ (exp l) (/ -1.0 (+ l 1.0)))))
t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = ((l * J) * cos((K * 0.5))) * (2.0 + (l * (l * 0.3333333333333333)));
double tmp;
if (l <= -1.18e+113) {
tmp = t_0;
} else if (l <= -0.0155) {
tmp = U + ((2.0 * sinh(l)) * J);
} else if (l <= 1.62e-21) {
tmp = U + (cos((K / 2.0)) * (l * (2.0 * J)));
} else if (l <= 1.4e+144) {
tmp = U + (J * (exp(l) + (-1.0 / (l + 1.0))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = ((l * j) * cos((k * 0.5d0))) * (2.0d0 + (l * (l * 0.3333333333333333d0)))
if (l <= (-1.18d+113)) then
tmp = t_0
else if (l <= (-0.0155d0)) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else if (l <= 1.62d-21) then
tmp = u + (cos((k / 2.0d0)) * (l * (2.0d0 * j)))
else if (l <= 1.4d+144) then
tmp = u + (j * (exp(l) + ((-1.0d0) / (l + 1.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = ((l * J) * Math.cos((K * 0.5))) * (2.0 + (l * (l * 0.3333333333333333)));
double tmp;
if (l <= -1.18e+113) {
tmp = t_0;
} else if (l <= -0.0155) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else if (l <= 1.62e-21) {
tmp = U + (Math.cos((K / 2.0)) * (l * (2.0 * J)));
} else if (l <= 1.4e+144) {
tmp = U + (J * (Math.exp(l) + (-1.0 / (l + 1.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = ((l * J) * math.cos((K * 0.5))) * (2.0 + (l * (l * 0.3333333333333333))) tmp = 0 if l <= -1.18e+113: tmp = t_0 elif l <= -0.0155: tmp = U + ((2.0 * math.sinh(l)) * J) elif l <= 1.62e-21: tmp = U + (math.cos((K / 2.0)) * (l * (2.0 * J))) elif l <= 1.4e+144: tmp = U + (J * (math.exp(l) + (-1.0 / (l + 1.0)))) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(Float64(Float64(l * J) * cos(Float64(K * 0.5))) * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))) tmp = 0.0 if (l <= -1.18e+113) tmp = t_0; elseif (l <= -0.0155) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); elseif (l <= 1.62e-21) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(2.0 * J)))); elseif (l <= 1.4e+144) tmp = Float64(U + Float64(J * Float64(exp(l) + Float64(-1.0 / Float64(l + 1.0))))); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = ((l * J) * cos((K * 0.5))) * (2.0 + (l * (l * 0.3333333333333333))); tmp = 0.0; if (l <= -1.18e+113) tmp = t_0; elseif (l <= -0.0155) tmp = U + ((2.0 * sinh(l)) * J); elseif (l <= 1.62e-21) tmp = U + (cos((K / 2.0)) * (l * (2.0 * J))); elseif (l <= 1.4e+144) tmp = U + (J * (exp(l) + (-1.0 / (l + 1.0)))); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[(l * J), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.18e+113], t$95$0, If[LessEqual[l, -0.0155], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.62e-21], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.4e+144], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] + N[(-1.0 / N[(l + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\ell \cdot J\right) \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\\
\mathbf{if}\;\ell \leq -1.18 \cdot 10^{+113}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -0.0155:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{elif}\;\ell \leq 1.62 \cdot 10^{-21}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(2 \cdot J\right)\right)\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+144}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} + \frac{-1}{\ell + 1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.18000000000000008e113 or 1.40000000000000003e144 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in J around inf
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.4%
Simplified95.4%
if -1.18000000000000008e113 < l < -0.0155Initial program 100.0%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6477.8%
Simplified77.8%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6477.8%
Applied egg-rr77.8%
if -0.0155 < l < 1.62000000000000003e-21Initial program 70.9%
Taylor expanded in l around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
if 1.62000000000000003e-21 < l < 1.40000000000000003e144Initial program 100.0%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6475.6%
Simplified75.6%
Taylor expanded in l around 0
+-commutativeN/A
+-lowering-+.f6475.8%
Simplified75.8%
Final simplification93.2%
(FPCore (J l K U)
:precision binary64
(if (<= l 4e+198)
(+ U (* (* 2.0 (sinh l)) J))
(+
U
(*
(* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))
(+ 1.0 (* -0.125 (* K K)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 4e+198) {
tmp = U + ((2.0 * sinh(l)) * J);
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-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 <= 4d+198) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else
tmp = u + ((j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))) * (1.0d0 + ((-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 <= 4e+198) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 4e+198: tmp = U + ((2.0 * math.sinh(l)) * J) else: tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K)))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 4e+198) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); else tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 4e+198) tmp = U + ((2.0 * sinh(l)) * J); else tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 4e+198], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4 \cdot 10^{+198}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
\end{array}
\end{array}
if l < 4.00000000000000007e198Initial program 84.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6471.7%
Simplified71.7%
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6479.2%
Applied egg-rr79.2%
if 4.00000000000000007e198 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.9%
Simplified83.9%
Final simplification79.8%
(FPCore (J l K U)
:precision binary64
(if (<= l 1.5e+149)
(+
U
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
(* l l)
(+ 0.016666666666666666 (* (* l l) 0.0003968253968253968)))))))))
(+
U
(*
(* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))
(+ 1.0 (* -0.125 (* K K)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.5e+149) {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-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 <= 1.5d+149) then
tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0))))))))
else
tmp = u + ((j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))) * (1.0d0 + ((-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 <= 1.5e+149) {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.5e+149: tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))) else: tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K)))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.5e+149) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968))))))))); else tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.5e+149) tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))); else tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.5e+149], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.5 \cdot 10^{+149}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
\end{array}
\end{array}
if l < 1.50000000000000002e149Initial program 83.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6472.3%
Simplified72.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.6%
Simplified77.6%
if 1.50000000000000002e149 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.3%
Simplified77.3%
Final simplification77.6%
(FPCore (J l K U)
:precision binary64
(if (<= l 1.6e+149)
(+
U
(*
J
(*
l
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))
(+
U
(*
(* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))
(+ 1.0 (* -0.125 (* K K)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.6e+149) {
tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-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 <= 1.6d+149) then
tmp = u + (j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
else
tmp = u + ((j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))) * (1.0d0 + ((-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 <= 1.6e+149) {
tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.6e+149: tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) else: tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K)))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.6e+149) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))))); else tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.6e+149) tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); else tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * (1.0 + (-0.125 * (K * K)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.6e+149], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.6 \cdot 10^{+149}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
\end{array}
\end{array}
if l < 1.6000000000000001e149Initial program 83.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6472.3%
Simplified72.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.2%
Simplified77.2%
if 1.6000000000000001e149 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.3%
Simplified77.3%
Final simplification77.2%
(FPCore (J l K U)
:precision binary64
(+
U
(*
J
(*
l
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))))
double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
}
def code(J, l, K, U): return U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))))) end
function tmp = code(J, l, K, U) tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)
\end{array}
Initial program 86.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6470.8%
Simplified70.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.8%
Simplified74.8%
Final simplification74.8%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* 2.0 l)))) (if (<= l -1.45e-22) t_0 (if (<= l 1.3e+17) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (2.0 * l);
double tmp;
if (l <= -1.45e-22) {
tmp = t_0;
} else if (l <= 1.3e+17) {
tmp = 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 = j * (2.0d0 * l)
if (l <= (-1.45d-22)) then
tmp = t_0
else if (l <= 1.3d+17) then
tmp = 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 = J * (2.0 * l);
double tmp;
if (l <= -1.45e-22) {
tmp = t_0;
} else if (l <= 1.3e+17) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (2.0 * l) tmp = 0 if l <= -1.45e-22: tmp = t_0 elif l <= 1.3e+17: tmp = U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(2.0 * l)) tmp = 0.0 if (l <= -1.45e-22) tmp = t_0; elseif (l <= 1.3e+17) tmp = U; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (2.0 * l); tmp = 0.0; if (l <= -1.45e-22) tmp = t_0; elseif (l <= 1.3e+17) tmp = U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.45e-22], t$95$0, If[LessEqual[l, 1.3e+17], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(2 \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -1.45 \cdot 10^{-22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+17}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.4500000000000001e-22 or 1.3e17 < l Initial program 98.0%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6469.3%
Simplified69.3%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6427.1%
Simplified27.1%
Taylor expanded in J around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6426.5%
Simplified26.5%
if -1.4500000000000001e-22 < l < 1.3e17Initial program 73.9%
Taylor expanded in J around 0
Simplified71.5%
Final simplification47.6%
(FPCore (J l K U) :precision binary64 (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
def code(J, l, K, U): return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))) end
function tmp = code(J, l, K, U) tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333))))); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)
\end{array}
Initial program 86.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6470.8%
Simplified70.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6469.3%
Simplified69.3%
Final simplification69.3%
(FPCore (J l K U) :precision binary64 (* U (+ 1.0 (/ (* J (* 2.0 l)) U))))
double code(double J, double l, double K, double U) {
return U * (1.0 + ((J * (2.0 * l)) / 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 * (1.0d0 + ((j * (2.0d0 * l)) / u))
end function
public static double code(double J, double l, double K, double U) {
return U * (1.0 + ((J * (2.0 * l)) / U));
}
def code(J, l, K, U): return U * (1.0 + ((J * (2.0 * l)) / U))
function code(J, l, K, U) return Float64(U * Float64(1.0 + Float64(Float64(J * Float64(2.0 * l)) / U))) end
function tmp = code(J, l, K, U) tmp = U * (1.0 + ((J * (2.0 * l)) / U)); end
code[J_, l_, K_, U_] := N[(U * N[(1.0 + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U \cdot \left(1 + \frac{J \cdot \left(2 \cdot \ell\right)}{U}\right)
\end{array}
Initial program 86.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6470.8%
Simplified70.8%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6453.6%
Simplified53.6%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
associate-*r*N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6457.8%
Simplified57.8%
Final simplification57.8%
(FPCore (J l K U) :precision binary64 (+ U (* J (* 2.0 l))))
double code(double J, double l, double K, double U) {
return U + (J * (2.0 * l));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (2.0d0 * l))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (2.0 * l));
}
def code(J, l, K, U): return U + (J * (2.0 * l))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(2.0 * l))) end
function tmp = code(J, l, K, U) tmp = U + (J * (2.0 * l)); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 86.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
exp-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6470.8%
Simplified70.8%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6453.6%
Simplified53.6%
Final simplification53.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 86.7%
Taylor expanded in J around 0
Simplified34.9%
herbie shell --seed 2024144
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))