
(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 16 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
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (<= t_1 -0.1)
(+ (* (* t_1 J) t_0) U)
(+
U
(*
t_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 t_0 = cos((K / 2.0));
double t_1 = exp(l) - exp(-l);
double tmp;
if (t_1 <= -0.1) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(l) - exp(-l)
if (t_1 <= (-0.1d0)) then
tmp = ((t_1 * j) * t_0) + u
else
tmp = u + (t_0 * (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 t_1 = Math.exp(l) - Math.exp(-l);
double tmp;
if (t_1 <= -0.1) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_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): t_0 = math.cos((K / 2.0)) t_1 = math.exp(l) - math.exp(-l) tmp = 0 if t_1 <= -0.1: tmp = ((t_1 * J) * t_0) + U else: tmp = U + (t_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) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if (t_1 <= -0.1) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(l) - exp(-l); tmp = 0.0; if (t_1 <= -0.1) tmp = ((t_1 * J) * t_0) + U; else tmp = U + (t_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_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -0.1], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_1 \leq -0.1:\\
\;\;\;\;\left(t\_1 \cdot J\right) \cdot t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -0.10000000000000001Initial program 100.0%
if -0.10000000000000001 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 78.8%
Taylor expanded in l around 0 98.1%
*-commutative98.1%
Simplified98.1%
unpow298.1%
Applied egg-rr98.1%
unpow298.1%
Applied egg-rr98.1%
unpow298.1%
Applied egg-rr98.1%
Final simplification98.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (exp (- l))))
(if (<= (- (exp l) t_1) (- INFINITY))
(+ U (* t_0 (* J (- 0.3333333333333333 t_1))))
(+
U
(*
t_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 t_0 = cos((K / 2.0));
double t_1 = exp(-l);
double tmp;
if ((exp(l) - t_1) <= -((double) INFINITY)) {
tmp = U + (t_0 * (J * (0.3333333333333333 - t_1)));
} else {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))));
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(-l);
double tmp;
if ((Math.exp(l) - t_1) <= -Double.POSITIVE_INFINITY) {
tmp = U + (t_0 * (J * (0.3333333333333333 - t_1)));
} else {
tmp = U + (t_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): t_0 = math.cos((K / 2.0)) t_1 = math.exp(-l) tmp = 0 if (math.exp(l) - t_1) <= -math.inf: tmp = U + (t_0 * (J * (0.3333333333333333 - t_1))) else: tmp = U + (t_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) t_0 = cos(Float64(K / 2.0)) t_1 = exp(Float64(-l)) tmp = 0.0 if (Float64(exp(l) - t_1) <= Float64(-Inf)) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(0.3333333333333333 - t_1)))); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(-l); tmp = 0.0; if ((exp(l) - t_1) <= -Inf) tmp = U + (t_0 * (J * (0.3333333333333333 - t_1))); else tmp = U + (t_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_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-l)], $MachinePrecision]}, If[LessEqual[N[(N[Exp[l], $MachinePrecision] - t$95$1), $MachinePrecision], (-Infinity)], N[(U + N[(t$95$0 * N[(J * N[(0.3333333333333333 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{-\ell}\\
\mathbf{if}\;e^{\ell} - t\_1 \leq -\infty:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(0.3333333333333333 - t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0Initial program 100.0%
Applied egg-rr100.0%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 79.1%
Taylor expanded in l around 0 97.8%
*-commutative97.8%
Simplified97.8%
unpow297.8%
Applied egg-rr97.8%
unpow297.8%
Applied egg-rr97.8%
unpow297.8%
Applied egg-rr97.8%
Final simplification98.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= l -1.9e+40)
(+ U (* t_0 (* 0.0003968253968253968 (* J (pow l 7.0)))))
(if (<= l -1.1e+21)
(+ U (* J (- 0.3333333333333333 (exp (- l)))))
(+
U
(*
t_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 t_0 = cos((K / 2.0));
double tmp;
if (l <= -1.9e+40) {
tmp = U + (t_0 * (0.0003968253968253968 * (J * pow(l, 7.0))));
} else if (l <= -1.1e+21) {
tmp = U + (J * (0.3333333333333333 - exp(-l)));
} else {
tmp = U + (t_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) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (l <= (-1.9d+40)) then
tmp = u + (t_0 * (0.0003968253968253968d0 * (j * (l ** 7.0d0))))
else if (l <= (-1.1d+21)) then
tmp = u + (j * (0.3333333333333333d0 - exp(-l)))
else
tmp = u + (t_0 * (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 (l <= -1.9e+40) {
tmp = U + (t_0 * (0.0003968253968253968 * (J * Math.pow(l, 7.0))));
} else if (l <= -1.1e+21) {
tmp = U + (J * (0.3333333333333333 - Math.exp(-l)));
} else {
tmp = U + (t_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): t_0 = math.cos((K / 2.0)) tmp = 0 if l <= -1.9e+40: tmp = U + (t_0 * (0.0003968253968253968 * (J * math.pow(l, 7.0)))) elif l <= -1.1e+21: tmp = U + (J * (0.3333333333333333 - math.exp(-l))) else: tmp = U + (t_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) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (l <= -1.9e+40) tmp = Float64(U + Float64(t_0 * Float64(0.0003968253968253968 * Float64(J * (l ^ 7.0))))); elseif (l <= -1.1e+21) tmp = Float64(U + Float64(J * Float64(0.3333333333333333 - exp(Float64(-l))))); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (l <= -1.9e+40) tmp = U + (t_0 * (0.0003968253968253968 * (J * (l ^ 7.0)))); elseif (l <= -1.1e+21) tmp = U + (J * (0.3333333333333333 - exp(-l))); else tmp = U + (t_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_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.9e+40], N[(U + N[(t$95$0 * N[(0.0003968253968253968 * N[(J * N[Power[l, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.1e+21], N[(U + N[(J * N[(0.3333333333333333 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;\ell \leq -1.9 \cdot 10^{+40}:\\
\;\;\;\;U + t\_0 \cdot \left(0.0003968253968253968 \cdot \left(J \cdot {\ell}^{7}\right)\right)\\
\mathbf{elif}\;\ell \leq -1.1 \cdot 10^{+21}:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 - e^{-\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < -1.90000000000000002e40Initial program 100.0%
Taylor expanded in l around 0 98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in l around inf 100.0%
if -1.90000000000000002e40 < l < -1.1e21Initial program 100.0%
Taylor expanded in K around 0 90.0%
Applied egg-rr90.0%
if -1.1e21 < l Initial program 79.3%
Taylor expanded in l around 0 97.8%
*-commutative97.8%
Simplified97.8%
unpow297.8%
Applied egg-rr97.8%
unpow297.8%
Applied egg-rr97.8%
unpow297.8%
Applied egg-rr97.8%
Final simplification98.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(Float64(l * 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[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $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 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)
\end{array}
Initial program 84.5%
Taylor expanded in l around 0 94.6%
*-commutative94.6%
Simplified94.6%
unpow294.6%
Applied egg-rr94.6%
unpow294.6%
Applied egg-rr94.6%
unpow294.6%
Applied egg-rr94.6%
Final simplification94.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* l (cos (* K 0.5))))))
(if (<= l -5.2e+123)
t_0
(if (<= l -2.65e+29)
(* U (- U -4.0))
(if (<= l 15200.0)
(fma l (* J 2.0) U)
(if (<= l 7.5e+87) (* 4.0 (pow U 2.0)) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = J * (l * cos((K * 0.5)));
double tmp;
if (l <= -5.2e+123) {
tmp = t_0;
} else if (l <= -2.65e+29) {
tmp = U * (U - -4.0);
} else if (l <= 15200.0) {
tmp = fma(l, (J * 2.0), U);
} else if (l <= 7.5e+87) {
tmp = 4.0 * pow(U, 2.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(J * Float64(l * cos(Float64(K * 0.5)))) tmp = 0.0 if (l <= -5.2e+123) tmp = t_0; elseif (l <= -2.65e+29) tmp = Float64(U * Float64(U - -4.0)); elseif (l <= 15200.0) tmp = fma(l, Float64(J * 2.0), U); elseif (l <= 7.5e+87) tmp = Float64(4.0 * (U ^ 2.0)); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5.2e+123], t$95$0, If[LessEqual[l, -2.65e+29], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 15200.0], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 7.5e+87], N[(4.0 * N[Power[U, 2.0], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{+123}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -2.65 \cdot 10^{+29}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 15200:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 7.5 \cdot 10^{+87}:\\
\;\;\;\;4 \cdot {U}^{2}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -5.19999999999999971e123 or 7.50000000000000014e87 < l Initial program 100.0%
Taylor expanded in l around 0 37.5%
Taylor expanded in J around inf 37.7%
Simplified37.7%
if -5.19999999999999971e123 < l < -2.65e29Initial program 100.0%
Applied egg-rr31.2%
if -2.65e29 < l < 15200Initial program 71.0%
Taylor expanded in K around 0 68.5%
Taylor expanded in l around 0 76.4%
associate-*r*76.4%
+-commutative76.4%
*-commutative76.4%
fma-define76.4%
Simplified76.4%
if 15200 < l < 7.50000000000000014e87Initial program 100.0%
Applied egg-rr2.6%
Applied egg-rr2.3%
flip-+0.0%
difference-of-squares0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+36.7%
count-236.7%
count-236.7%
swap-sqr36.7%
metadata-eval36.7%
pow236.7%
Applied egg-rr36.7%
Final simplification57.6%
(FPCore (J l K U)
:precision binary64
(if (<= l -4.4e+123)
(* J (* l (cos (* K 0.5))))
(if (<= l -7.5e+28)
(* U (- U -4.0))
(if (<= l 0.056) (fma l (* J 2.0) U) (+ U (* J (+ (exp l) -1.0)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.4e+123) {
tmp = J * (l * cos((K * 0.5)));
} else if (l <= -7.5e+28) {
tmp = U * (U - -4.0);
} else if (l <= 0.056) {
tmp = fma(l, (J * 2.0), U);
} else {
tmp = U + (J * (exp(l) + -1.0));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -4.4e+123) tmp = Float64(J * Float64(l * cos(Float64(K * 0.5)))); elseif (l <= -7.5e+28) tmp = Float64(U * Float64(U - -4.0)); elseif (l <= 0.056) tmp = fma(l, Float64(J * 2.0), U); else tmp = Float64(U + Float64(J * Float64(exp(l) + -1.0))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.4e+123], N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -7.5e+28], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.056], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.4 \cdot 10^{+123}:\\
\;\;\;\;J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{elif}\;\ell \leq -7.5 \cdot 10^{+28}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 0.056:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} + -1\right)\\
\end{array}
\end{array}
if l < -4.39999999999999984e123Initial program 100.0%
Taylor expanded in l around 0 40.0%
Taylor expanded in J around inf 40.5%
Simplified40.5%
if -4.39999999999999984e123 < l < -7.4999999999999998e28Initial program 100.0%
Applied egg-rr31.2%
if -7.4999999999999998e28 < l < 0.0560000000000000012Initial program 70.4%
Taylor expanded in K around 0 67.8%
Taylor expanded in l around 0 77.2%
associate-*r*77.2%
+-commutative77.2%
*-commutative77.2%
fma-define77.2%
Simplified77.2%
if 0.0560000000000000012 < l Initial program 100.0%
Taylor expanded in K around 0 71.4%
Taylor expanded in l around 0 70.2%
Final simplification66.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -0.95)
(+ U (* J (- 1.0 (exp (- l)))))
(if (<= l 0.056)
(+ U (* 2.0 (* J (* l (cos (* K 0.5))))))
(+ U (* J (+ (exp l) -1.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -0.95) {
tmp = U + (J * (1.0 - exp(-l)));
} else if (l <= 0.056) {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
} else {
tmp = U + (J * (exp(l) + -1.0));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-0.95d0)) then
tmp = u + (j * (1.0d0 - exp(-l)))
else if (l <= 0.056d0) then
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
else
tmp = u + (j * (exp(l) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -0.95) {
tmp = U + (J * (1.0 - Math.exp(-l)));
} else if (l <= 0.056) {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
} else {
tmp = U + (J * (Math.exp(l) + -1.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -0.95: tmp = U + (J * (1.0 - math.exp(-l))) elif l <= 0.056: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) else: tmp = U + (J * (math.exp(l) + -1.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -0.95) tmp = Float64(U + Float64(J * Float64(1.0 - exp(Float64(-l))))); elseif (l <= 0.056) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); else tmp = Float64(U + Float64(J * Float64(exp(l) + -1.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -0.95) tmp = U + (J * (1.0 - exp(-l))); elseif (l <= 0.056) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); else tmp = U + (J * (exp(l) + -1.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -0.95], N[(U + N[(J * N[(1.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.056], N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.95:\\
\;\;\;\;U + J \cdot \left(1 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 0.056:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} + -1\right)\\
\end{array}
\end{array}
if l < -0.94999999999999996Initial program 100.0%
Taylor expanded in K around 0 83.9%
Taylor expanded in l around 0 83.9%
if -0.94999999999999996 < l < 0.0560000000000000012Initial program 68.5%
Taylor expanded in l around 0 98.5%
if 0.0560000000000000012 < l Initial program 100.0%
Taylor expanded in K around 0 71.4%
Taylor expanded in l around 0 70.2%
Final simplification87.7%
(FPCore (J l K U) :precision binary64 (if (<= l -0.95) (+ U (* J (- 1.0 (exp (- l))))) (if (<= l 0.056) (fma l (* J 2.0) U) (+ U (* J (+ (exp l) -1.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -0.95) {
tmp = U + (J * (1.0 - exp(-l)));
} else if (l <= 0.056) {
tmp = fma(l, (J * 2.0), U);
} else {
tmp = U + (J * (exp(l) + -1.0));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -0.95) tmp = Float64(U + Float64(J * Float64(1.0 - exp(Float64(-l))))); elseif (l <= 0.056) tmp = fma(l, Float64(J * 2.0), U); else tmp = Float64(U + Float64(J * Float64(exp(l) + -1.0))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -0.95], N[(U + N[(J * N[(1.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.056], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.95:\\
\;\;\;\;U + J \cdot \left(1 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 0.056:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} + -1\right)\\
\end{array}
\end{array}
if l < -0.94999999999999996Initial program 100.0%
Taylor expanded in K around 0 83.9%
Taylor expanded in l around 0 83.9%
if -0.94999999999999996 < l < 0.0560000000000000012Initial program 68.5%
Taylor expanded in K around 0 67.2%
Taylor expanded in l around 0 81.6%
associate-*r*81.6%
+-commutative81.6%
*-commutative81.6%
fma-define81.6%
Simplified81.6%
if 0.0560000000000000012 < l Initial program 100.0%
Taylor expanded in K around 0 71.4%
Taylor expanded in l around 0 70.2%
Final simplification79.4%
(FPCore (J l K U) :precision binary64 (if (<= l -0.98) (+ U (* J (- 0.3333333333333333 (exp (- l))))) (if (<= l 0.056) (fma l (* J 2.0) U) (+ U (* J (+ (exp l) -1.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -0.98) {
tmp = U + (J * (0.3333333333333333 - exp(-l)));
} else if (l <= 0.056) {
tmp = fma(l, (J * 2.0), U);
} else {
tmp = U + (J * (exp(l) + -1.0));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -0.98) tmp = Float64(U + Float64(J * Float64(0.3333333333333333 - exp(Float64(-l))))); elseif (l <= 0.056) tmp = fma(l, Float64(J * 2.0), U); else tmp = Float64(U + Float64(J * Float64(exp(l) + -1.0))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -0.98], N[(U + N[(J * N[(0.3333333333333333 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.056], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.98:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 0.056:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} + -1\right)\\
\end{array}
\end{array}
if l < -0.97999999999999998Initial program 100.0%
Taylor expanded in K around 0 84.8%
Applied egg-rr84.8%
if -0.97999999999999998 < l < 0.0560000000000000012Initial program 68.7%
Taylor expanded in K around 0 66.8%
Taylor expanded in l around 0 81.1%
associate-*r*81.1%
+-commutative81.1%
*-commutative81.1%
fma-define81.2%
Simplified81.2%
if 0.0560000000000000012 < l Initial program 100.0%
Taylor expanded in K around 0 71.4%
Taylor expanded in l around 0 70.2%
Final simplification79.4%
(FPCore (J l K U) :precision binary64 (fma l (* J 2.0) U))
double code(double J, double l, double K, double U) {
return fma(l, (J * 2.0), U);
}
function code(J, l, K, U) return fma(l, Float64(J * 2.0), U) end
code[J_, l_, K_, U_] := N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\ell, J \cdot 2, U\right)
\end{array}
Initial program 84.5%
Taylor expanded in K around 0 72.6%
Taylor expanded in l around 0 50.1%
associate-*r*50.1%
+-commutative50.1%
*-commutative50.1%
fma-define50.1%
Simplified50.1%
Final simplification50.1%
(FPCore (J l K U) :precision binary64 (if (or (<= l -0.95) (not (<= l 2.1))) (* U (- U -4.0)) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.95) || !(l <= 2.1)) {
tmp = U * (U - -4.0);
} else {
tmp = U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-0.95d0)) .or. (.not. (l <= 2.1d0))) then
tmp = u * (u - (-4.0d0))
else
tmp = u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.95) || !(l <= 2.1)) {
tmp = U * (U - -4.0);
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -0.95) or not (l <= 2.1): tmp = U * (U - -4.0) else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -0.95) || !(l <= 2.1)) tmp = Float64(U * Float64(U - -4.0)); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -0.95) || ~((l <= 2.1))) tmp = U * (U - -4.0); else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -0.95], N[Not[LessEqual[l, 2.1]], $MachinePrecision]], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.95 \lor \neg \left(\ell \leq 2.1\right):\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -0.94999999999999996 or 2.10000000000000009 < l Initial program 100.0%
Applied egg-rr17.9%
if -0.94999999999999996 < l < 2.10000000000000009Initial program 68.7%
Taylor expanded in J around 0 66.2%
Final simplification41.9%
(FPCore (J l K U) :precision binary64 (if (or (<= l -0.95) (not (<= l 2.1))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.95) || !(l <= 2.1)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-0.95d0)) .or. (.not. (l <= 2.1d0))) then
tmp = u * u
else
tmp = u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.95) || !(l <= 2.1)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -0.95) or not (l <= 2.1): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -0.95) || !(l <= 2.1)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -0.95) || ~((l <= 2.1))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -0.95], N[Not[LessEqual[l, 2.1]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.95 \lor \neg \left(\ell \leq 2.1\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -0.94999999999999996 or 2.10000000000000009 < l Initial program 100.0%
Applied egg-rr17.8%
if -0.94999999999999996 < l < 2.10000000000000009Initial program 68.7%
Taylor expanded in J around 0 66.2%
Final simplification41.8%
(FPCore (J l K U) :precision binary64 (+ U (* J (* l 2.0))))
double code(double J, double l, double K, double U) {
return U + (J * (l * 2.0));
}
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))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (l * 2.0));
}
def code(J, l, K, U): return U + (J * (l * 2.0))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(l * 2.0))) end
function tmp = code(J, l, K, U) tmp = U + (J * (l * 2.0)); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot 2\right)
\end{array}
Initial program 84.5%
Taylor expanded in K around 0 72.6%
Taylor expanded in l around 0 50.1%
*-commutative50.1%
associate-*l*50.1%
Simplified50.1%
Final simplification50.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 84.5%
Taylor expanded in J around 0 34.0%
(FPCore (J l K U) :precision binary64 16.0)
double code(double J, double l, double K, double U) {
return 16.0;
}
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 = 16.0d0
end function
public static double code(double J, double l, double K, double U) {
return 16.0;
}
def code(J, l, K, U): return 16.0
function code(J, l, K, U) return 16.0 end
function tmp = code(J, l, K, U) tmp = 16.0; end
code[J_, l_, K_, U_] := 16.0
\begin{array}{l}
\\
16
\end{array}
Initial program 84.5%
Applied egg-rr23.4%
fma-undefine23.4%
+-commutative23.4%
metadata-eval23.4%
Simplified23.4%
Taylor expanded in U around 0 2.8%
(FPCore (J l K U) :precision binary64 -4.0)
double code(double J, double l, double K, double U) {
return -4.0;
}
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 = -4.0d0
end function
public static double code(double J, double l, double K, double U) {
return -4.0;
}
def code(J, l, K, U): return -4.0
function code(J, l, K, U) return -4.0 end
function tmp = code(J, l, K, U) tmp = -4.0; end
code[J_, l_, K_, U_] := -4.0
\begin{array}{l}
\\
-4
\end{array}
Initial program 84.5%
Applied egg-rr2.7%
fma-undefine2.7%
*-commutative2.7%
fma-define2.7%
Simplified2.7%
Taylor expanded in U around 0 2.7%
herbie shell --seed 2024130
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))