
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U) :precision binary64 (+ (* (* (* 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 89.2%
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.95)
(*
U
(+ 1.0 (* J (/ (* t_0 (* l (+ 2.0 (* l (* l 0.3333333333333333))))) U))))
(+
U
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
l
(*
l
(+
0.016666666666666666
(* (* l l) 0.0003968253968253968)))))))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.95) {
tmp = U * (1.0 + (J * ((t_0 * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.95d0) then
tmp = u * (1.0d0 + (j * ((t_0 * (l * (2.0d0 + (l * (l * 0.3333333333333333d0))))) / u)))
else
tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0)))))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= 0.95) {
tmp = U * (1.0 + (J * ((t_0 * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)));
} else {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.95: tmp = U * (1.0 + (J * ((t_0 * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U))) else: tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.95) tmp = Float64(U * Float64(1.0 + Float64(J * Float64(Float64(t_0 * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))) / U)))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= 0.95) tmp = U * (1.0 + (J * ((t_0 * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U))); else tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.95], N[(U * N[(1.0 + N[(J * N[(N[(t$95$0 * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $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}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.95:\\
\;\;\;\;U \cdot \left(1 + J \cdot \frac{t\_0 \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)}{U}\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 (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.94999999999999996Initial program 86.1%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified83.2%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified90.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr91.5%
if 0.94999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.2%
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-*.f6496.7
Simplified96.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-*.f6496.4
Simplified96.4%
Final simplification94.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.95)
(+ U (* t_0 (* J (* l (+ 2.0 (* l (* l 0.3333333333333333)))))))
(+
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 t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.95) {
tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * 0.3333333333333333))))));
} 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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.95d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0))))))
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 t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= 0.95) {
tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * 0.3333333333333333))))));
} 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): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.95: tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))) 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) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.95) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))))); 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) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= 0.95) tmp = U + (t_0 * (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))); 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_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.95], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $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}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.95:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\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 (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.94999999999999996Initial program 86.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6487.9
Simplified87.9%
if 0.94999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.2%
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-*.f6496.7
Simplified96.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-*.f6496.4
Simplified96.4%
Final simplification92.9%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) 0.95)
(+ U (* l (* (+ 2.0 (* l (* l 0.3333333333333333))) (* J (cos (* K 0.5))))))
(+
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 (cos((K / 2.0)) <= 0.95) {
tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * cos((K * 0.5)))));
} 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 (cos((k / 2.0d0)) <= 0.95d0) then
tmp = u + (l * ((2.0d0 + (l * (l * 0.3333333333333333d0))) * (j * cos((k * 0.5d0)))))
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 (Math.cos((K / 2.0)) <= 0.95) {
tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * Math.cos((K * 0.5)))));
} 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 math.cos((K / 2.0)) <= 0.95: tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * math.cos((K * 0.5))))) 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 (cos(Float64(K / 2.0)) <= 0.95) tmp = Float64(U + Float64(l * Float64(Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))) * Float64(J * cos(Float64(K * 0.5)))))); else tmp = Float64(U + Float64(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 (cos((K / 2.0)) <= 0.95) tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * cos((K * 0.5))))); 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[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.95], N[(U + N[(l * N[(N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(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}\;\cos \left(\frac{K}{2}\right) \leq 0.95:\\
\;\;\;\;U + \ell \cdot \left(\left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + 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 (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.94999999999999996Initial program 86.1%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified83.2%
if 0.94999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.2%
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-*.f6496.7
Simplified96.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-*.f6496.4
Simplified96.4%
Final simplification91.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (* K 0.5)))
(t_1 (* (* l 0.3333333333333333) (* t_0 (* J (* l l))))))
(if (<= l -4.2e+203)
t_1
(if (<= l -1200.0)
(*
J
(*
(+ 1.0 (* K (* K -0.125)))
(*
l
(+
2.0
(*
(* l l)
(+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(if (<= l 550000.0)
(+ U (* l (* t_0 (* 2.0 J))))
(if (<= l 1.05e+128)
(+
U
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
l
(*
l
(+
0.016666666666666666
(* (* l l) 0.0003968253968253968))))))))))
t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K * 0.5));
double t_1 = (l * 0.3333333333333333) * (t_0 * (J * (l * l)));
double tmp;
if (l <= -4.2e+203) {
tmp = t_1;
} else if (l <= -1200.0) {
tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
} else if (l <= 550000.0) {
tmp = U + (l * (t_0 * (2.0 * J)));
} else if (l <= 1.05e+128) {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k * 0.5d0))
t_1 = (l * 0.3333333333333333d0) * (t_0 * (j * (l * l)))
if (l <= (-4.2d+203)) then
tmp = t_1
else if (l <= (-1200.0d0)) then
tmp = j * ((1.0d0 + (k * (k * (-0.125d0)))) * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))
else if (l <= 550000.0d0) then
tmp = u + (l * (t_0 * (2.0d0 * j)))
else if (l <= 1.05d+128) then
tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0)))))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K * 0.5));
double t_1 = (l * 0.3333333333333333) * (t_0 * (J * (l * l)));
double tmp;
if (l <= -4.2e+203) {
tmp = t_1;
} else if (l <= -1200.0) {
tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
} else if (l <= 550000.0) {
tmp = U + (l * (t_0 * (2.0 * J)));
} else if (l <= 1.05e+128) {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K * 0.5)) t_1 = (l * 0.3333333333333333) * (t_0 * (J * (l * l))) tmp = 0 if l <= -4.2e+203: tmp = t_1 elif l <= -1200.0: tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) elif l <= 550000.0: tmp = U + (l * (t_0 * (2.0 * J))) elif l <= 1.05e+128: tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K * 0.5)) t_1 = Float64(Float64(l * 0.3333333333333333) * Float64(t_0 * Float64(J * Float64(l * l)))) tmp = 0.0 if (l <= -4.2e+203) tmp = t_1; elseif (l <= -1200.0) tmp = Float64(J * Float64(Float64(1.0 + Float64(K * Float64(K * -0.125))) * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))); elseif (l <= 550000.0) tmp = Float64(U + Float64(l * Float64(t_0 * Float64(2.0 * J)))); elseif (l <= 1.05e+128) 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)))))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K * 0.5)); t_1 = (l * 0.3333333333333333) * (t_0 * (J * (l * l))); tmp = 0.0; if (l <= -4.2e+203) tmp = t_1; elseif (l <= -1200.0) tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))); elseif (l <= 550000.0) tmp = U + (l * (t_0 * (2.0 * J))); elseif (l <= 1.05e+128) tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))); else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(l * 0.3333333333333333), $MachinePrecision] * N[(t$95$0 * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4.2e+203], t$95$1, If[LessEqual[l, -1200.0], N[(J * N[(N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 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], If[LessEqual[l, 550000.0], N[(U + N[(l * N[(t$95$0 * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.05e+128], 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], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(K \cdot 0.5\right)\\
t_1 := \left(\ell \cdot 0.3333333333333333\right) \cdot \left(t\_0 \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{if}\;\ell \leq -4.2 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -1200:\\
\;\;\;\;J \cdot \left(\left(1 + K \cdot \left(K \cdot -0.125\right)\right) \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{elif}\;\ell \leq 550000:\\
\;\;\;\;U + \ell \cdot \left(t\_0 \cdot \left(2 \cdot J\right)\right)\\
\mathbf{elif}\;\ell \leq 1.05 \cdot 10^{+128}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if l < -4.19999999999999967e203 or 1.05e128 < l Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified98.2%
Taylor expanded in l around inf
associate-*r*N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
Simplified98.2%
if -4.19999999999999967e203 < l < -1200Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7
Simplified66.7%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
Simplified20.6%
Taylor expanded in J around inf
*-lowering-*.f64N/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified73.2%
if -1200 < l < 5.5e5Initial program 79.8%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified98.8%
Taylor expanded in l around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6498.7
Simplified98.7%
if 5.5e5 < l < 1.05e128Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.8
Simplified84.8%
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-*.f6464.6
Simplified64.6%
Final simplification91.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (* K 0.5))))
(if (<= l -1e+204)
(* (* l 0.3333333333333333) (* t_0 (* J (* l l))))
(if (<= l -1150.0)
(*
J
(*
(+ 1.0 (* K (* K -0.125)))
(*
l
(+
2.0
(*
(* l l)
(+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
(if (<= l 1.26e+14)
(+ U (* l (* t_0 (* 2.0 J))))
(* U (* (* t_0 (* J (* l (* l l)))) (/ 0.3333333333333333 U))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K * 0.5));
double tmp;
if (l <= -1e+204) {
tmp = (l * 0.3333333333333333) * (t_0 * (J * (l * l)));
} else if (l <= -1150.0) {
tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
} else if (l <= 1.26e+14) {
tmp = U + (l * (t_0 * (2.0 * J)));
} else {
tmp = U * ((t_0 * (J * (l * (l * l)))) * (0.3333333333333333 / 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) :: tmp
t_0 = cos((k * 0.5d0))
if (l <= (-1d+204)) then
tmp = (l * 0.3333333333333333d0) * (t_0 * (j * (l * l)))
else if (l <= (-1150.0d0)) then
tmp = j * ((1.0d0 + (k * (k * (-0.125d0)))) * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))
else if (l <= 1.26d+14) then
tmp = u + (l * (t_0 * (2.0d0 * j)))
else
tmp = u * ((t_0 * (j * (l * (l * l)))) * (0.3333333333333333d0 / u))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K * 0.5));
double tmp;
if (l <= -1e+204) {
tmp = (l * 0.3333333333333333) * (t_0 * (J * (l * l)));
} else if (l <= -1150.0) {
tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
} else if (l <= 1.26e+14) {
tmp = U + (l * (t_0 * (2.0 * J)));
} else {
tmp = U * ((t_0 * (J * (l * (l * l)))) * (0.3333333333333333 / U));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K * 0.5)) tmp = 0 if l <= -1e+204: tmp = (l * 0.3333333333333333) * (t_0 * (J * (l * l))) elif l <= -1150.0: tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) elif l <= 1.26e+14: tmp = U + (l * (t_0 * (2.0 * J))) else: tmp = U * ((t_0 * (J * (l * (l * l)))) * (0.3333333333333333 / U)) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K * 0.5)) tmp = 0.0 if (l <= -1e+204) tmp = Float64(Float64(l * 0.3333333333333333) * Float64(t_0 * Float64(J * Float64(l * l)))); elseif (l <= -1150.0) tmp = Float64(J * Float64(Float64(1.0 + Float64(K * Float64(K * -0.125))) * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))); elseif (l <= 1.26e+14) tmp = Float64(U + Float64(l * Float64(t_0 * Float64(2.0 * J)))); else tmp = Float64(U * Float64(Float64(t_0 * Float64(J * Float64(l * Float64(l * l)))) * Float64(0.3333333333333333 / U))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K * 0.5)); tmp = 0.0; if (l <= -1e+204) tmp = (l * 0.3333333333333333) * (t_0 * (J * (l * l))); elseif (l <= -1150.0) tmp = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))); elseif (l <= 1.26e+14) tmp = U + (l * (t_0 * (2.0 * J))); else tmp = U * ((t_0 * (J * (l * (l * l)))) * (0.3333333333333333 / U)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1e+204], N[(N[(l * 0.3333333333333333), $MachinePrecision] * N[(t$95$0 * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1150.0], N[(J * N[(N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 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], If[LessEqual[l, 1.26e+14], N[(U + N[(l * N[(t$95$0 * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(N[(t$95$0 * N[(J * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{+204}:\\
\;\;\;\;\left(\ell \cdot 0.3333333333333333\right) \cdot \left(t\_0 \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -1150:\\
\;\;\;\;J \cdot \left(\left(1 + K \cdot \left(K \cdot -0.125\right)\right) \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{elif}\;\ell \leq 1.26 \cdot 10^{+14}:\\
\;\;\;\;U + \ell \cdot \left(t\_0 \cdot \left(2 \cdot J\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(\left(t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right) \cdot \frac{0.3333333333333333}{U}\right)\\
\end{array}
\end{array}
if l < -9.99999999999999989e203Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in l around inf
associate-*r*N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
Simplified100.0%
if -9.99999999999999989e203 < l < -1150Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.7
Simplified66.7%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
Simplified20.6%
Taylor expanded in J around inf
*-lowering-*.f64N/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified73.2%
if -1150 < l < 1.26e14Initial program 80.2%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified96.8%
Taylor expanded in l around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.7
Simplified96.7%
if 1.26e14 < l Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified79.6%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified93.1%
Taylor expanded in l around inf
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.2
Simplified93.2%
Final simplification92.5%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.005)
(+
U
(*
l
(*
(+ 2.0 (* l (* l 0.3333333333333333)))
(+ J (* J (* -0.125 (* K K)))))))
(+
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 (cos((K / 2.0)) <= -0.005) {
tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K))))));
} 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 (cos((k / 2.0d0)) <= (-0.005d0)) then
tmp = u + (l * ((2.0d0 + (l * (l * 0.3333333333333333d0))) * (j + (j * ((-0.125d0) * (k * k))))))
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 (Math.cos((K / 2.0)) <= -0.005) {
tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K))))));
} 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 math.cos((K / 2.0)) <= -0.005: tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K)))))) 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 (cos(Float64(K / 2.0)) <= -0.005) tmp = Float64(U + Float64(l * Float64(Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))) * Float64(J + Float64(J * Float64(-0.125 * Float64(K * K))))))); 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 (cos((K / 2.0)) <= -0.005) tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K)))))); 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[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.005], N[(U + N[(l * N[(N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J + N[(J * N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $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}\;\cos \left(\frac{K}{2}\right) \leq -0.005:\\
\;\;\;\;U + \ell \cdot \left(\left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right) \cdot \left(J + J \cdot \left(-0.125 \cdot \left(K \cdot K\right)\right)\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 (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0050000000000000001Initial 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-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified76.5%
Taylor expanded in K around 0
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.0
Simplified63.0%
if -0.0050000000000000001 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.4%
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-*.f6496.0
Simplified96.0%
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-*.f6492.6
Simplified92.6%
Final simplification86.0%
(FPCore (J l K U)
:precision binary64
(+
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) {
return U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
}
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 + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0))))))))))
end function
public static double code(double J, double l, double K, double U) {
return U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968))))))))))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))))); end
code[J_, l_, K_, U_] := N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)
\end{array}
Initial program 89.2%
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-*.f6494.6
Simplified94.6%
Final simplification94.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))
(t_1
(* J (* (+ 1.0 (* K (* K -0.125))) (* l (+ 2.0 (* (* l l) t_0)))))))
(if (<= l -920.0)
t_1
(if (<= l 2.4e+67) (+ U (* l (* J (+ 2.0 (* l (* l t_0)))))) t_1))))
double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666);
double t_1 = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * t_0))));
double tmp;
if (l <= -920.0) {
tmp = t_1;
} else if (l <= 2.4e+67) {
tmp = U + (l * (J * (2.0 + (l * (l * t_0)))));
} else {
tmp = t_1;
}
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)
t_1 = j * ((1.0d0 + (k * (k * (-0.125d0)))) * (l * (2.0d0 + ((l * l) * t_0))))
if (l <= (-920.0d0)) then
tmp = t_1
else if (l <= 2.4d+67) then
tmp = u + (l * (j * (2.0d0 + (l * (l * t_0)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666);
double t_1 = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * t_0))));
double tmp;
if (l <= -920.0) {
tmp = t_1;
} else if (l <= 2.4e+67) {
tmp = U + (l * (J * (2.0 + (l * (l * t_0)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666) t_1 = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * t_0)))) tmp = 0 if l <= -920.0: tmp = t_1 elif l <= 2.4e+67: tmp = U + (l * (J * (2.0 + (l * (l * t_0))))) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)) t_1 = Float64(J * Float64(Float64(1.0 + Float64(K * Float64(K * -0.125))) * Float64(l * Float64(2.0 + Float64(Float64(l * l) * t_0))))) tmp = 0.0 if (l <= -920.0) tmp = t_1; elseif (l <= 2.4e+67) tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * t_0)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 0.3333333333333333 + ((l * l) * 0.016666666666666666); t_1 = J * ((1.0 + (K * (K * -0.125))) * (l * (2.0 + ((l * l) * t_0)))); tmp = 0.0; if (l <= -920.0) tmp = t_1; elseif (l <= 2.4e+67) tmp = U + (l * (J * (2.0 + (l * (l * t_0))))); else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(J * N[(N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -920.0], t$95$1, If[LessEqual[l, 2.4e+67], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\\
t_1 := J \cdot \left(\left(1 + K \cdot \left(K \cdot -0.125\right)\right) \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot t\_0\right)\right)\right)\\
\mathbf{if}\;\ell \leq -920:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+67}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if l < -920 or 2.40000000000000002e67 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6487.9
Simplified87.9%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
Simplified7.5%
Taylor expanded in J around inf
*-lowering-*.f64N/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified75.7%
if -920 < l < 2.40000000000000002e67Initial program 81.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.0
Simplified95.0%
Taylor expanded in K around 0
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6485.5
Simplified85.5%
Final simplification81.3%
(FPCore (J l K U)
:precision binary64
(if (<= l 1e+118)
(+
U
(*
l
(*
J
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))
(*
U
(*
(/ 0.3333333333333333 U)
(* (+ 1.0 (* K (* K -0.125))) (* J (* l (* l l))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1e+118) {
tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = U * ((0.3333333333333333 / U) * ((1.0 + (K * (K * -0.125))) * (J * (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 <= 1d+118) then
tmp = u + (l * (j * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
else
tmp = u * ((0.3333333333333333d0 / u) * ((1.0d0 + (k * (k * (-0.125d0)))) * (j * (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 <= 1e+118) {
tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else {
tmp = U * ((0.3333333333333333 / U) * ((1.0 + (K * (K * -0.125))) * (J * (l * (l * l)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1e+118: tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) else: tmp = U * ((0.3333333333333333 / U) * ((1.0 + (K * (K * -0.125))) * (J * (l * (l * l))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1e+118) tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))))); else tmp = Float64(U * Float64(Float64(0.3333333333333333 / U) * Float64(Float64(1.0 + Float64(K * Float64(K * -0.125))) * Float64(J * Float64(l * Float64(l * l)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1e+118) tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); else tmp = U * ((0.3333333333333333 / U) * ((1.0 + (K * (K * -0.125))) * (J * (l * (l * l))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1e+118], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(N[(0.3333333333333333 / U), $MachinePrecision] * N[(N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 10^{+118}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(\frac{0.3333333333333333}{U} \cdot \left(\left(1 + K \cdot \left(K \cdot -0.125\right)\right) \cdot \left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < 9.99999999999999967e117Initial program 87.3%
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-*.f6490.6
Simplified90.6%
Taylor expanded in K around 0
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.7
Simplified77.7%
if 9.99999999999999967e117 < l Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified90.1%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified100.0%
Taylor expanded in l around inf
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64100.0
Simplified100.0%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6484.2
Simplified84.2%
Final simplification78.7%
(FPCore (J l K U)
:precision binary64
(if (<= l -1300.0)
(* U (* (* J (* l (* l l))) (/ 0.3333333333333333 U)))
(if (<= l 4e+15)
(+ U (* J (* 2.0 l)))
(* J (* l (* (* l l) 0.3333333333333333))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1300.0) {
tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U));
} else if (l <= 4e+15) {
tmp = U + (J * (2.0 * l));
} else {
tmp = J * (l * ((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 <= (-1300.0d0)) then
tmp = u * ((j * (l * (l * l))) * (0.3333333333333333d0 / u))
else if (l <= 4d+15) then
tmp = u + (j * (2.0d0 * l))
else
tmp = j * (l * ((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 <= -1300.0) {
tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U));
} else if (l <= 4e+15) {
tmp = U + (J * (2.0 * l));
} else {
tmp = J * (l * ((l * l) * 0.3333333333333333));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1300.0: tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U)) elif l <= 4e+15: tmp = U + (J * (2.0 * l)) else: tmp = J * (l * ((l * l) * 0.3333333333333333)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1300.0) tmp = Float64(U * Float64(Float64(J * Float64(l * Float64(l * l))) * Float64(0.3333333333333333 / U))); elseif (l <= 4e+15) tmp = Float64(U + Float64(J * Float64(2.0 * l))); else tmp = Float64(J * Float64(l * Float64(Float64(l * l) * 0.3333333333333333))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -1300.0) tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U)); elseif (l <= 4e+15) tmp = U + (J * (2.0 * l)); else tmp = J * (l * ((l * l) * 0.3333333333333333)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1300.0], N[(U * N[(N[(J * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4e+15], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1300:\\
\;\;\;\;U \cdot \left(\left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \frac{0.3333333333333333}{U}\right)\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{+15}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
\end{array}
\end{array}
if l < -1300Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified61.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified74.0%
Taylor expanded in l around inf
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6474.1
Simplified74.1%
Taylor expanded in K around 0
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.9
Simplified56.9%
if -1300 < l < 4e15Initial program 80.3%
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.9
Applied egg-rr99.9%
Taylor expanded in l around 0
*-lowering-*.f6496.0
Simplified96.0%
Taylor expanded in K around 0
*-commutativeN/A
*-lowering-*.f6486.2
Simplified86.2%
if 4e15 < l Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified79.6%
Taylor expanded in K around 0
Simplified56.1%
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
associate-*r*N/A
unpow2N/A
unpow3N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.8
Simplified62.8%
Final simplification74.3%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* l (* (* l l) 0.3333333333333333))))) (if (<= l -2.3e+40) t_0 (if (<= l 1.45e+14) (+ 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 <= -2.3e+40) {
tmp = t_0;
} else if (l <= 1.45e+14) {
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 <= (-2.3d+40)) then
tmp = t_0
else if (l <= 1.45d+14) 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 <= -2.3e+40) {
tmp = t_0;
} else if (l <= 1.45e+14) {
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 <= -2.3e+40: tmp = t_0 elif l <= 1.45e+14: 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 <= -2.3e+40) tmp = t_0; elseif (l <= 1.45e+14) 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 <= -2.3e+40) tmp = t_0; elseif (l <= 1.45e+14) 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, -2.3e+40], t$95$0, If[LessEqual[l, 1.45e+14], 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 -2.3 \cdot 10^{+40}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{+14}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -2.29999999999999994e40 or 1.45e14 < l Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified75.6%
Taylor expanded in K around 0
Simplified56.2%
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
associate-*r*N/A
unpow2N/A
unpow3N/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.6
Simplified61.6%
if -2.29999999999999994e40 < l < 1.45e14Initial 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.9
Applied egg-rr99.9%
Taylor expanded in l around 0
*-lowering-*.f6490.6
Simplified90.6%
Taylor expanded in K around 0
*-commutativeN/A
*-lowering-*.f6481.4
Simplified81.4%
Final simplification73.3%
(FPCore (J l K U)
:precision binary64
(+
U
(*
l
(*
J
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))))
double code(double J, double l, double K, double U) {
return U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (l * (j * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
end function
public static double code(double J, double l, double K, double U) {
return U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
}
def code(J, l, K, U): return U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))
function code(J, l, K, U) return Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))))) end
function tmp = code(J, l, K, U) tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); end
code[J_, l_, K_, U_] := N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)
\end{array}
Initial program 89.2%
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-*.f6492.0
Simplified92.0%
Taylor expanded in K around 0
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.0
Simplified76.0%
Final simplification76.0%
(FPCore (J l K U) :precision binary64 (if (<= l -1850.0) (* U (* (* J (* l (* l l))) (/ 0.3333333333333333 U))) (+ U (* l (* J (+ 2.0 (* l (* l 0.3333333333333333))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1850.0) {
tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U));
} else {
tmp = U + (l * (J * (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 <= (-1850.0d0)) then
tmp = u * ((j * (l * (l * l))) * (0.3333333333333333d0 / u))
else
tmp = u + (l * (j * (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 <= -1850.0) {
tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U));
} else {
tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1850.0: tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U)) else: tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1850.0) tmp = Float64(U * Float64(Float64(J * Float64(l * Float64(l * l))) * Float64(0.3333333333333333 / U))); else tmp = Float64(U + Float64(l * Float64(J * 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 (l <= -1850.0) tmp = U * ((J * (l * (l * l))) * (0.3333333333333333 / U)); else tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1850.0], N[(U * N[(N[(J * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1850:\\
\;\;\;\;U \cdot \left(\left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \frac{0.3333333333333333}{U}\right)\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if l < -1850Initial program 100.0%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified61.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified74.0%
Taylor expanded in l around inf
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6474.1
Simplified74.1%
Taylor expanded in K around 0
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.9
Simplified56.9%
if -1850 < l Initial program 85.9%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified91.4%
Taylor expanded in K around 0
Simplified77.7%
Final simplification72.9%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* 2.0 l)))) (if (<= l -3.6e-23) t_0 (if (<= l 1.4e+14) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (2.0 * l);
double tmp;
if (l <= -3.6e-23) {
tmp = t_0;
} else if (l <= 1.4e+14) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = j * (2.0d0 * l)
if (l <= (-3.6d-23)) then
tmp = t_0
else if (l <= 1.4d+14) then
tmp = u
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * (2.0 * l);
double tmp;
if (l <= -3.6e-23) {
tmp = t_0;
} else if (l <= 1.4e+14) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (2.0 * l) tmp = 0 if l <= -3.6e-23: tmp = t_0 elif l <= 1.4e+14: tmp = U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(2.0 * l)) tmp = 0.0 if (l <= -3.6e-23) tmp = t_0; elseif (l <= 1.4e+14) tmp = U; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (2.0 * l); tmp = 0.0; if (l <= -3.6e-23) tmp = t_0; elseif (l <= 1.4e+14) tmp = U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.6e-23], t$95$0, If[LessEqual[l, 1.4e+14], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(2 \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -3.6 \cdot 10^{-23}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+14}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -3.5999999999999998e-23 or 1.4e14 < l Initial program 98.5%
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%
Taylor expanded in l around 0
*-lowering-*.f6429.7
Simplified29.7%
Taylor expanded in K around 0
*-commutativeN/A
*-lowering-*.f6424.8
Simplified24.8%
Taylor expanded in l around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6422.3
Simplified22.3%
if -3.5999999999999998e-23 < l < 1.4e14Initial program 80.5%
Taylor expanded in J around 0
Simplified77.5%
Final simplification50.9%
(FPCore (J l K U) :precision binary64 (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
}
def code(J, l, K, U): return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(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 89.2%
Taylor expanded in l around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
Simplified84.5%
Taylor expanded in K around 0
Simplified71.1%
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.3
Applied egg-rr73.3%
Final simplification73.3%
(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 89.2%
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%
Taylor expanded in l around 0
*-lowering-*.f6464.7
Simplified64.7%
Taylor expanded in K around 0
*-commutativeN/A
*-lowering-*.f6457.0
Simplified57.0%
Final simplification57.0%
(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 89.2%
Taylor expanded in J around 0
Simplified42.4%
herbie shell --seed 2024191
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))