
(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 24 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 (fma (* (cos (/ K 2.0)) (* 2.0 (sinh l))) J U))
double code(double J, double l, double K, double U) {
return fma((cos((K / 2.0)) * (2.0 * sinh(l))), J, U);
}
function code(J, l, K, U) return fma(Float64(cos(Float64(K / 2.0)) * Float64(2.0 * sinh(l))), J, U) end
code[J_, l_, K_, U_] := N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\cos \left(\frac{K}{2}\right) \cdot \left(2 \cdot \sinh \ell\right), J, U\right)
\end{array}
Initial program 88.3%
associate-*l*N/A
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.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 (if (<= (cos (/ K 2.0)) -0.04) (+ 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.04) {
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.04d0)) 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.04) {
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.04: 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.04) tmp = Float64(U + Float64(l * Float64(Float64(2.0 + Float64(l * Float64(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.04) 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.04], N[(U + N[(l * N[(N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $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.04:\\
\;\;\;\;U + \ell \cdot \left(\left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\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.0400000000000000008Initial program 89.4%
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
Simplified86.8%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 87.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.f6487.6%
Simplified87.6%
*-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.2%
Applied egg-rr96.2%
Final simplification93.6%
(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 89.4%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6468.2%
Simplified68.2%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 87.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.f6487.6%
Simplified87.6%
*-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.2%
Applied egg-rr96.2%
Final simplification88.3%
(FPCore (J l K U) :precision binary64 (+ U (* 2.0 (* (sinh l) (* (cos (/ K 2.0)) J)))))
double code(double J, double l, double K, double U) {
return U + (2.0 * (sinh(l) * (cos((K / 2.0)) * J)));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (2.0d0 * (sinh(l) * (cos((k / 2.0d0)) * j)))
end function
public static double code(double J, double l, double K, double U) {
return U + (2.0 * (Math.sinh(l) * (Math.cos((K / 2.0)) * J)));
}
def code(J, l, K, U): return U + (2.0 * (math.sinh(l) * (math.cos((K / 2.0)) * J)))
function code(J, l, K, U) return Float64(U + Float64(2.0 * Float64(sinh(l) * Float64(cos(Float64(K / 2.0)) * J)))) end
function tmp = code(J, l, K, U) tmp = U + (2.0 * (sinh(l) * (cos((K / 2.0)) * J))); end
code[J_, l_, K_, U_] := N[(U + N[(2.0 * N[(N[Sinh[l], $MachinePrecision] * N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + 2 \cdot \left(\sinh \ell \cdot \left(\cos \left(\frac{K}{2}\right) \cdot J\right)\right)
\end{array}
Initial program 88.3%
*-commutativeN/A
associate-*r*N/A
sinh-undefN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 1e+15)
(+ U (* 2.0 (* (sinh l) (+ J (* J (* (* K K) -0.125))))))
(+
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) <= 1e+15) {
tmp = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125)))));
} 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) <= 1d+15) then
tmp = u + (2.0d0 * (sinh(l) * (j + (j * ((k * k) * (-0.125d0))))))
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) <= 1e+15) {
tmp = U + (2.0 * (Math.sinh(l) * (J + (J * ((K * K) * -0.125)))));
} 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) <= 1e+15: tmp = U + (2.0 * (math.sinh(l) * (J + (J * ((K * K) * -0.125))))) 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) <= 1e+15) tmp = Float64(U + Float64(2.0 * Float64(sinh(l) * Float64(J + Float64(J * Float64(Float64(K * K) * -0.125)))))); 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) <= 1e+15) tmp = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125))))); 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], 1e+15], N[(U + N[(2.0 * N[(N[Sinh[l], $MachinePrecision] * N[(J + N[(J * N[(N[(K * K), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 10^{+15}:\\
\;\;\;\;U + 2 \cdot \left(\sinh \ell \cdot \left(J + J \cdot \left(\left(K \cdot K\right) \cdot -0.125\right)\right)\right)\\
\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)) < 1e15Initial program 88.2%
*-commutativeN/A
associate-*r*N/A
sinh-undefN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.9%
Applied egg-rr99.9%
Taylor expanded in K around 0
associate-*r*N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.8%
Simplified79.8%
if 1e15 < (/.f64 K #s(literal 2 binary64)) Initial program 88.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-*.f6494.0%
Simplified94.0%
Final simplification83.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(*
(* l (cos (* K 0.5)))
(* J (+ 2.0 (* (* l l) 0.3333333333333333)))))
(t_1 (+ U (* 2.0 (* (sinh l) (+ J (* J (* (* K K) -0.125))))))))
(if (<= l -2.4e+94)
t_0
(if (<= l -330.0)
t_1
(if (<= l 225.0)
(+ U (* (cos (/ K 2.0)) (* J (* 2.0 l))))
(if (<= l 1.36e+129) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = (l * cos((K * 0.5))) * (J * (2.0 + ((l * l) * 0.3333333333333333)));
double t_1 = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125)))));
double tmp;
if (l <= -2.4e+94) {
tmp = t_0;
} else if (l <= -330.0) {
tmp = t_1;
} else if (l <= 225.0) {
tmp = U + (cos((K / 2.0)) * (J * (2.0 * l)));
} else if (l <= 1.36e+129) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (l * cos((k * 0.5d0))) * (j * (2.0d0 + ((l * l) * 0.3333333333333333d0)))
t_1 = u + (2.0d0 * (sinh(l) * (j + (j * ((k * k) * (-0.125d0))))))
if (l <= (-2.4d+94)) then
tmp = t_0
else if (l <= (-330.0d0)) then
tmp = t_1
else if (l <= 225.0d0) then
tmp = u + (cos((k / 2.0d0)) * (j * (2.0d0 * l)))
else if (l <= 1.36d+129) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = (l * Math.cos((K * 0.5))) * (J * (2.0 + ((l * l) * 0.3333333333333333)));
double t_1 = U + (2.0 * (Math.sinh(l) * (J + (J * ((K * K) * -0.125)))));
double tmp;
if (l <= -2.4e+94) {
tmp = t_0;
} else if (l <= -330.0) {
tmp = t_1;
} else if (l <= 225.0) {
tmp = U + (Math.cos((K / 2.0)) * (J * (2.0 * l)));
} else if (l <= 1.36e+129) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = (l * math.cos((K * 0.5))) * (J * (2.0 + ((l * l) * 0.3333333333333333))) t_1 = U + (2.0 * (math.sinh(l) * (J + (J * ((K * K) * -0.125))))) tmp = 0 if l <= -2.4e+94: tmp = t_0 elif l <= -330.0: tmp = t_1 elif l <= 225.0: tmp = U + (math.cos((K / 2.0)) * (J * (2.0 * l))) elif l <= 1.36e+129: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(Float64(l * cos(Float64(K * 0.5))) * Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) t_1 = Float64(U + Float64(2.0 * Float64(sinh(l) * Float64(J + Float64(J * Float64(Float64(K * K) * -0.125)))))) tmp = 0.0 if (l <= -2.4e+94) tmp = t_0; elseif (l <= -330.0) tmp = t_1; elseif (l <= 225.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(2.0 * l)))); elseif (l <= 1.36e+129) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (l * cos((K * 0.5))) * (J * (2.0 + ((l * l) * 0.3333333333333333))); t_1 = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125))))); tmp = 0.0; if (l <= -2.4e+94) tmp = t_0; elseif (l <= -330.0) tmp = t_1; elseif (l <= 225.0) tmp = U + (cos((K / 2.0)) * (J * (2.0 * l))); elseif (l <= 1.36e+129) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(2.0 * N[(N[Sinh[l], $MachinePrecision] * N[(J + N[(J * N[(N[(K * K), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.4e+94], t$95$0, If[LessEqual[l, -330.0], t$95$1, If[LessEqual[l, 225.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.36e+129], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
t_1 := U + 2 \cdot \left(\sinh \ell \cdot \left(J + J \cdot \left(\left(K \cdot K\right) \cdot -0.125\right)\right)\right)\\
\mathbf{if}\;\ell \leq -2.4 \cdot 10^{+94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -330:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 225:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\
\mathbf{elif}\;\ell \leq 1.36 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -2.39999999999999983e94 or 1.3599999999999999e129 < l Initial program 100.0%
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.1%
Taylor expanded in J around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/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-*.f6494.1%
Simplified94.1%
if -2.39999999999999983e94 < l < -330 or 225 < l < 1.3599999999999999e129Initial program 100.0%
*-commutativeN/A
associate-*r*N/A
sinh-undefN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
associate-*r*N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.4%
Simplified84.4%
if -330 < l < 225Initial program 77.0%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6499.8%
Simplified99.8%
Final simplification95.3%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 1e+15)
(+ U (* 2.0 (* (sinh l) (+ J (* J (* (* K K) -0.125))))))
(+
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) <= 1e+15) {
tmp = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125)))));
} 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) <= 1d+15) then
tmp = u + (2.0d0 * (sinh(l) * (j + (j * ((k * k) * (-0.125d0))))))
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) <= 1e+15) {
tmp = U + (2.0 * (Math.sinh(l) * (J + (J * ((K * K) * -0.125)))));
} 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) <= 1e+15: tmp = U + (2.0 * (math.sinh(l) * (J + (J * ((K * K) * -0.125))))) 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) <= 1e+15) tmp = Float64(U + Float64(2.0 * Float64(sinh(l) * Float64(J + Float64(J * Float64(Float64(K * K) * -0.125)))))); 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 * 0.016666666666666666))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((K / 2.0) <= 1e+15) tmp = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125))))); 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], 1e+15], N[(U + N[(2.0 * N[(N[Sinh[l], $MachinePrecision] * N[(J + N[(J * N[(N[(K * K), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{K}{2} \leq 10^{+15}:\\
\;\;\;\;U + 2 \cdot \left(\sinh \ell \cdot \left(J + J \cdot \left(\left(K \cdot K\right) \cdot -0.125\right)\right)\right)\\
\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 0.016666666666666666\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 1e15Initial program 88.2%
*-commutativeN/A
associate-*r*N/A
sinh-undefN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.9%
Applied egg-rr99.9%
Taylor expanded in K around 0
associate-*r*N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.8%
Simplified79.8%
if 1e15 < (/.f64 K #s(literal 2 binary64)) Initial program 88.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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.7%
Simplified93.7%
Final simplification83.2%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 1e+15)
(+ U (* 2.0 (* (sinh l) (+ J (* J (* (* K K) -0.125))))))
(+
U
(* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* l (* l 0.3333333333333333)))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 1e+15) {
tmp = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125)))));
} else {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (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 ((k / 2.0d0) <= 1d+15) then
tmp = u + (2.0d0 * (sinh(l) * (j + (j * ((k * k) * (-0.125d0))))))
else
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (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 ((K / 2.0) <= 1e+15) {
tmp = U + (2.0 * (Math.sinh(l) * (J + (J * ((K * K) * -0.125)))));
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (l * (l * 0.3333333333333333))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (K / 2.0) <= 1e+15: tmp = U + (2.0 * (math.sinh(l) * (J + (J * ((K * K) * -0.125))))) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (Float64(K / 2.0) <= 1e+15) tmp = Float64(U + Float64(2.0 * Float64(sinh(l) * Float64(J + Float64(J * Float64(Float64(K * K) * -0.125)))))); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((K / 2.0) <= 1e+15) tmp = U + (2.0 * (sinh(l) * (J + (J * ((K * K) * -0.125))))); else tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 1e+15], N[(U + N[(2.0 * N[(N[Sinh[l], $MachinePrecision] * N[(J + N[(J * N[(N[(K * K), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{K}{2} \leq 10^{+15}:\\
\;\;\;\;U + 2 \cdot \left(\sinh \ell \cdot \left(J + J \cdot \left(\left(K \cdot K\right) \cdot -0.125\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 1e15Initial program 88.2%
*-commutativeN/A
associate-*r*N/A
sinh-undefN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-lowering-sinh.f6499.9%
Applied egg-rr99.9%
Taylor expanded in K around 0
associate-*r*N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.8%
Simplified79.8%
if 1e15 < (/.f64 K #s(literal 2 binary64)) Initial program 88.7%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6489.2%
Simplified89.2%
Final simplification82.1%
(FPCore (J l K U)
:precision binary64
(if (<= l -70000.0)
(+ U (* (* 2.0 (sinh l)) J))
(if (<= l 9.2)
(+ U (* J (* (cos (* K 0.5)) (* 2.0 l))))
(+ U (* J (+ (exp l) -1.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -70000.0) {
tmp = U + ((2.0 * sinh(l)) * J);
} else if (l <= 9.2) {
tmp = U + (J * (cos((K * 0.5)) * (2.0 * l)));
} else {
tmp = U + (J * (exp(l) + -1.0));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-70000.0d0)) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else if (l <= 9.2d0) then
tmp = u + (j * (cos((k * 0.5d0)) * (2.0d0 * l)))
else
tmp = u + (j * (exp(l) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -70000.0) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else if (l <= 9.2) {
tmp = U + (J * (Math.cos((K * 0.5)) * (2.0 * l)));
} else {
tmp = U + (J * (Math.exp(l) + -1.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -70000.0: tmp = U + ((2.0 * math.sinh(l)) * J) elif l <= 9.2: tmp = U + (J * (math.cos((K * 0.5)) * (2.0 * l))) else: tmp = U + (J * (math.exp(l) + -1.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -70000.0) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); elseif (l <= 9.2) tmp = Float64(U + Float64(J * Float64(cos(Float64(K * 0.5)) * Float64(2.0 * l)))); else tmp = Float64(U + Float64(J * Float64(exp(l) + -1.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -70000.0) tmp = U + ((2.0 * sinh(l)) * J); elseif (l <= 9.2) tmp = U + (J * (cos((K * 0.5)) * (2.0 * l))); else tmp = U + (J * (exp(l) + -1.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -70000.0], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.2], N[(U + N[(J * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -70000:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{elif}\;\ell \leq 9.2:\\
\;\;\;\;U + J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot \ell\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} + -1\right)\\
\end{array}
\end{array}
if l < -7e4Initial 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.f6474.6%
Simplified74.6%
*-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.f6474.6%
Applied egg-rr74.6%
if -7e4 < l < 9.1999999999999993Initial program 77.2%
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
Simplified99.2%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6499.0%
Simplified99.0%
if 9.1999999999999993 < 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.f6475.8%
Simplified75.8%
Taylor expanded in l around 0
Simplified75.8%
Final simplification87.4%
(FPCore (J l K U)
:precision binary64
(if (<= l 1.5)
(*
U
(+
1.0
(*
J
(*
(+
2.0
(* (* l l) (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))
(/ l U)))))
(+ U (* J (+ (exp l) -1.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.5) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + (J * (exp(l) + -1.0));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 1.5d0) then
tmp = u * (1.0d0 + (j * ((2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))) * (l / u))))
else
tmp = u + (j * (exp(l) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.5) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + (J * (Math.exp(l) + -1.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.5: tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))) else: tmp = U + (J * (math.exp(l) + -1.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.5) tmp = Float64(U * Float64(1.0 + Float64(J * Float64(Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))) * Float64(l / U))))); else tmp = Float64(U + Float64(J * Float64(exp(l) + -1.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.5) tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))); else tmp = U + (J * (exp(l) + -1.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.5], N[(U * N[(1.0 + N[(J * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.5:\\
\;\;\;\;U \cdot \left(1 + J \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right) \cdot \frac{\ell}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} + -1\right)\\
\end{array}
\end{array}
if l < 1.5Initial program 84.3%
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.5%
Simplified75.5%
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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6480.2%
Simplified80.2%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Simplified81.1%
if 1.5 < 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.f6475.8%
Simplified75.8%
Taylor expanded in l around 0
Simplified75.8%
Final simplification79.7%
(FPCore (J l K U) :precision binary64 (+ U (* (* 2.0 (sinh l)) J)))
double code(double J, double l, double K, double U) {
return U + ((2.0 * sinh(l)) * J);
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + ((2.0d0 * sinh(l)) * j)
end function
public static double code(double J, double l, double K, double U) {
return U + ((2.0 * Math.sinh(l)) * J);
}
def code(J, l, K, U): return U + ((2.0 * math.sinh(l)) * J)
function code(J, l, K, U) return Float64(U + Float64(Float64(2.0 * sinh(l)) * J)) end
function tmp = code(J, l, K, U) tmp = U + ((2.0 * sinh(l)) * J); end
code[J_, l_, K_, U_] := N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \left(2 \cdot \sinh \ell\right) \cdot J
\end{array}
Initial program 88.3%
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%
*-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.7%
Applied egg-rr81.7%
Final simplification81.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))
(t_1 (* l t_0))
(t_2 (* l t_1)))
(if (<= l -220000000.0)
(* U (+ 1.0 (* J (* (+ 2.0 (* (* l l) t_0)) (/ l U)))))
(if (<= l 6.2e+31)
(+
U
(/
(* (* l J) (+ 8.0 (* t_2 (* t_1 (* (* l l) t_1)))))
(+ 4.0 (* t_2 (- (* l (* l 0.3333333333333333)) 2.0)))))
(+
U
(*
(*
J
(*
l
(+
2.0
(*
(* l l)
(+ 0.3333333333333333 (* l (* l 0.016666666666666666)))))))
(+ 1.0 (* (* K K) -0.125))))))))
double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666);
double t_1 = l * t_0;
double t_2 = l * t_1;
double tmp;
if (l <= -220000000.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * t_0)) * (l / U))));
} else if (l <= 6.2e+31) {
tmp = U + (((l * J) * (8.0 + (t_2 * (t_1 * ((l * l) * t_1))))) / (4.0 + (t_2 * ((l * (l * 0.3333333333333333)) - 2.0))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)
t_1 = l * t_0
t_2 = l * t_1
if (l <= (-220000000.0d0)) then
tmp = u * (1.0d0 + (j * ((2.0d0 + ((l * l) * t_0)) * (l / u))))
else if (l <= 6.2d+31) then
tmp = u + (((l * j) * (8.0d0 + (t_2 * (t_1 * ((l * l) * t_1))))) / (4.0d0 + (t_2 * ((l * (l * 0.3333333333333333d0)) - 2.0d0))))
else
tmp = u + ((j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * 0.016666666666666666d0))))))) * (1.0d0 + ((k * k) * (-0.125d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666);
double t_1 = l * t_0;
double t_2 = l * t_1;
double tmp;
if (l <= -220000000.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * t_0)) * (l / U))));
} else if (l <= 6.2e+31) {
tmp = U + (((l * J) * (8.0 + (t_2 * (t_1 * ((l * l) * t_1))))) / (4.0 + (t_2 * ((l * (l * 0.3333333333333333)) - 2.0))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125)));
}
return tmp;
}
def code(J, l, K, U): t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666) t_1 = l * t_0 t_2 = l * t_1 tmp = 0 if l <= -220000000.0: tmp = U * (1.0 + (J * ((2.0 + ((l * l) * t_0)) * (l / U)))) elif l <= 6.2e+31: tmp = U + (((l * J) * (8.0 + (t_2 * (t_1 * ((l * l) * t_1))))) / (4.0 + (t_2 * ((l * (l * 0.3333333333333333)) - 2.0)))) else: tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125))) return tmp
function code(J, l, K, U) t_0 = Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)) t_1 = Float64(l * t_0) t_2 = Float64(l * t_1) tmp = 0.0 if (l <= -220000000.0) tmp = Float64(U * Float64(1.0 + Float64(J * Float64(Float64(2.0 + Float64(Float64(l * l) * t_0)) * Float64(l / U))))); elseif (l <= 6.2e+31) tmp = Float64(U + Float64(Float64(Float64(l * J) * Float64(8.0 + Float64(t_2 * Float64(t_1 * Float64(Float64(l * l) * t_1))))) / Float64(4.0 + Float64(t_2 * Float64(Float64(l * Float64(l * 0.3333333333333333)) - 2.0))))); else tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * 0.016666666666666666))))))) * Float64(1.0 + Float64(Float64(K * K) * -0.125)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666); t_1 = l * t_0; t_2 = l * t_1; tmp = 0.0; if (l <= -220000000.0) tmp = U * (1.0 + (J * ((2.0 + ((l * l) * t_0)) * (l / U)))); elseif (l <= 6.2e+31) tmp = U + (((l * J) * (8.0 + (t_2 * (t_1 * ((l * l) * t_1))))) / (4.0 + (t_2 * ((l * (l * 0.3333333333333333)) - 2.0)))); else tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(l * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(l * t$95$1), $MachinePrecision]}, If[LessEqual[l, -220000000.0], N[(U * N[(1.0 + N[(J * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.2e+31], N[(U + N[(N[(N[(l * J), $MachinePrecision] * N[(8.0 + N[(t$95$2 * N[(t$95$1 * N[(N[(l * l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.0 + N[(t$95$2 * N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(K * K), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\\
t_1 := \ell \cdot t\_0\\
t_2 := \ell \cdot t\_1\\
\mathbf{if}\;\ell \leq -220000000:\\
\;\;\;\;U \cdot \left(1 + J \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot t\_0\right) \cdot \frac{\ell}{U}\right)\right)\\
\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+31}:\\
\;\;\;\;U + \frac{\left(\ell \cdot J\right) \cdot \left(8 + t\_2 \cdot \left(t\_1 \cdot \left(\left(\ell \cdot \ell\right) \cdot t\_1\right)\right)\right)}{4 + t\_2 \cdot \left(\ell \cdot \left(\ell \cdot 0.3333333333333333\right) - 2\right)}\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + \left(K \cdot K\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if l < -2.2e8Initial 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.f6473.7%
Simplified73.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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.3%
Simplified65.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Simplified73.7%
if -2.2e8 < l < 6.2000000000000004e31Initial program 78.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.f6476.6%
Simplified76.6%
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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6483.0%
Simplified83.0%
associate-*r*N/A
flip3-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr84.4%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6484.5%
Simplified84.5%
if 6.2000000000000004e31 < l Initial program 100.0%
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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.9%
Simplified96.9%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6480.0%
Simplified80.0%
Final simplification81.0%
(FPCore (J l K U)
:precision binary64
(if (<= l 1550.0)
(*
U
(+
1.0
(*
J
(*
(+
2.0
(* (* l l) (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))
(/ l U)))))
(+
U
(*
(*
J
(*
l
(+
2.0
(* (* l l) (+ 0.3333333333333333 (* l (* l 0.016666666666666666)))))))
(+ 1.0 (* (* K K) -0.125))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1550.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125)));
}
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 <= 1550.0d0) then
tmp = u * (1.0d0 + (j * ((2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))) * (l / u))))
else
tmp = u + ((j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * 0.016666666666666666d0))))))) * (1.0d0 + ((k * k) * (-0.125d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1550.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1550.0: tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))) else: tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1550.0) tmp = Float64(U * Float64(1.0 + Float64(J * Float64(Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))) * Float64(l / U))))); else tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * 0.016666666666666666))))))) * Float64(1.0 + Float64(Float64(K * K) * -0.125)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1550.0) tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))); else tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) * (1.0 + ((K * K) * -0.125))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1550.0], N[(U * N[(1.0 + N[(J * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(K * K), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1550:\\
\;\;\;\;U \cdot \left(1 + J \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right) \cdot \frac{\ell}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + \left(K \cdot K\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if l < 1550Initial program 84.3%
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.5%
Simplified75.5%
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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6480.2%
Simplified80.2%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Simplified81.1%
if 1550 < l Initial program 100.0%
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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.3%
Simplified88.3%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.4%
Simplified74.4%
Final simplification79.4%
(FPCore (J l K U)
:precision binary64
(if (<= l -95000000.0)
(*
U
(+
1.0
(*
J
(*
(+
2.0
(* (* l l) (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))
(/ l U)))))
(+
U
(*
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 (l <= -95000000.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + (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 (l <= (-95000000.0d0)) then
tmp = u * (1.0d0 + (j * ((2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))) * (l / u))))
else
tmp = u + (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 (l <= -95000000.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + (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 l <= -95000000.0: tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))) else: tmp = U + (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 (l <= -95000000.0) tmp = Float64(U * Float64(1.0 + Float64(J * Float64(Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))) * Float64(l / U))))); else tmp = Float64(U + 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 (l <= -95000000.0) tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))); else tmp = U + (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[l, -95000000.0], N[(U * N[(1.0 + N[(J * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -95000000:\\
\;\;\;\;U \cdot \left(1 + J \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right) \cdot \frac{\ell}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + 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)\\
\end{array}
\end{array}
if l < -9.5e7Initial 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.f6473.7%
Simplified73.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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.3%
Simplified65.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Simplified73.7%
if -9.5e7 < l Initial program 85.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.1%
Simplified76.1%
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
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6480.6%
Simplified80.6%
Final simplification79.1%
(FPCore (J l K U)
:precision binary64
(if (<= l -200000000.0)
(*
U
(+
1.0
(*
J
(*
(+
2.0
(* (* l l) (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))
(/ l U)))))
(+
U
(*
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 (l <= -200000000.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + (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 (l <= (-200000000.0d0)) then
tmp = u * (1.0d0 + (j * ((2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))) * (l / u))))
else
tmp = u + (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 (l <= -200000000.0) {
tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U))));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666)))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -200000000.0: tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))) else: tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -200000000.0) tmp = Float64(U * Float64(1.0 + Float64(J * Float64(Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))) * Float64(l / U))))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * 0.016666666666666666)))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -200000000.0) tmp = U * (1.0 + (J * ((2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))) * (l / U)))); else tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -200000000.0], N[(U * N[(1.0 + N[(J * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -200000000:\\
\;\;\;\;U \cdot \left(1 + J \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right) \cdot \frac{\ell}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot 0.016666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < -2e8Initial 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.f6473.7%
Simplified73.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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.3%
Simplified65.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Simplified73.7%
if -2e8 < l Initial program 85.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.1%
Simplified76.1%
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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6480.1%
Simplified80.1%
Final simplification78.7%
(FPCore (J l K U)
:precision binary64
(if (<= l 1.7e+22)
(+ U (* J (* l (+ 2.0 (* (* l l) 0.3333333333333333)))))
(*
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 (l <= 1.7e+22) {
tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333))));
} else {
tmp = 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 (l <= 1.7d+22) then
tmp = u + (j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0))))
else
tmp = 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 (l <= 1.7e+22) {
tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333))));
} else {
tmp = J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.7e+22: tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) else: tmp = J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.7e+22) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))))); else tmp = 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 (l <= 1.7e+22) tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))); else tmp = J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.7e+22], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.7 \cdot 10^{+22}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
\mathbf{else}:\\
\;\;\;\;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)\\
\end{array}
\end{array}
if l < 1.7e22Initial program 84.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.f6475.5%
Simplified75.5%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.2%
Simplified77.2%
if 1.7e22 < 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.f6475.8%
Simplified75.8%
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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6471.1%
Simplified71.1%
Taylor expanded in J around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/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-*.f6466.7%
Simplified66.7%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6471.2%
Applied egg-rr71.2%
Final simplification75.7%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* l (* J (+ 2.0 (* l (* l 0.3333333333333333))))))) (if (<= l -2800000.0) t_0 (if (<= l 2.3e+20) (+ U (* J (* 2.0 l))) 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 <= -2800000.0) {
tmp = t_0;
} else if (l <= 2.3e+20) {
tmp = U + (J * (2.0 * l));
} 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 <= (-2800000.0d0)) then
tmp = t_0
else if (l <= 2.3d+20) then
tmp = u + (j * (2.0d0 * l))
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 <= -2800000.0) {
tmp = t_0;
} else if (l <= 2.3e+20) {
tmp = U + (J * (2.0 * l));
} 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 <= -2800000.0: tmp = t_0 elif l <= 2.3e+20: tmp = U + (J * (2.0 * l)) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))) tmp = 0.0 if (l <= -2800000.0) tmp = t_0; elseif (l <= 2.3e+20) tmp = Float64(U + Float64(J * Float64(2.0 * l))); 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 <= -2800000.0) tmp = t_0; elseif (l <= 2.3e+20) tmp = U + (J * (2.0 * l)); 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[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2800000.0], t$95$0, If[LessEqual[l, 2.3e+20], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{if}\;\ell \leq -2800000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{+20}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -2.8e6 or 2.3e20 < 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.f6475.0%
Simplified75.0%
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
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.8%
Simplified67.8%
Taylor expanded in J around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/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-*.f6465.5%
Simplified65.5%
Taylor expanded in l around 0
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6454.4%
Simplified54.4%
if -2.8e6 < l < 2.3e20Initial program 78.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.1%
Simplified76.1%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.8%
Simplified84.8%
Final simplification70.6%
(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(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(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[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot 0.016666666666666666\right)\right)\right)\right)
\end{array}
Initial program 88.3%
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
*-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
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6476.8%
Simplified76.8%
Final simplification76.8%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* 2.0 l)))) (if (<= l -3950000.0) t_0 (if (<= l 1.7e-24) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (2.0 * l);
double tmp;
if (l <= -3950000.0) {
tmp = t_0;
} else if (l <= 1.7e-24) {
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 <= (-3950000.0d0)) then
tmp = t_0
else if (l <= 1.7d-24) 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 <= -3950000.0) {
tmp = t_0;
} else if (l <= 1.7e-24) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (2.0 * l) tmp = 0 if l <= -3950000.0: tmp = t_0 elif l <= 1.7e-24: 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 <= -3950000.0) tmp = t_0; elseif (l <= 1.7e-24) 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 <= -3950000.0) tmp = t_0; elseif (l <= 1.7e-24) 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, -3950000.0], t$95$0, If[LessEqual[l, 1.7e-24], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(2 \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -3950000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.7 \cdot 10^{-24}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -3.95e6 or 1.69999999999999996e-24 < l Initial program 97.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.f6473.3%
Simplified73.3%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6421.6%
Simplified21.6%
Taylor expanded in J around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6421.1%
Simplified21.1%
if -3.95e6 < l < 1.69999999999999996e-24Initial program 79.0%
Taylor expanded in J around 0
Simplified76.9%
Final simplification49.2%
(FPCore (J l K U) :precision binary64 (if (<= l 5e-25) (+ 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 <= 5e-25) {
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 <= 5d-25) 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 <= 5e-25) {
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 <= 5e-25: 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 <= 5e-25) 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 <= 5e-25) 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, 5e-25], 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 5 \cdot 10^{-25}:\\
\;\;\;\;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 < 4.99999999999999962e-25Initial program 85.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.f6476.7%
Simplified76.7%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.8%
Simplified67.8%
if 4.99999999999999962e-25 < l Initial program 95.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.7%
Simplified72.7%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6420.7%
Simplified20.7%
Taylor expanded in J around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6427.5%
Simplified27.5%
Final simplification56.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 88.3%
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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.1%
Simplified73.1%
Final simplification73.1%
(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 88.3%
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
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6455.1%
Simplified55.1%
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.9%
Simplified57.9%
Final simplification57.9%
(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 88.3%
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
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6455.1%
Simplified55.1%
Final simplification55.1%
(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 88.3%
Taylor expanded in J around 0
Simplified39.8%
herbie shell --seed 2024155
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))