
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U) :precision binary64 (+ (* (* (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 87.1%
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.f6499.9%
Applied egg-rr99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.96)
(+ 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.96) {
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.96d0) 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.96) {
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.96: 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.96) 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.96) 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.96], 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.96:\\
\;\;\;\;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.95999999999999996Initial program 84.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.2%
Simplified94.2%
if 0.95999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.5%
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.f6489.5%
Simplified89.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.f6499.5%
Applied egg-rr99.5%
Final simplification97.1%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.48) (+ U (* l (* (+ 2.0 (* (* l l) 0.3333333333333333)) (* J (cos (* K 0.5)))))) (+ U (* (* 2.0 (sinh l)) J))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.48) {
tmp = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J * cos((K * 0.5)))));
} 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.48d0) then
tmp = u + (l * ((2.0d0 + ((l * l) * 0.3333333333333333d0)) * (j * cos((k * 0.5d0)))))
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.48) {
tmp = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J * Math.cos((K * 0.5)))));
} 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.48: tmp = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J * math.cos((K * 0.5))))) 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.48) tmp = Float64(U + Float64(l * Float64(Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)) * Float64(J * cos(Float64(K * 0.5)))))); 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.48) tmp = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J * cos((K * 0.5))))); 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.48], N[(U + N[(l * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] * N[(J * N[Cos[N[(K * 0.5), $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.48:\\
\;\;\;\;U + \ell \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\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.47999999999999998Initial program 83.9%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified94.3%
if 0.47999999999999998 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 88.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.f6488.7%
Simplified88.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.f6497.3%
Applied egg-rr97.3%
Final simplification96.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.04)
(+ U (* t_0 (* J (* 2.0 l))))
(+ 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.04) {
tmp = U + (t_0 * (J * (2.0 * l)));
} 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.04d0)) then
tmp = u + (t_0 * (j * (2.0d0 * l)))
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.04) {
tmp = U + (t_0 * (J * (2.0 * l)));
} 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.04: tmp = U + (t_0 * (J * (2.0 * l))) 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.04) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(2.0 * l)))); 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.04) tmp = U + (t_0 * (J * (2.0 * l))); 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.04], N[(U + N[(t$95$0 * N[(J * N[(2.0 * l), $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.04:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(2 \cdot \ell\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 82.9%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6475.1%
Simplified75.1%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 88.5%
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.f6488.4%
Simplified88.4%
*-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.f6496.4%
Applied egg-rr96.4%
Final simplification91.1%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 0.0001)
(+ U (* (* 2.0 (sinh l)) J))
(+
U
(*
(cos (/ K 2.0))
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
l
(*
l
(+
0.016666666666666666
(* (* l l) 0.0003968253968253968)))))))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 0.0001) {
tmp = U + ((2.0 * sinh(l)) * J);
} else {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
}
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 / 2.0d0) <= 0.0001d0) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0))))))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 0.0001) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (K / 2.0) <= 0.0001: tmp = U + ((2.0 * math.sinh(l)) * J) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (Float64(K / 2.0) <= 0.0001) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968))))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((K / 2.0) <= 0.0001) tmp = U + ((2.0 * sinh(l)) * J); else tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 0.0001], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{K}{2} \leq 0.0001:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 1.00000000000000005e-4Initial program 89.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.f6479.1%
Simplified79.1%
*-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.f6486.5%
Applied egg-rr86.5%
if 1.00000000000000005e-4 < (/.f64 K #s(literal 2 binary64)) Initial program 81.7%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-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-*.f6498.5%
Simplified98.5%
Final simplification89.7%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 0.0001)
(+ U (* (* 2.0 (sinh l)) J))
(+
U
(*
(cos (/ K 2.0))
(*
J
(*
l
(+
2.0
(*
(* l l)
(+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 0.0001) {
tmp = U + ((2.0 * sinh(l)) * J);
} else {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
}
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 / 2.0d0) <= 0.0001d0) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 0.0001) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (K / 2.0) <= 0.0001: tmp = U + ((2.0 * math.sinh(l)) * J) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (Float64(K / 2.0) <= 0.0001) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((K / 2.0) <= 0.0001) tmp = U + ((2.0 * sinh(l)) * J); else tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 0.0001], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{K}{2} \leq 0.0001:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 1.00000000000000005e-4Initial program 89.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.f6479.1%
Simplified79.1%
*-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.f6486.5%
Applied egg-rr86.5%
if 1.00000000000000005e-4 < (/.f64 K #s(literal 2 binary64)) Initial program 81.7%
Taylor expanded in l around 0
*-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-*.f6497.0%
Simplified97.0%
Final simplification89.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* l (* (cos (* K 0.5)) (* 2.0 J))))))
(if (<= J -3.7e+116)
t_0
(if (<= J 5.5e+60) (+ U (* (* 2.0 (sinh l)) J)) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = U + (l * (cos((K * 0.5)) * (2.0 * J)));
double tmp;
if (J <= -3.7e+116) {
tmp = t_0;
} else if (J <= 5.5e+60) {
tmp = U + ((2.0 * sinh(l)) * J);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = u + (l * (cos((k * 0.5d0)) * (2.0d0 * j)))
if (j <= (-3.7d+116)) then
tmp = t_0
else if (j <= 5.5d+60) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (l * (Math.cos((K * 0.5)) * (2.0 * J)));
double tmp;
if (J <= -3.7e+116) {
tmp = t_0;
} else if (J <= 5.5e+60) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (l * (math.cos((K * 0.5)) * (2.0 * J))) tmp = 0 if J <= -3.7e+116: tmp = t_0 elif J <= 5.5e+60: tmp = U + ((2.0 * math.sinh(l)) * J) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(2.0 * J)))) tmp = 0.0 if (J <= -3.7e+116) tmp = t_0; elseif (J <= 5.5e+60) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (l * (cos((K * 0.5)) * (2.0 * J))); tmp = 0.0; if (J <= -3.7e+116) tmp = t_0; elseif (J <= 5.5e+60) tmp = U + ((2.0 * sinh(l)) * J); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[J, -3.7e+116], t$95$0, If[LessEqual[J, 5.5e+60], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot J\right)\right)\\
\mathbf{if}\;J \leq -3.7 \cdot 10^{+116}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;J \leq 5.5 \cdot 10^{+60}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if J < -3.7000000000000001e116 or 5.5000000000000001e60 < J Initial program 74.7%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified94.7%
Taylor expanded in l around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6485.9%
Simplified85.9%
if -3.7000000000000001e116 < J < 5.5000000000000001e60Initial program 93.6%
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.f6485.3%
Simplified85.3%
*-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.f6489.1%
Applied egg-rr89.1%
Final simplification88.0%
(FPCore (J l K U) :precision binary64 (if (<= J -5.2e+220) (* (cos (* K 0.5)) (* J (* 2.0 l))) (+ U (* (* 2.0 (sinh l)) J))))
double code(double J, double l, double K, double U) {
double tmp;
if (J <= -5.2e+220) {
tmp = cos((K * 0.5)) * (J * (2.0 * l));
} 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 (j <= (-5.2d+220)) then
tmp = cos((k * 0.5d0)) * (j * (2.0d0 * l))
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 (J <= -5.2e+220) {
tmp = Math.cos((K * 0.5)) * (J * (2.0 * l));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if J <= -5.2e+220: tmp = math.cos((K * 0.5)) * (J * (2.0 * l)) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) tmp = 0.0 if (J <= -5.2e+220) tmp = Float64(cos(Float64(K * 0.5)) * Float64(J * Float64(2.0 * l))); 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 (J <= -5.2e+220) tmp = cos((K * 0.5)) * (J * (2.0 * l)); else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[J, -5.2e+220], N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 * l), $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}\;J \leq -5.2 \cdot 10^{+220}:\\
\;\;\;\;\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if J < -5.19999999999999988e220Initial program 71.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.9%
Simplified99.9%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.2%
Simplified95.2%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f6495.2%
Simplified95.2%
if -5.19999999999999988e220 < J Initial program 88.4%
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.f6476.7%
Simplified76.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.f6481.8%
Applied egg-rr81.8%
Final simplification82.8%
(FPCore (J l K U)
:precision binary64
(if (<= l 1.4e+247)
(+ 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 <= 1.4e+247) {
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 <= 1.4d+247) 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 <= 1.4e+247) {
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 <= 1.4e+247: 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 <= 1.4e+247) 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 <= 1.4e+247) 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, 1.4e+247], 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 1.4 \cdot 10^{+247}:\\
\;\;\;\;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 < 1.3999999999999999e247Initial program 86.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.f6476.0%
Simplified76.0%
*-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.f6482.3%
Applied egg-rr82.3%
if 1.3999999999999999e247 < 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-*.f6485.0%
Simplified85.0%
Final simplification82.5%
(FPCore (J l K U)
:precision binary64
(if (<= l 1e+247)
(+
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 <= 1e+247) {
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 <= 1d+247) 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 <= 1e+247) {
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 <= 1e+247: 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 <= 1e+247) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(l * Float64(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 <= 1e+247) 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, 1e+247], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(l * N[(l * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $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 10^{+247}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\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 < 9.99999999999999952e246Initial program 86.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.f6476.0%
Simplified76.0%
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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.9%
Simplified77.9%
if 9.99999999999999952e246 < 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-*.f6485.0%
Simplified85.0%
Final simplification78.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* l (* J (+ 2.0 (* (* l l) 0.3333333333333333))))))
(if (<= l -29.0)
t_0
(if (<= l 8.8e+17)
(+ U (* J (* 2.0 l)))
(if (<= l 3e+89) (* (* l J) (* (* K K) -0.25)) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = l * (J * (2.0 + ((l * l) * 0.3333333333333333)));
double tmp;
if (l <= -29.0) {
tmp = t_0;
} else if (l <= 8.8e+17) {
tmp = U + (J * (2.0 * l));
} else if (l <= 3e+89) {
tmp = (l * J) * ((K * K) * -0.25);
} 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 * (2.0d0 + ((l * l) * 0.3333333333333333d0)))
if (l <= (-29.0d0)) then
tmp = t_0
else if (l <= 8.8d+17) then
tmp = u + (j * (2.0d0 * l))
else if (l <= 3d+89) then
tmp = (l * j) * ((k * k) * (-0.25d0))
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 * (2.0 + ((l * l) * 0.3333333333333333)));
double tmp;
if (l <= -29.0) {
tmp = t_0;
} else if (l <= 8.8e+17) {
tmp = U + (J * (2.0 * l));
} else if (l <= 3e+89) {
tmp = (l * J) * ((K * K) * -0.25);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = l * (J * (2.0 + ((l * l) * 0.3333333333333333))) tmp = 0 if l <= -29.0: tmp = t_0 elif l <= 8.8e+17: tmp = U + (J * (2.0 * l)) elif l <= 3e+89: tmp = (l * J) * ((K * K) * -0.25) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(l * Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) tmp = 0.0 if (l <= -29.0) tmp = t_0; elseif (l <= 8.8e+17) tmp = Float64(U + Float64(J * Float64(2.0 * l))); elseif (l <= 3e+89) tmp = Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25)); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = l * (J * (2.0 + ((l * l) * 0.3333333333333333))); tmp = 0.0; if (l <= -29.0) tmp = t_0; elseif (l <= 8.8e+17) tmp = U + (J * (2.0 * l)); elseif (l <= 3e+89) tmp = (l * J) * ((K * K) * -0.25); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(l * N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -29.0], t$95$0, If[LessEqual[l, 8.8e+17], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3e+89], N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
\mathbf{if}\;\ell \leq -29:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 8.8 \cdot 10^{+17}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{elif}\;\ell \leq 3 \cdot 10^{+89}:\\
\;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -29 or 3.00000000000000013e89 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.4%
Simplified89.4%
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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.7%
Simplified82.7%
Taylor expanded in K around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.6%
Simplified61.6%
if -29 < l < 8.8e17Initial program 75.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.f6473.7%
Simplified73.7%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6483.5%
Simplified83.5%
if 8.8e17 < l < 3.00000000000000013e89Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6424.9%
Simplified24.9%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6442.1%
Simplified42.1%
Taylor expanded in l around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.3%
Simplified35.3%
Taylor expanded in K around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.3%
Simplified34.3%
Final simplification71.3%
(FPCore (J l K U)
:precision binary64
(if (<= l 1.25e+247)
(+
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.25e+247) {
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.25d+247) 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.25e+247) {
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.25e+247: 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.25e+247) 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.25e+247) 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.25e+247], 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.25 \cdot 10^{+247}:\\
\;\;\;\;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.25000000000000006e247Initial program 86.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.f6476.0%
Simplified76.0%
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.0%
Simplified77.0%
if 1.25000000000000006e247 < 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-*.f6485.0%
Simplified85.0%
Final simplification77.6%
(FPCore (J l K U)
:precision binary64
(if (<= l 1e+247)
(+
U
(*
J
(*
l
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))
(* l (* (+ 1.0 (* -0.125 (* K K))) (* J (* (* l l) 0.3333333333333333))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1e+247) {
tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = l * ((1.0 + (-0.125 * (K * K))) * (J * ((l * l) * 0.3333333333333333)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 1d+247) then
tmp = u + (j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
else
tmp = l * ((1.0d0 + ((-0.125d0) * (k * k))) * (j * ((l * l) * 0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1e+247) {
tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = l * ((1.0 + (-0.125 * (K * K))) * (J * ((l * l) * 0.3333333333333333)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1e+247: tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) else: tmp = l * ((1.0 + (-0.125 * (K * K))) * (J * ((l * l) * 0.3333333333333333))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1e+247) 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(l * Float64(Float64(1.0 + Float64(-0.125 * Float64(K * K))) * Float64(J * Float64(Float64(l * l) * 0.3333333333333333)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1e+247) tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); else tmp = l * ((1.0 + (-0.125 * (K * K))) * (J * ((l * l) * 0.3333333333333333))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1e+247], 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[(l * N[(N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 10^{+247}:\\
\;\;\;\;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}:\\
\;\;\;\;\ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(J \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if l < 9.99999999999999952e246Initial program 86.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.f6476.0%
Simplified76.0%
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.0%
Simplified77.0%
if 9.99999999999999952e246 < 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-*.f6485.0%
Simplified85.0%
Taylor expanded in l around inf
associate-*r*N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified85.0%
Final simplification77.6%
(FPCore (J l K U)
:precision binary64
(if (<= l 6.6e-5)
(+ U (* J (* l (+ 2.0 (* (* l l) 0.3333333333333333)))))
(*
(* l (* l l))
(+ (* J 0.3333333333333333) (* (* J (* K K)) -0.041666666666666664)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 6.6e-5) {
tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333))));
} else {
tmp = (l * (l * l)) * ((J * 0.3333333333333333) + ((J * (K * K)) * -0.041666666666666664));
}
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 <= 6.6d-5) then
tmp = u + (j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0))))
else
tmp = (l * (l * l)) * ((j * 0.3333333333333333d0) + ((j * (k * k)) * (-0.041666666666666664d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 6.6e-5) {
tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333))));
} else {
tmp = (l * (l * l)) * ((J * 0.3333333333333333) + ((J * (K * K)) * -0.041666666666666664));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 6.6e-5: tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) else: tmp = (l * (l * l)) * ((J * 0.3333333333333333) + ((J * (K * K)) * -0.041666666666666664)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 6.6e-5) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))))); else tmp = Float64(Float64(l * Float64(l * l)) * Float64(Float64(J * 0.3333333333333333) + Float64(Float64(J * Float64(K * K)) * -0.041666666666666664))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 6.6e-5) tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))); else tmp = (l * (l * l)) * ((J * 0.3333333333333333) + ((J * (K * K)) * -0.041666666666666664)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 6.6e-5], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(J * 0.3333333333333333), $MachinePrecision] + N[(N[(J * N[(K * K), $MachinePrecision]), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.6 \cdot 10^{-5}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \left(J \cdot 0.3333333333333333 + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.041666666666666664\right)\\
\end{array}
\end{array}
if l < 6.6000000000000005e-5Initial program 83.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.f6476.3%
Simplified76.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.6%
Simplified78.6%
if 6.6000000000000005e-5 < l Initial program 99.7%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.5%
Simplified77.5%
Taylor expanded in K around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified5.4%
Taylor expanded in l around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.2%
Simplified61.2%
Final simplification74.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (* l l) 0.3333333333333333)))
(if (<= l 1.5e+247)
(+ U (* J (* l (+ 2.0 t_0))))
(* l (* (+ 1.0 (* -0.125 (* K K))) (* J t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = (l * l) * 0.3333333333333333;
double tmp;
if (l <= 1.5e+247) {
tmp = U + (J * (l * (2.0 + t_0)));
} else {
tmp = l * ((1.0 + (-0.125 * (K * K))) * (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 * l) * 0.3333333333333333d0
if (l <= 1.5d+247) then
tmp = u + (j * (l * (2.0d0 + t_0)))
else
tmp = l * ((1.0d0 + ((-0.125d0) * (k * k))) * (j * t_0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = (l * l) * 0.3333333333333333;
double tmp;
if (l <= 1.5e+247) {
tmp = U + (J * (l * (2.0 + t_0)));
} else {
tmp = l * ((1.0 + (-0.125 * (K * K))) * (J * t_0));
}
return tmp;
}
def code(J, l, K, U): t_0 = (l * l) * 0.3333333333333333 tmp = 0 if l <= 1.5e+247: tmp = U + (J * (l * (2.0 + t_0))) else: tmp = l * ((1.0 + (-0.125 * (K * K))) * (J * t_0)) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(l * l) * 0.3333333333333333) tmp = 0.0 if (l <= 1.5e+247) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + t_0)))); else tmp = Float64(l * Float64(Float64(1.0 + Float64(-0.125 * Float64(K * K))) * Float64(J * t_0))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (l * l) * 0.3333333333333333; tmp = 0.0; if (l <= 1.5e+247) tmp = U + (J * (l * (2.0 + t_0))); else tmp = l * ((1.0 + (-0.125 * (K * K))) * (J * t_0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, If[LessEqual[l, 1.5e+247], N[(U + N[(J * N[(l * N[(2.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\\
\mathbf{if}\;\ell \leq 1.5 \cdot 10^{+247}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(J \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if l < 1.5e247Initial program 86.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.f6476.0%
Simplified76.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.0%
Simplified73.0%
if 1.5e247 < 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-*.f6485.0%
Simplified85.0%
Taylor expanded in l around inf
associate-*r*N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified85.0%
Final simplification74.0%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* 2.0 l)))) (if (<= l -29.0) t_0 (if (<= l 1200.0) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (2.0 * l);
double tmp;
if (l <= -29.0) {
tmp = t_0;
} else if (l <= 1200.0) {
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 <= (-29.0d0)) then
tmp = t_0
else if (l <= 1200.0d0) 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 <= -29.0) {
tmp = t_0;
} else if (l <= 1200.0) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (2.0 * l) tmp = 0 if l <= -29.0: tmp = t_0 elif l <= 1200.0: 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 <= -29.0) tmp = t_0; elseif (l <= 1200.0) 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 <= -29.0) tmp = t_0; elseif (l <= 1200.0) 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, -29.0], t$95$0, If[LessEqual[l, 1200.0], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(2 \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -29:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1200:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -29 or 1200 < l Initial 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.f6476.2%
Simplified76.2%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6421.7%
Simplified21.7%
Taylor expanded in J around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6421.7%
Simplified21.7%
if -29 < l < 1200Initial program 74.6%
Taylor expanded in J around 0
Simplified73.3%
(FPCore (J l K U) :precision binary64 (if (<= l 980.0) (+ U (* J (* 2.0 l))) (* J (+ (* 2.0 l) (/ U J)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 980.0) {
tmp = U + (J * (2.0 * l));
} else {
tmp = J * ((2.0 * l) + (U / J));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 980.0d0) then
tmp = u + (j * (2.0d0 * l))
else
tmp = j * ((2.0d0 * l) + (u / j))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 980.0) {
tmp = U + (J * (2.0 * l));
} else {
tmp = J * ((2.0 * l) + (U / J));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 980.0: tmp = U + (J * (2.0 * l)) else: tmp = J * ((2.0 * l) + (U / J)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 980.0) tmp = Float64(U + Float64(J * Float64(2.0 * l))); else tmp = Float64(J * Float64(Float64(2.0 * l) + Float64(U / J))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 980.0) tmp = U + (J * (2.0 * l)); else tmp = J * ((2.0 * l) + (U / J)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 980.0], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(J * N[(N[(2.0 * l), $MachinePrecision] + N[(U / J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 980:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(2 \cdot \ell + \frac{U}{J}\right)\\
\end{array}
\end{array}
if l < 980Initial program 83.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.9%
Simplified75.9%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6463.5%
Simplified63.5%
if 980 < l Initial 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.f6471.0%
Simplified71.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6423.3%
Simplified23.3%
Taylor expanded in J around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6432.2%
Simplified32.2%
Final simplification55.9%
(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(Float64(l * 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[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)
\end{array}
Initial program 87.1%
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.f6474.7%
Simplified74.7%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.0%
Simplified72.0%
Final simplification72.0%
(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 87.1%
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.f6474.7%
Simplified74.7%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6453.7%
Simplified53.7%
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
*-lowering-*.f6456.5%
Simplified56.5%
(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 87.1%
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.f6474.7%
Simplified74.7%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6453.7%
Simplified53.7%
Final simplification53.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 87.1%
Taylor expanded in J around 0
Simplified38.4%
herbie shell --seed 2024138
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))