
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U) :precision binary64 (+ (* (* (* 2.0 (sinh l)) (cos (/ K 2.0))) J) U))
double code(double J, double l, double K, double U) {
return (((2.0 * sinh(l)) * cos((K / 2.0))) * 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 = (((2.0d0 * sinh(l)) * cos((k / 2.0d0))) * j) + u
end function
public static double code(double J, double l, double K, double U) {
return (((2.0 * Math.sinh(l)) * Math.cos((K / 2.0))) * J) + U;
}
def code(J, l, K, U): return (((2.0 * math.sinh(l)) * math.cos((K / 2.0))) * J) + U
function code(J, l, K, U) return Float64(Float64(Float64(Float64(2.0 * sinh(l)) * cos(Float64(K / 2.0))) * J) + U) end
function tmp = code(J, l, K, U) tmp = (((2.0 * sinh(l)) * cos((K / 2.0))) * J) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot J + U
\end{array}
Initial program 90.4%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64100.0%
Applied egg-rr100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.76)
(+
U
(*
(*
J
(*
l
(+
2.0
(*
l
(* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(+ (* -0.125 (* K K)) 1.0)))
(if (<= t_0 -0.02)
(+ U (* J (* t_0 (* 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.76) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else if (t_0 <= -0.02) {
tmp = U + (J * (t_0 * (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.76d0)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))) * (((-0.125d0) * (k * k)) + 1.0d0))
else if (t_0 <= (-0.02d0)) then
tmp = u + (j * (t_0 * (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.76) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else if (t_0 <= -0.02) {
tmp = U + (J * (t_0 * (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.76: tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)) elif t_0 <= -0.02: tmp = U + (J * (t_0 * (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.76) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); elseif (t_0 <= -0.02) tmp = Float64(U + Float64(J * Float64(t_0 * 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.76) tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)); elseif (t_0 <= -0.02) tmp = U + (J * (t_0 * (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.76], N[(U + N[(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] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[(U + N[(J * N[(t$95$0 * 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.76:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;U + J \cdot \left(t\_0 \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.76000000000000001Initial program 96.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.4%
Simplified73.4%
Taylor expanded in K around 0
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified73.3%
if -0.76000000000000001 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0200000000000000004Initial program 81.6%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Taylor expanded in l around 0
*-lowering-*.f6478.2%
Simplified78.2%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.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.f6490.7%
Simplified90.7%
+-lowering-+.f64N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6498.0%
Applied egg-rr98.0%
Final simplification93.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.76)
(+
U
(*
(*
J
(*
l
(+
2.0
(*
l
(* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(+ (* -0.125 (* K K)) 1.0)))
(if (<= t_0 -0.02)
(+ 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.76) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else if (t_0 <= -0.02) {
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.76d0)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))) * (((-0.125d0) * (k * k)) + 1.0d0))
else if (t_0 <= (-0.02d0)) 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.76) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else if (t_0 <= -0.02) {
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.76: tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)) elif t_0 <= -0.02: 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.76) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); elseif (t_0 <= -0.02) 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.76) tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)); elseif (t_0 <= -0.02) 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.76], N[(U + N[(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] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], 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.76:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\\
\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;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.76000000000000001Initial program 96.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.4%
Simplified73.4%
Taylor expanded in K around 0
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified73.3%
if -0.76000000000000001 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0200000000000000004Initial program 81.6%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6478.1%
Simplified78.1%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.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.f6490.7%
Simplified90.7%
+-lowering-+.f64N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6498.0%
Applied egg-rr98.0%
Final simplification93.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.755)
(+
U
(*
t_0
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
(* l l)
(+ 0.016666666666666666 (* (* l l) 0.0003968253968253968))))))))))
(+ U (* (* 2.0 (sinh l)) J)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.755) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))));
} else {
tmp = U + ((2.0 * sinh(l)) * J);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.755d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0)))))))))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= 0.755) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.755: tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.755) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= 0.755) tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))); else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.755], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.755:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.755000000000000004Initial program 89.5%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6493.6%
Simplified93.6%
if 0.755000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 90.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.f6490.9%
Simplified90.9%
+-lowering-+.f64N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.5%
Applied egg-rr99.5%
Final simplification97.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.755)
(+
U
(*
t_0
(*
J
(*
l
(+
2.0
(*
(* l l)
(+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))
(+ U (* (* 2.0 (sinh l)) J)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.755) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = U + ((2.0 * sinh(l)) * J);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.755d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= 0.755) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.755: tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.755) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= 0.755) tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.755], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.755:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.755000000000000004Initial program 89.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
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.3%
Simplified91.3%
if 0.755000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 90.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.f6490.9%
Simplified90.9%
+-lowering-+.f64N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.5%
Applied egg-rr99.5%
Final simplification96.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.02)
(+ 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.02) {
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.02d0)) 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.02) {
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.02: 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.02) 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.02) 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.02], 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.02:\\
\;\;\;\;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.0200000000000000004Initial program 88.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.8%
Simplified86.8%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.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.f6490.7%
Simplified90.7%
+-lowering-+.f64N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6498.0%
Applied egg-rr98.0%
Final simplification95.7%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.02) (+ U (* l (* (cos (* K 0.5)) (* J (+ 2.0 (* (* l l) 0.3333333333333333)))))) (+ U (* (* 2.0 (sinh l)) J))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.02) {
tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = U + ((2.0 * sinh(l)) * J);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= (-0.02d0)) then
tmp = u + (l * (cos((k * 0.5d0)) * (j * (2.0d0 + ((l * l) * 0.3333333333333333d0)))))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= -0.02) {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.02: tmp = U + (l * (math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333))))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.02) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.02) tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333))))); else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.02], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.02:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0200000000000000004Initial program 88.3%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-rgt-outN/A
Simplified83.3%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.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.f6490.7%
Simplified90.7%
+-lowering-+.f64N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6498.0%
Applied egg-rr98.0%
Final simplification94.9%
(FPCore (J l K U)
:precision binary64
(if (<= l -7.2e+68)
(+
U
(*
(*
J
(*
l
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(+ (* -0.125 (* K K)) 1.0)))
(+ U (* (* 2.0 (sinh l)) J))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -7.2e+68) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} 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 (l <= (-7.2d+68)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))) * (((-0.125d0) * (k * k)) + 1.0d0))
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 (l <= -7.2e+68) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -7.2e+68: tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -7.2e+68) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); 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 (l <= -7.2e+68) tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)); else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -7.2e+68], N[(U + N[(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] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $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}\;\ell \leq -7.2 \cdot 10^{+68}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if l < -7.1999999999999998e68Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.0%
Simplified91.0%
Taylor expanded in K around 0
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified83.0%
if -7.1999999999999998e68 < l 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.f6481.5%
Simplified81.5%
+-lowering-+.f64N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
sub-negN/A
rec-expN/A
sinh-undefN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6488.8%
Applied egg-rr88.8%
Final simplification87.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+
0.3333333333333333
(*
l
(* l (+ 0.016666666666666666 (* (* l l) 0.0003968253968253968))))))
(t_1 (* (* l l) t_0)))
(if (<= l -1.8e+26)
(+
U
(*
(*
J
(*
l
(+
2.0
(*
l
(* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(+ (* -0.125 (* K K)) 1.0)))
(if (<= l 5e+16)
(+
U
(/
(* (+ 8.0 (* t_1 (* t_1 t_1))) (* l J))
(+ 4.0 (* t_1 (- t_1 2.0)))))
(* U (/ (* (* l J) (+ 2.0 (* l (* l t_0)))) U))))))
double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))));
double t_1 = (l * l) * t_0;
double tmp;
if (l <= -1.8e+26) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else if (l <= 5e+16) {
tmp = U + (((8.0 + (t_1 * (t_1 * t_1))) * (l * J)) / (4.0 + (t_1 * (t_1 - 2.0))));
} else {
tmp = U * (((l * J) * (2.0 + (l * (l * t_0)))) / U);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0))))
t_1 = (l * l) * t_0
if (l <= (-1.8d+26)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))) * (((-0.125d0) * (k * k)) + 1.0d0))
else if (l <= 5d+16) then
tmp = u + (((8.0d0 + (t_1 * (t_1 * t_1))) * (l * j)) / (4.0d0 + (t_1 * (t_1 - 2.0d0))))
else
tmp = u * (((l * j) * (2.0d0 + (l * (l * t_0)))) / u)
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 + ((l * l) * 0.0003968253968253968))));
double t_1 = (l * l) * t_0;
double tmp;
if (l <= -1.8e+26) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else if (l <= 5e+16) {
tmp = U + (((8.0 + (t_1 * (t_1 * t_1))) * (l * J)) / (4.0 + (t_1 * (t_1 - 2.0))));
} else {
tmp = U * (((l * J) * (2.0 + (l * (l * t_0)))) / U);
}
return tmp;
}
def code(J, l, K, U): t_0 = 0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))) t_1 = (l * l) * t_0 tmp = 0 if l <= -1.8e+26: tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)) elif l <= 5e+16: tmp = U + (((8.0 + (t_1 * (t_1 * t_1))) * (l * J)) / (4.0 + (t_1 * (t_1 - 2.0)))) else: tmp = U * (((l * J) * (2.0 + (l * (l * t_0)))) / U) return tmp
function code(J, l, K, U) t_0 = Float64(0.3333333333333333 + Float64(l * Float64(l * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968))))) t_1 = Float64(Float64(l * l) * t_0) tmp = 0.0 if (l <= -1.8e+26) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); elseif (l <= 5e+16) tmp = Float64(U + Float64(Float64(Float64(8.0 + Float64(t_1 * Float64(t_1 * t_1))) * Float64(l * J)) / Float64(4.0 + Float64(t_1 * Float64(t_1 - 2.0))))); else tmp = Float64(U * Float64(Float64(Float64(l * J) * Float64(2.0 + Float64(l * Float64(l * t_0)))) / U)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))); t_1 = (l * l) * t_0; tmp = 0.0; if (l <= -1.8e+26) tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)); elseif (l <= 5e+16) tmp = U + (((8.0 + (t_1 * (t_1 * t_1))) * (l * J)) / (4.0 + (t_1 * (t_1 - 2.0)))); else tmp = U * (((l * J) * (2.0 + (l * (l * t_0)))) / U); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(0.3333333333333333 + N[(l * N[(l * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[l, -1.8e+26], N[(U + N[(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] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5e+16], N[(U + N[(N[(N[(8.0 + N[(t$95$1 * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] / N[(4.0 + N[(t$95$1 * N[(t$95$1 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(l * N[(l * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\\
t_1 := \left(\ell \cdot \ell\right) \cdot t\_0\\
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+26}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+16}:\\
\;\;\;\;U + \frac{\left(8 + t\_1 \cdot \left(t\_1 \cdot t\_1\right)\right) \cdot \left(\ell \cdot J\right)}{4 + t\_1 \cdot \left(t\_1 - 2\right)}\\
\mathbf{else}:\\
\;\;\;\;U \cdot \frac{\left(\ell \cdot J\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot t\_0\right)\right)}{U}\\
\end{array}
\end{array}
if l < -1.80000000000000012e26Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.5%
Simplified83.5%
Taylor expanded in K around 0
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified81.0%
if -1.80000000000000012e26 < l < 5e16Initial program 81.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.5%
Simplified79.5%
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-*.f6484.2%
Simplified84.2%
associate-*r*N/A
flip3-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr89.3%
if 5e16 < 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.f6487.0%
Simplified87.0%
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.2%
Simplified80.2%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified85.7%
Taylor expanded in J around inf
/-lowering-/.f64N/A
Simplified85.7%
Final simplification86.5%
(FPCore (J l K U)
:precision binary64
(if (<= l -2.6e+68)
(+
U
(*
(*
J
(*
l
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(+ (* -0.125 (* K K)) 1.0)))
(*
U
(+
1.0
(*
J
(/
(*
l
(+
2.0
(*
l
(*
l
(+
0.3333333333333333
(*
(* l l)
(+ 0.016666666666666666 (* (* l l) 0.0003968253968253968))))))))
U))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.6e+68) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U * (1.0 + (J * ((l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))) / U)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-2.6d+68)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))) * (((-0.125d0) * (k * k)) + 1.0d0))
else
tmp = u * (1.0d0 + (j * ((l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0)))))))) / u)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.6e+68) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U * (1.0 + (J * ((l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))) / U)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -2.6e+68: tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)) else: tmp = U * (1.0 + (J * ((l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))) / U))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -2.6e+68) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); else tmp = Float64(U * Float64(1.0 + Float64(J * Float64(Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))) / U)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -2.6e+68) tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)); else tmp = U * (1.0 + (J * ((l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))) / U))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -2.6e+68], N[(U + N[(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] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(1.0 + N[(J * N[(N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.6 \cdot 10^{+68}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(1 + J \cdot \frac{\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)}{U}\right)\\
\end{array}
\end{array}
if l < -2.5999999999999998e68Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.0%
Simplified91.0%
Taylor expanded in K around 0
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified83.0%
if -2.5999999999999998e68 < l 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.f6481.5%
Simplified81.5%
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-*.f6482.2%
Simplified82.2%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified84.0%
associate-*l*N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
Applied egg-rr84.5%
Final simplification84.2%
(FPCore (J l K U)
:precision binary64
(if (<= l -4.5e+68)
(+
U
(*
(*
J
(*
l
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(+ (* -0.125 (* K K)) 1.0)))
(+
U
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(* l (* 0.0003968253968253968 (* l (* l l))))))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.5e+68) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * (l * (l * l)))))))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-4.5d+68)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))) * (((-0.125d0) * (k * k)) + 1.0d0))
else
tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (0.0003968253968253968d0 * (l * (l * l)))))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.5e+68) {
tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * (l * (l * l)))))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -4.5e+68: tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)) else: tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * (l * (l * l))))))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -4.5e+68) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(0.0003968253968253968 * Float64(l * Float64(l * l)))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -4.5e+68) tmp = U + ((J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) * ((-0.125 * (K * K)) + 1.0)); else tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * (l * (l * l))))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.5e+68], N[(U + N[(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] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(0.0003968253968253968 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+68}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(0.0003968253968253968 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < -4.5000000000000003e68Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.0%
Simplified91.0%
Taylor expanded in K around 0
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Simplified83.0%
if -4.5000000000000003e68 < l 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.f6481.5%
Simplified81.5%
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-*.f6482.2%
Simplified82.2%
Taylor expanded in l around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.2%
Simplified82.2%
Final simplification82.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* l (* l l))))
(if (<= l -3.2e+96)
(* (* J 0.3333333333333333) (* t_0 (+ (* -0.125 (* K K)) 1.0)))
(+
U
(*
J
(*
l
(+
2.0
(*
(* l l)
(+ 0.3333333333333333 (* l (* 0.0003968253968253968 t_0)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = l * (l * l);
double tmp;
if (l <= -3.2e+96) {
tmp = (J * 0.3333333333333333) * (t_0 * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * 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 * l)
if (l <= (-3.2d+96)) then
tmp = (j * 0.3333333333333333d0) * (t_0 * (((-0.125d0) * (k * k)) + 1.0d0))
else
tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (0.0003968253968253968d0 * 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 * l);
double tmp;
if (l <= -3.2e+96) {
tmp = (J * 0.3333333333333333) * (t_0 * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * t_0)))))));
}
return tmp;
}
def code(J, l, K, U): t_0 = l * (l * l) tmp = 0 if l <= -3.2e+96: tmp = (J * 0.3333333333333333) * (t_0 * ((-0.125 * (K * K)) + 1.0)) else: tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * t_0))))))) return tmp
function code(J, l, K, U) t_0 = Float64(l * Float64(l * l)) tmp = 0.0 if (l <= -3.2e+96) tmp = Float64(Float64(J * 0.3333333333333333) * Float64(t_0 * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(0.0003968253968253968 * t_0)))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = l * (l * l); tmp = 0.0; if (l <= -3.2e+96) tmp = (J * 0.3333333333333333) * (t_0 * ((-0.125 * (K * K)) + 1.0)); else tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (0.0003968253968253968 * t_0))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.2e+96], N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[(t$95$0 * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(0.0003968253968253968 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(\ell \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{+96}:\\
\;\;\;\;\left(J \cdot 0.3333333333333333\right) \cdot \left(t\_0 \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(0.0003968253968253968 \cdot t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < -3.20000000000000006e96Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.9%
Simplified97.9%
Taylor expanded in K around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified75.8%
Taylor expanded in l around inf
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.4%
Simplified84.4%
if -3.20000000000000006e96 < l 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.f6480.8%
Simplified80.8%
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-*.f6481.5%
Simplified81.5%
Taylor expanded in l around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6481.5%
Simplified81.5%
Final simplification82.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -1.75e+96)
(* (* J 0.3333333333333333) (* (* l (* l l)) (+ (* -0.125 (* K K)) 1.0)))
(+
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 <= -1.75e+96) {
tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0));
} 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 <= (-1.75d+96)) then
tmp = (j * 0.3333333333333333d0) * ((l * (l * l)) * (((-0.125d0) * (k * k)) + 1.0d0))
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 <= -1.75e+96) {
tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0));
} 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 <= -1.75e+96: tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0)) 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 <= -1.75e+96) tmp = Float64(Float64(J * 0.3333333333333333) * Float64(Float64(l * Float64(l * l)) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(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.75e+96) tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0)); 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, -1.75e+96], N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[(N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{+96}:\\
\;\;\;\;\left(J \cdot 0.3333333333333333\right) \cdot \left(\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < -1.7499999999999999e96Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.9%
Simplified97.9%
Taylor expanded in K around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified75.8%
Taylor expanded in l around inf
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.4%
Simplified84.4%
if -1.7499999999999999e96 < l Initial program 88.4%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.9%
Simplified85.9%
Taylor expanded in K around 0
*-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*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-*.f6479.1%
Simplified79.1%
Final simplification80.1%
(FPCore (J l K U) :precision binary64 (if (<= l -3.7e+25) (* (* J 0.3333333333333333) (* (* l (* l l)) (+ (* -0.125 (* K K)) 1.0))) (+ U (* J (* l (+ 2.0 (* (* l l) 0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -3.7e+25) {
tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U + (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 (l <= (-3.7d+25)) then
tmp = (j * 0.3333333333333333d0) * ((l * (l * l)) * (((-0.125d0) * (k * k)) + 1.0d0))
else
tmp = u + (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 (l <= -3.7e+25) {
tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -3.7e+25: tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0)) else: tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -3.7e+25) tmp = Float64(Float64(J * 0.3333333333333333) * Float64(Float64(l * Float64(l * l)) * Float64(Float64(-0.125 * Float64(K * K)) + 1.0))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -3.7e+25) tmp = (J * 0.3333333333333333) * ((l * (l * l)) * ((-0.125 * (K * K)) + 1.0)); else tmp = U + (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -3.7e+25], N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[(N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.7 \cdot 10^{+25}:\\
\;\;\;\;\left(J \cdot 0.3333333333333333\right) \cdot \left(\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \left(-0.125 \cdot \left(K \cdot K\right) + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
\end{array}
\end{array}
if l < -3.6999999999999999e25Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.3%
Simplified83.3%
Taylor expanded in K around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified67.7%
Taylor expanded in l around inf
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.5%
Simplified74.5%
if -3.6999999999999999e25 < l Initial program 87.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.f6482.1%
Simplified82.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.9%
Simplified77.9%
Final simplification77.1%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* 2.0 (* l J)))) (if (<= l -960.0) t_0 (if (<= l 520.0) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (l * J);
double tmp;
if (l <= -960.0) {
tmp = t_0;
} else if (l <= 520.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 = 2.0d0 * (l * j)
if (l <= (-960.0d0)) then
tmp = t_0
else if (l <= 520.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 = 2.0 * (l * J);
double tmp;
if (l <= -960.0) {
tmp = t_0;
} else if (l <= 520.0) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = 2.0 * (l * J) tmp = 0 if l <= -960.0: tmp = t_0 elif l <= 520.0: tmp = U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(2.0 * Float64(l * J)) tmp = 0.0 if (l <= -960.0) tmp = t_0; elseif (l <= 520.0) tmp = U; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 2.0 * (l * J); tmp = 0.0; if (l <= -960.0) tmp = t_0; elseif (l <= 520.0) tmp = U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -960.0], t$95$0, If[LessEqual[l, 520.0], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{if}\;\ell \leq -960:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 520:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -960 or 520 < 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.f6481.3%
Simplified81.3%
Taylor expanded in l around 0
*-lowering-*.f6422.1%
Simplified22.1%
Taylor expanded in J around inf
*-lowering-*.f64N/A
*-lowering-*.f6422.3%
Simplified22.3%
if -960 < l < 520Initial program 79.0%
Taylor expanded in J around 0
Simplified76.3%
Final simplification47.0%
(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 90.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.f6479.5%
Simplified79.5%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.0%
Simplified74.0%
Final simplification74.0%
(FPCore (J l K U) :precision binary64 (* U (+ 1.0 (/ (* 2.0 (* l J)) U))))
double code(double J, double l, double K, double U) {
return U * (1.0 + ((2.0 * (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 = u * (1.0d0 + ((2.0d0 * (l * j)) / u))
end function
public static double code(double J, double l, double K, double U) {
return U * (1.0 + ((2.0 * (l * J)) / U));
}
def code(J, l, K, U): return U * (1.0 + ((2.0 * (l * J)) / U))
function code(J, l, K, U) return Float64(U * Float64(1.0 + Float64(Float64(2.0 * Float64(l * J)) / U))) end
function tmp = code(J, l, K, U) tmp = U * (1.0 + ((2.0 * (l * J)) / U)); end
code[J_, l_, K_, U_] := N[(U * N[(1.0 + N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U \cdot \left(1 + \frac{2 \cdot \left(\ell \cdot J\right)}{U}\right)
\end{array}
Initial program 90.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.f6479.5%
Simplified79.5%
Taylor expanded in l around 0
*-lowering-*.f6453.1%
Simplified53.1%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6456.4%
Simplified56.4%
Final simplification56.4%
(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 90.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.f6479.5%
Simplified79.5%
Taylor expanded in l around 0
*-lowering-*.f6453.1%
Simplified53.1%
Final simplification53.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 90.4%
Taylor expanded in J around 0
Simplified36.2%
herbie shell --seed 2024192
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))