
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U) :precision binary64 (+ (* (* (cos (/ K 2.0)) (* 2.0 (sinh l))) J) U))
double code(double J, double l, double K, double U) {
return ((cos((K / 2.0)) * (2.0 * sinh(l))) * J) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((cos((k / 2.0d0)) * (2.0d0 * sinh(l))) * j) + u
end function
public static double code(double J, double l, double K, double U) {
return ((Math.cos((K / 2.0)) * (2.0 * Math.sinh(l))) * J) + U;
}
def code(J, l, K, U): return ((math.cos((K / 2.0)) * (2.0 * math.sinh(l))) * J) + U
function code(J, l, K, U) return Float64(Float64(Float64(cos(Float64(K / 2.0)) * Float64(2.0 * sinh(l))) * J) + U) end
function tmp = code(J, l, K, U) tmp = ((cos((K / 2.0)) * (2.0 * sinh(l))) * J) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(\cos \left(\frac{K}{2}\right) \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot J + U
\end{array}
Initial program 87.1%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.9%
Applied egg-rr99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.75)
(+
U
(*
(* J (* l (+ 2.0 (* l (* l (* (* l l) 0.016666666666666666))))))
(+ 1.0 (* -0.125 (* K K)))))
(if (<= t_0 0.01)
(+ U (* t_0 (/ J (/ 0.5 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.75) {
tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
} else if (t_0 <= 0.01) {
tmp = U + (t_0 * (J / (0.5 / 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.75d0)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
else if (t_0 <= 0.01d0) then
tmp = u + (t_0 * (j / (0.5d0 / 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.75) {
tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
} else if (t_0 <= 0.01) {
tmp = U + (t_0 * (J / (0.5 / 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.75: tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K)))) elif t_0 <= 0.01: tmp = U + (t_0 * (J / (0.5 / 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.75) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))); elseif (t_0 <= 0.01) tmp = Float64(U + Float64(t_0 * Float64(J / Float64(0.5 / 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.75) tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K)))); elseif (t_0 <= 0.01) tmp = U + (t_0 * (J / (0.5 / 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.75], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.01], N[(U + N[(t$95$0 * N[(J / N[(0.5 / 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.75:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0.01:\\
\;\;\;\;U + t\_0 \cdot \frac{J}{\frac{0.5}{\ell}}\\
\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.75Initial program 84.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.7%
Simplified77.7%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.6%
Simplified73.6%
Taylor expanded in l around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.6%
Simplified73.6%
if -0.75 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.0100000000000000002Initial program 75.3%
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.9%
Applied egg-rr99.9%
Taylor expanded in l around 0
/-lowering-/.f6475.3%
Simplified75.3%
if 0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified96.1%
Final simplification91.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.75)
(+
U
(*
(* J (* l (+ 2.0 (* l (* l (* (* l l) 0.016666666666666666))))))
(+ 1.0 (* -0.125 (* K K)))))
(if (<= t_0 0.01)
(+ U (* l (* (cos (* K 0.5)) (* 2.0 J))))
(+ U (* (* 2.0 (sinh l)) J))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.75) {
tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
} else if (t_0 <= 0.01) {
tmp = U + (l * (cos((K * 0.5)) * (2.0 * J)));
} else {
tmp = U + ((2.0 * sinh(l)) * J);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= (-0.75d0)) then
tmp = u + ((j * (l * (2.0d0 + (l * (l * ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
else if (t_0 <= 0.01d0) then
tmp = u + (l * (cos((k * 0.5d0)) * (2.0d0 * j)))
else
tmp = u + ((2.0d0 * sinh(l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= -0.75) {
tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
} else if (t_0 <= 0.01) {
tmp = U + (l * (Math.cos((K * 0.5)) * (2.0 * J)));
} else {
tmp = U + ((2.0 * Math.sinh(l)) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.75: tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K)))) elif t_0 <= 0.01: tmp = U + (l * (math.cos((K * 0.5)) * (2.0 * J))) else: tmp = U + ((2.0 * math.sinh(l)) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.75) tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))); elseif (t_0 <= 0.01) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(2.0 * J)))); else tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= -0.75) tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K)))); elseif (t_0 <= 0.01) tmp = U + (l * (cos((K * 0.5)) * (2.0 * J))); else tmp = U + ((2.0 * sinh(l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.75], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.01], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -0.75:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0.01:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot J\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.75Initial program 84.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.7%
Simplified77.7%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.6%
Simplified73.6%
Taylor expanded in l around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.6%
Simplified73.6%
if -0.75 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.0100000000000000002Initial program 75.3%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified96.2%
Taylor expanded in l around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.2%
Simplified75.2%
if 0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified96.1%
Final simplification91.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.995)
(+ 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.995) {
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.995d0) 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.995) {
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.995: 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.995) 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.995) 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.995], 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.995:\\
\;\;\;\;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.994999999999999996Initial program 82.2%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.5%
Simplified86.5%
if 0.994999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified100.0%
Final simplification94.0%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.01) (+ U (* l (* (* J (+ 2.0 (* (* l l) 0.3333333333333333))) (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.01) {
tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * 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.01d0) then
tmp = u + (l * ((j * (2.0d0 + ((l * l) * 0.3333333333333333d0))) * 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.01) {
tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * 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.01: tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * 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.01) tmp = Float64(U + Float64(l * Float64(Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))) * 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.01) tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * 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.01], N[(U + N[(l * N[(N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $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.01:\\
\;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \cos \left(K \cdot 0.5\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.0100000000000000002Initial program 79.9%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified86.4%
if 0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified96.1%
Final simplification93.9%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 5e-59)
(+ U (* (* 2.0 (sinh l)) J))
(+
U
(*
(cos (/ K 2.0))
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
(* l l)
(+ 0.016666666666666666 (* l (* l 0.0003968253968253968)))))))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 5e-59) {
tmp = U + ((2.0 * sinh(l)) * J);
} else {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((k / 2.0d0) <= 5d-59) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * (0.016666666666666666d0 + (l * (l * 0.0003968253968253968d0))))))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 5e-59) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (K / 2.0) <= 5e-59: tmp = U + ((2.0 * math.sinh(l)) * J) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (Float64(K / 2.0) <= 5e-59) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(l * Float64(l * 0.0003968253968253968))))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((K / 2.0) <= 5e-59) tmp = U + ((2.0 * sinh(l)) * J); else tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968)))))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 5e-59], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(l * N[(l * 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 5 \cdot 10^{-59}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 5.0000000000000001e-59Initial program 90.5%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified88.2%
if 5.0000000000000001e-59 < (/.f64 K #s(literal 2 binary64)) Initial program 78.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.9%
Simplified95.9%
Final simplification90.3%
(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))))
(if (<= l -4e+155)
t_0
(if (<= l -0.0024)
t_1
(if (<= l 240.0)
(+ U (* (cos (/ K 2.0)) (* J (* 2.0 l))))
(if (<= l 1e+138) 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);
double tmp;
if (l <= -4e+155) {
tmp = t_0;
} else if (l <= -0.0024) {
tmp = t_1;
} else if (l <= 240.0) {
tmp = U + (cos((K / 2.0)) * (J * (2.0 * l)));
} else if (l <= 1e+138) {
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)
if (l <= (-4d+155)) then
tmp = t_0
else if (l <= (-0.0024d0)) then
tmp = t_1
else if (l <= 240.0d0) then
tmp = u + (cos((k / 2.0d0)) * (j * (2.0d0 * l)))
else if (l <= 1d+138) 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);
double tmp;
if (l <= -4e+155) {
tmp = t_0;
} else if (l <= -0.0024) {
tmp = t_1;
} else if (l <= 240.0) {
tmp = U + (Math.cos((K / 2.0)) * (J * (2.0 * l)));
} else if (l <= 1e+138) {
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) tmp = 0 if l <= -4e+155: tmp = t_0 elif l <= -0.0024: tmp = t_1 elif l <= 240.0: tmp = U + (math.cos((K / 2.0)) * (J * (2.0 * l))) elif l <= 1e+138: 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(l * Float64(l * 0.3333333333333333))))) t_1 = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)) tmp = 0.0 if (l <= -4e+155) tmp = t_0; elseif (l <= -0.0024) tmp = t_1; elseif (l <= 240.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(2.0 * l)))); elseif (l <= 1e+138) 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); tmp = 0.0; if (l <= -4e+155) tmp = t_0; elseif (l <= -0.0024) tmp = t_1; elseif (l <= 240.0) tmp = U + (cos((K / 2.0)) * (J * (2.0 * l))); elseif (l <= 1e+138) 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[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4e+155], t$95$0, If[LessEqual[l, -0.0024], t$95$1, If[LessEqual[l, 240.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, 1e+138], 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 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
t_1 := U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{if}\;\ell \leq -4 \cdot 10^{+155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -0.0024:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 240:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\
\mathbf{elif}\;\ell \leq 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -4.00000000000000003e155 or 1e138 < l Initial program 100.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified100.0%
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
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
if -4.00000000000000003e155 < l < -0.00239999999999999979 or 240 < l < 1e138Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified84.9%
if -0.00239999999999999979 < l < 240Initial program 71.9%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6498.7%
Simplified98.7%
Final simplification96.3%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 2e-26)
(+ U (* (* 2.0 (sinh l)) J))
(+
U
(*
(cos (/ K 2.0))
(*
J
(*
l
(+
2.0
(*
l
(* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 2e-26) {
tmp = U + ((2.0 * sinh(l)) * J);
} else {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((k / 2.0d0) <= 2d-26) then
tmp = u + ((2.0d0 * sinh(l)) * j)
else
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 2e-26) {
tmp = U + ((2.0 * Math.sinh(l)) * J);
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (K / 2.0) <= 2e-26: tmp = U + ((2.0 * math.sinh(l)) * J) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (Float64(K / 2.0) <= 2e-26) tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J)); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(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 ((K / 2.0) <= 2e-26) tmp = U + ((2.0 * sinh(l)) * J); else tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 2e-26], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{K}{2} \leq 2 \cdot 10^{-26}:\\
\;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 2.0000000000000001e-26Initial program 90.3%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified88.6%
if 2.0000000000000001e-26 < (/.f64 K #s(literal 2 binary64)) Initial program 77.2%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.4%
Simplified92.4%
Final simplification89.5%
(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 87.1%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.9%
Applied egg-rr99.9%
Taylor expanded in K around 0
Simplified81.5%
Final simplification81.5%
(FPCore (J l K U)
:precision binary64
(if (<= J -8e+156)
(+ U (* (* J (* 2.0 l)) (+ 1.0 (* K (* K -0.125)))))
(+
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 (J <= -8e+156) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} 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 (j <= (-8d+156)) then
tmp = u + ((j * (2.0d0 * l)) * (1.0d0 + (k * (k * (-0.125d0)))))
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 (J <= -8e+156) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} 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 J <= -8e+156: tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))) 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 (J <= -8e+156) tmp = Float64(U + Float64(Float64(J * Float64(2.0 * l)) * Float64(1.0 + Float64(K * Float64(K * -0.125))))); 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 (J <= -8e+156) tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))); 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[J, -8e+156], N[(U + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * -0.125), $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}\;J \leq -8 \cdot 10^{+156}:\\
\;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\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 J < -7.9999999999999999e156Initial program 62.2%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified96.2%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.4%
Simplified77.4%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6477.4%
Simplified77.4%
if -7.9999999999999999e156 < J Initial program 89.9%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.7%
Simplified93.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
*-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-*.f6479.4%
Simplified79.4%
Final simplification79.2%
(FPCore (J l K U)
:precision binary64
(if (<= J -8e+156)
(+ U (* (* J (* 2.0 l)) (+ 1.0 (* K (* K -0.125)))))
(+
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 (J <= -8e+156) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} 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 (j <= (-8d+156)) then
tmp = u + ((j * (2.0d0 * l)) * (1.0d0 + (k * (k * (-0.125d0)))))
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 (J <= -8e+156) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} 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 J <= -8e+156: tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))) 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 (J <= -8e+156) tmp = Float64(U + Float64(Float64(J * Float64(2.0 * l)) * Float64(1.0 + Float64(K * Float64(K * -0.125))))); 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 (J <= -8e+156) tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))); 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[J, -8e+156], N[(U + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $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}\;J \leq -8 \cdot 10^{+156}:\\
\;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\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 J < -7.9999999999999999e156Initial program 62.2%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified96.2%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.4%
Simplified77.4%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6477.4%
Simplified77.4%
if -7.9999999999999999e156 < J Initial program 89.9%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.3%
Simplified91.3%
Taylor expanded in K around 0
Simplified77.9%
Final simplification77.8%
(FPCore (J l K U)
:precision binary64
(if (<= J -8e+156)
(+ U (* (* J (* 2.0 l)) (+ 1.0 (* K (* K -0.125)))))
(+
U
(*
(* l J)
(+
2.0
(* (* l l) (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (J <= -8e+156) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} else {
tmp = U + ((l * J) * (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 (j <= (-8d+156)) then
tmp = u + ((j * (2.0d0 * l)) * (1.0d0 + (k * (k * (-0.125d0)))))
else
tmp = u + ((l * j) * (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 (J <= -8e+156) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} else {
tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if J <= -8e+156: tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))) else: tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (J <= -8e+156) tmp = Float64(U + Float64(Float64(J * Float64(2.0 * l)) * Float64(1.0 + Float64(K * Float64(K * -0.125))))); else tmp = Float64(U + Float64(Float64(l * J) * 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 (J <= -8e+156) tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))); else tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[J, -8e+156], N[(U + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(l * J), $MachinePrecision] * 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}\;J \leq -8 \cdot 10^{+156}:\\
\;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\\
\end{array}
\end{array}
if J < -7.9999999999999999e156Initial program 62.2%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified96.2%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.4%
Simplified77.4%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6477.4%
Simplified77.4%
if -7.9999999999999999e156 < J Initial program 89.9%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.3%
Simplified91.3%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.8%
Simplified67.8%
Taylor expanded in K around 0
associate-*r*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-*.f6476.6%
Simplified76.6%
Final simplification76.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* U (* J (/ (* l (* (* l l) 0.3333333333333333)) U)))))
(if (<= l -1.05e+61)
t_0
(if (<= l 3.05e+22)
(+ U (* l (* J (+ 2.0 (* l (* l 0.3333333333333333))))))
t_0))))
double code(double J, double l, double K, double U) {
double t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
double tmp;
if (l <= -1.05e+61) {
tmp = t_0;
} else if (l <= 3.05e+22) {
tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = u * (j * ((l * ((l * l) * 0.3333333333333333d0)) / u))
if (l <= (-1.05d+61)) then
tmp = t_0
else if (l <= 3.05d+22) then
tmp = u + (l * (j * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
double tmp;
if (l <= -1.05e+61) {
tmp = t_0;
} else if (l <= 3.05e+22) {
tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U)) tmp = 0 if l <= -1.05e+61: tmp = t_0 elif l <= 3.05e+22: tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U * Float64(J * Float64(Float64(l * Float64(Float64(l * l) * 0.3333333333333333)) / U))) tmp = 0.0 if (l <= -1.05e+61) tmp = t_0; elseif (l <= 3.05e+22) tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U)); tmp = 0.0; if (l <= -1.05e+61) tmp = t_0; elseif (l <= 3.05e+22) tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U * N[(J * N[(N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.05e+61], t$95$0, If[LessEqual[l, 3.05e+22], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U \cdot \left(J \cdot \frac{\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)}{U}\right)\\
\mathbf{if}\;\ell \leq -1.05 \cdot 10^{+61}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 3.05 \cdot 10^{+22}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.0500000000000001e61 or 3.0499999999999999e22 < l Initial program 100.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified82.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.9%
Simplified65.9%
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
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6472.4%
Simplified72.4%
Taylor expanded in l around inf
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
if -1.0500000000000001e61 < l < 3.0499999999999999e22Initial program 76.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified87.4%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.5%
Simplified73.5%
Final simplification74.9%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* U (* J (/ (* l (* (* l l) 0.3333333333333333)) U))))) (if (<= l -5.4e+19) t_0 (if (<= l 2.9e+22) (+ U (* J (* 2.0 l))) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
double tmp;
if (l <= -5.4e+19) {
tmp = t_0;
} else if (l <= 2.9e+22) {
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 = u * (j * ((l * ((l * l) * 0.3333333333333333d0)) / u))
if (l <= (-5.4d+19)) then
tmp = t_0
else if (l <= 2.9d+22) 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 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
double tmp;
if (l <= -5.4e+19) {
tmp = t_0;
} else if (l <= 2.9e+22) {
tmp = U + (J * (2.0 * l));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U)) tmp = 0 if l <= -5.4e+19: tmp = t_0 elif l <= 2.9e+22: tmp = U + (J * (2.0 * l)) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U * Float64(J * Float64(Float64(l * Float64(Float64(l * l) * 0.3333333333333333)) / U))) tmp = 0.0 if (l <= -5.4e+19) tmp = t_0; elseif (l <= 2.9e+22) 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 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U)); tmp = 0.0; if (l <= -5.4e+19) tmp = t_0; elseif (l <= 2.9e+22) 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[(U * N[(J * N[(N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5.4e+19], t$95$0, If[LessEqual[l, 2.9e+22], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U \cdot \left(J \cdot \frac{\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)}{U}\right)\\
\mathbf{if}\;\ell \leq -5.4 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+22}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -5.4e19 or 2.9e22 < l Initial program 100.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified77.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6462.1%
Simplified62.1%
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
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6468.0%
Simplified68.0%
Taylor expanded in l around inf
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
cube-multN/A
unpow2N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.8%
Simplified71.8%
if -5.4e19 < l < 2.9e22Initial program 73.9%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified93.0%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6477.9%
Simplified77.9%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6477.9%
Simplified77.9%
Final simplification74.8%
(FPCore (J l K U) :precision binary64 (if (<= J -2.7e+155) (+ U (* (* J (* 2.0 l)) (+ 1.0 (* K (* K -0.125))))) (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (J <= -2.7e+155) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} 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 (j <= (-2.7d+155)) then
tmp = u + ((j * (2.0d0 * l)) * (1.0d0 + (k * (k * (-0.125d0)))))
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 (J <= -2.7e+155) {
tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
} else {
tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if J <= -2.7e+155: tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))) else: tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (J <= -2.7e+155) tmp = Float64(U + Float64(Float64(J * Float64(2.0 * l)) * Float64(1.0 + Float64(K * Float64(K * -0.125))))); else tmp = Float64(U + 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 (J <= -2.7e+155) tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125)))); else tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[J, -2.7e+155], N[(U + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;J \leq -2.7 \cdot 10^{+155}:\\
\;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if J < -2.69999999999999994e155Initial program 62.2%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified96.2%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.4%
Simplified77.4%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6477.4%
Simplified77.4%
if -2.69999999999999994e155 < J Initial program 89.9%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified84.1%
Taylor expanded in K around 0
*-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%
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.3%
Applied egg-rr75.3%
Final simplification75.5%
(FPCore (J l K U) :precision binary64 (if (<= J -8e+156) (+ U (* l (* (+ 1.0 (* -0.125 (* K K))) (* 2.0 J)))) (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (J <= -8e+156) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J)));
} 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 (j <= (-8d+156)) then
tmp = u + (l * ((1.0d0 + ((-0.125d0) * (k * k))) * (2.0d0 * j)))
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 (J <= -8e+156) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J)));
} else {
tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if J <= -8e+156: tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J))) else: tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (J <= -8e+156) tmp = Float64(U + Float64(l * Float64(Float64(1.0 + Float64(-0.125 * Float64(K * K))) * Float64(2.0 * J)))); else tmp = Float64(U + 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 (J <= -8e+156) tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J))); else tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[J, -8e+156], N[(U + N[(l * N[(N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\
\;\;\;\;U + \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(2 \cdot J\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if J < -7.9999999999999999e156Initial program 62.2%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified96.2%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.4%
Simplified77.4%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6477.4%
Simplified77.4%
if -7.9999999999999999e156 < J Initial program 89.9%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified84.1%
Taylor expanded in K around 0
*-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%
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.3%
Applied egg-rr75.3%
Final simplification75.5%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* l (* (* l l) 0.3333333333333333))))) (if (<= l -5.4e+19) t_0 (if (<= l 1.4e+62) (+ U (* J (* 2.0 l))) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (l * ((l * l) * 0.3333333333333333));
double tmp;
if (l <= -5.4e+19) {
tmp = t_0;
} else if (l <= 1.4e+62) {
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 = j * (l * ((l * l) * 0.3333333333333333d0))
if (l <= (-5.4d+19)) then
tmp = t_0
else if (l <= 1.4d+62) 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 = J * (l * ((l * l) * 0.3333333333333333));
double tmp;
if (l <= -5.4e+19) {
tmp = t_0;
} else if (l <= 1.4e+62) {
tmp = U + (J * (2.0 * l));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (l * ((l * l) * 0.3333333333333333)) tmp = 0 if l <= -5.4e+19: tmp = t_0 elif l <= 1.4e+62: tmp = U + (J * (2.0 * l)) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(l * Float64(Float64(l * l) * 0.3333333333333333))) tmp = 0.0 if (l <= -5.4e+19) tmp = t_0; elseif (l <= 1.4e+62) 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 = J * (l * ((l * l) * 0.3333333333333333)); tmp = 0.0; if (l <= -5.4e+19) tmp = t_0; elseif (l <= 1.4e+62) 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[(J * N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5.4e+19], t$95$0, If[LessEqual[l, 1.4e+62], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
\mathbf{if}\;\ell \leq -5.4 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+62}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -5.4e19 or 1.40000000000000007e62 < l Initial program 100.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified81.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.5%
Simplified65.5%
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
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6470.9%
Simplified70.9%
Taylor expanded in l around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.3%
Simplified73.3%
if -5.4e19 < l < 1.40000000000000007e62Initial program 75.3%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified88.4%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6474.1%
Simplified74.1%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6474.1%
Simplified74.1%
Final simplification73.7%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* 0.3333333333333333 (* l (* J (* l l)))))) (if (<= l -9e+19) t_0 (if (<= l 1.4e+62) (+ U (* J (* 2.0 l))) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 * (l * (J * (l * l)));
double tmp;
if (l <= -9e+19) {
tmp = t_0;
} else if (l <= 1.4e+62) {
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 = 0.3333333333333333d0 * (l * (j * (l * l)))
if (l <= (-9d+19)) then
tmp = t_0
else if (l <= 1.4d+62) 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 = 0.3333333333333333 * (l * (J * (l * l)));
double tmp;
if (l <= -9e+19) {
tmp = t_0;
} else if (l <= 1.4e+62) {
tmp = U + (J * (2.0 * l));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = 0.3333333333333333 * (l * (J * (l * l))) tmp = 0 if l <= -9e+19: tmp = t_0 elif l <= 1.4e+62: tmp = U + (J * (2.0 * l)) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(0.3333333333333333 * Float64(l * Float64(J * Float64(l * l)))) tmp = 0.0 if (l <= -9e+19) tmp = t_0; elseif (l <= 1.4e+62) 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 = 0.3333333333333333 * (l * (J * (l * l))); tmp = 0.0; if (l <= -9e+19) tmp = t_0; elseif (l <= 1.4e+62) 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[(0.3333333333333333 * N[(l * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -9e+19], t$95$0, If[LessEqual[l, 1.4e+62], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{if}\;\ell \leq -9 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+62}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -9e19 or 1.40000000000000007e62 < l Initial program 100.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified81.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.5%
Simplified65.5%
Taylor expanded in l around inf
*-lowering-*.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6465.5%
Simplified65.5%
if -9e19 < l < 1.40000000000000007e62Initial program 75.3%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified88.4%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6474.1%
Simplified74.1%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6474.1%
Simplified74.1%
Final simplification70.0%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* l (* 2.0 J)))) (if (<= l -1020.0) t_0 (if (<= l 0.00013) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = l * (2.0 * J);
double tmp;
if (l <= -1020.0) {
tmp = t_0;
} else if (l <= 0.00013) {
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 = l * (2.0d0 * j)
if (l <= (-1020.0d0)) then
tmp = t_0
else if (l <= 0.00013d0) 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 = l * (2.0 * J);
double tmp;
if (l <= -1020.0) {
tmp = t_0;
} else if (l <= 0.00013) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = l * (2.0 * J) tmp = 0 if l <= -1020.0: tmp = t_0 elif l <= 0.00013: tmp = U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(l * Float64(2.0 * J)) tmp = 0.0 if (l <= -1020.0) tmp = t_0; elseif (l <= 0.00013) tmp = U; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = l * (2.0 * J); tmp = 0.0; if (l <= -1020.0) tmp = t_0; elseif (l <= 0.00013) tmp = U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1020.0], t$95$0, If[LessEqual[l, 0.00013], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(2 \cdot J\right)\\
\mathbf{if}\;\ell \leq -1020:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 0.00013:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1020 or 1.29999999999999989e-4 < l Initial program 99.9%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified73.2%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6458.3%
Simplified58.3%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6418.3%
Simplified18.3%
Taylor expanded in J around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6417.6%
Simplified17.6%
if -1020 < l < 1.29999999999999989e-4Initial program 71.6%
Taylor expanded in J around 0
Simplified71.6%
Final simplification42.1%
(FPCore (J l K U) :precision binary64 (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
def code(J, l, K, U): return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))) end
function tmp = code(J, l, K, U) tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333))))); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)
\end{array}
Initial program 87.1%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified85.3%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6470.0%
Simplified70.0%
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.8%
Applied egg-rr73.8%
Final simplification73.8%
(FPCore (J l K U) :precision binary64 (+ U (* J (* 2.0 l))))
double code(double J, double l, double K, double U) {
return U + (J * (2.0 * l));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (2.0d0 * l))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (2.0 * l));
}
def code(J, l, K, U): return U + (J * (2.0 * l))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(2.0 * l))) end
function tmp = code(J, l, K, U) tmp = U + (J * (2.0 * l)); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 87.1%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified85.3%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6470.0%
Simplified70.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6448.1%
Simplified48.1%
Final simplification48.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 87.1%
Taylor expanded in J around 0
Simplified33.7%
herbie shell --seed 2024145
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))