
(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 15 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 (or (<= t_1 -20000.0) (not (<= t_1 5e-11)))
(+ (* (* t_1 J) t_0) U)
(fma J (* t_0 (* l 2.0)) U))))
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 <= -20000.0) || !(t_1 <= 5e-11)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = fma(J, (t_0 * (l * 2.0)), U);
}
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 <= -20000.0) || !(t_1 <= 5e-11)) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = fma(J, Float64(t_0 * Float64(l * 2.0)), U); end return 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[Or[LessEqual[t$95$1, -20000.0], N[Not[LessEqual[t$95$1, 5e-11]], $MachinePrecision]], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(t$95$0 * N[(l * 2.0), $MachinePrecision]), $MachinePrecision] + U), $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 -20000 \lor \neg \left(t\_1 \leq 5 \cdot 10^{-11}\right):\\
\;\;\;\;\left(t\_1 \cdot J\right) \cdot t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, t\_0 \cdot \left(\ell \cdot 2\right), U\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -2e4 or 5.00000000000000018e-11 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -2e4 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.00000000000000018e-11Initial program 66.6%
associate-*l*66.6%
fma-define66.6%
Simplified66.6%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.53)
(+ U (* J (* l (+ 2.0 (* (pow K 2.0) -0.25)))))
(if (<= t_0 0.0041)
(+ U (* t_0 (* l (* J 2.0))))
(+ U (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.53) {
tmp = U + (J * (l * (2.0 + (pow(K, 2.0) * -0.25))));
} else if (t_0 <= 0.0041) {
tmp = U + (t_0 * (l * (J * 2.0)));
} else {
tmp = U + (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.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 = cos((k / 2.0d0))
if (t_0 <= (-0.53d0)) then
tmp = u + (j * (l * (2.0d0 + ((k ** 2.0d0) * (-0.25d0)))))
else if (t_0 <= 0.0041d0) then
tmp = u + (t_0 * (l * (j * 2.0d0)))
else
tmp = u + (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0)))))
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.53) {
tmp = U + (J * (l * (2.0 + (Math.pow(K, 2.0) * -0.25))));
} else if (t_0 <= 0.0041) {
tmp = U + (t_0 * (l * (J * 2.0)));
} else {
tmp = U + (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0)))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.53: tmp = U + (J * (l * (2.0 + (math.pow(K, 2.0) * -0.25)))) elif t_0 <= 0.0041: tmp = U + (t_0 * (l * (J * 2.0))) else: tmp = U + (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.53) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64((K ^ 2.0) * -0.25))))); elseif (t_0 <= 0.0041) tmp = Float64(U + Float64(t_0 * Float64(l * Float64(J * 2.0)))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0)))))); 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.53) tmp = U + (J * (l * (2.0 + ((K ^ 2.0) * -0.25)))); elseif (t_0 <= 0.0041) tmp = U + (t_0 * (l * (J * 2.0))); else tmp = U + (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0))))); 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.53], N[(U + N[(J * N[(l * N[(2.0 + N[(N[Power[K, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0041], N[(U + N[(t$95$0 * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $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.53:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + {K}^{2} \cdot -0.25\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0.0041:\\
\;\;\;\;U + t\_0 \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.53000000000000003Initial program 86.1%
Taylor expanded in l around 0 58.3%
*-commutative58.3%
associate-*l*58.3%
*-commutative58.3%
associate-*l*58.3%
Simplified58.3%
Taylor expanded in K around 0 74.2%
associate-*r*74.2%
distribute-rgt-out74.2%
*-commutative74.2%
Simplified74.2%
if -0.53000000000000003 < (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.00410000000000000035Initial program 77.1%
Taylor expanded in l around 0 67.7%
associate-*r*67.7%
*-commutative67.7%
Simplified67.7%
if 0.00410000000000000035 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.9%
Taylor expanded in l around 0 87.6%
Taylor expanded in K around 0 82.9%
Final simplification79.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ (* (- (exp l) (exp (- l))) J) U))
(t_1 (cos (/ K 2.0)))
(t_2 (+ U (* t_1 (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))))
(if (<= l -9e+87)
t_2
(if (<= l -6.6)
t_0
(if (<= l 7.0)
(fma J (* t_1 (* l 2.0)) U)
(if (<= l 2.7e+100) t_0 t_2))))))
double code(double J, double l, double K, double U) {
double t_0 = ((exp(l) - exp(-l)) * J) + U;
double t_1 = cos((K / 2.0));
double t_2 = U + (t_1 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
double tmp;
if (l <= -9e+87) {
tmp = t_2;
} else if (l <= -6.6) {
tmp = t_0;
} else if (l <= 7.0) {
tmp = fma(J, (t_1 * (l * 2.0)), U);
} else if (l <= 2.7e+100) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) t_1 = cos(Float64(K / 2.0)) t_2 = Float64(U + Float64(t_1 * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))) tmp = 0.0 if (l <= -9e+87) tmp = t_2; elseif (l <= -6.6) tmp = t_0; elseif (l <= 7.0) tmp = fma(J, Float64(t_1 * Float64(l * 2.0)), U); elseif (l <= 2.7e+100) tmp = t_0; else tmp = t_2; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(U + N[(t$95$1 * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -9e+87], t$95$2, If[LessEqual[l, -6.6], t$95$0, If[LessEqual[l, 7.0], N[(J * N[(t$95$1 * N[(l * 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 2.7e+100], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
t_1 := \cos \left(\frac{K}{2}\right)\\
t_2 := U + t\_1 \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
\mathbf{if}\;\ell \leq -9 \cdot 10^{+87}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\ell \leq -6.6:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 7:\\
\;\;\;\;\mathsf{fma}\left(J, t\_1 \cdot \left(\ell \cdot 2\right), U\right)\\
\mathbf{elif}\;\ell \leq 2.7 \cdot 10^{+100}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if l < -9.0000000000000005e87 or 2.69999999999999998e100 < l Initial program 100.0%
Taylor expanded in l around 0 99.0%
unpow299.0%
Applied egg-rr99.0%
if -9.0000000000000005e87 < l < -6.5999999999999996 or 7 < l < 2.69999999999999998e100Initial program 100.0%
Taylor expanded in K around 0 77.7%
if -6.5999999999999996 < l < 7Initial program 67.2%
associate-*l*67.2%
fma-define67.2%
Simplified67.2%
Taylor expanded in l around 0 99.3%
*-commutative99.3%
Simplified99.3%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+
U
(*
(cos (/ K 2.0))
(* J (* l (+ 2.0 (* 0.3333333333333333 (* l l))))))))
(t_1 (+ (* (- (exp l) (exp (- l))) J) U)))
(if (<= l -8.5e+87)
t_0
(if (<= l -6.6)
t_1
(if (<= l 0.55)
(+ U (* J (* (* l 2.0) (cos (* K 0.5)))))
(if (<= l 1.55e+100) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
double t_1 = ((exp(l) - exp(-l)) * J) + U;
double tmp;
if (l <= -8.5e+87) {
tmp = t_0;
} else if (l <= -6.6) {
tmp = t_1;
} else if (l <= 0.55) {
tmp = U + (J * ((l * 2.0) * cos((K * 0.5))));
} else if (l <= 1.55e+100) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
t_1 = ((exp(l) - exp(-l)) * j) + u
if (l <= (-8.5d+87)) then
tmp = t_0
else if (l <= (-6.6d0)) then
tmp = t_1
else if (l <= 0.55d0) then
tmp = u + (j * ((l * 2.0d0) * cos((k * 0.5d0))))
else if (l <= 1.55d+100) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
double t_1 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double tmp;
if (l <= -8.5e+87) {
tmp = t_0;
} else if (l <= -6.6) {
tmp = t_1;
} else if (l <= 0.55) {
tmp = U + (J * ((l * 2.0) * Math.cos((K * 0.5))));
} else if (l <= 1.55e+100) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) t_1 = ((math.exp(l) - math.exp(-l)) * J) + U tmp = 0 if l <= -8.5e+87: tmp = t_0 elif l <= -6.6: tmp = t_1 elif l <= 0.55: tmp = U + (J * ((l * 2.0) * math.cos((K * 0.5)))) elif l <= 1.55e+100: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))) t_1 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) tmp = 0.0 if (l <= -8.5e+87) tmp = t_0; elseif (l <= -6.6) tmp = t_1; elseif (l <= 0.55) tmp = Float64(U + Float64(J * Float64(Float64(l * 2.0) * cos(Float64(K * 0.5))))); elseif (l <= 1.55e+100) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); t_1 = ((exp(l) - exp(-l)) * J) + U; tmp = 0.0; if (l <= -8.5e+87) tmp = t_0; elseif (l <= -6.6) tmp = t_1; elseif (l <= 0.55) tmp = U + (J * ((l * 2.0) * cos((K * 0.5)))); elseif (l <= 1.55e+100) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -8.5e+87], t$95$0, If[LessEqual[l, -6.6], t$95$1, If[LessEqual[l, 0.55], N[(U + N[(J * N[(N[(l * 2.0), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.55e+100], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
t_1 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{+87}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -6.6:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 0.55:\\
\;\;\;\;U + J \cdot \left(\left(\ell \cdot 2\right) \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{elif}\;\ell \leq 1.55 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -8.5000000000000001e87 or 1.55000000000000003e100 < l Initial program 100.0%
Taylor expanded in l around 0 99.0%
unpow299.0%
Applied egg-rr99.0%
if -8.5000000000000001e87 < l < -6.5999999999999996 or 0.55000000000000004 < l < 1.55000000000000003e100Initial program 100.0%
Taylor expanded in K around 0 77.7%
if -6.5999999999999996 < l < 0.55000000000000004Initial program 67.2%
Taylor expanded in l around 0 99.3%
*-commutative99.3%
associate-*l*99.3%
*-commutative99.3%
associate-*l*99.3%
Simplified99.3%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (exp (- l))) (t_1 (cos (/ K 2.0))))
(if (<= l -6.6)
(+ U (* t_1 (* J (- 27.0 t_0))))
(if (<= l 0.6)
(fma J (* t_1 (* l 2.0)) U)
(if (<= l 3e+100)
(+ (* (- (exp l) t_0) J) U)
(+ U (* t_1 (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l))))))))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(-l);
double t_1 = cos((K / 2.0));
double tmp;
if (l <= -6.6) {
tmp = U + (t_1 * (J * (27.0 - t_0)));
} else if (l <= 0.6) {
tmp = fma(J, (t_1 * (l * 2.0)), U);
} else if (l <= 3e+100) {
tmp = ((exp(l) - t_0) * J) + U;
} else {
tmp = U + (t_1 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
}
return tmp;
}
function code(J, l, K, U) t_0 = exp(Float64(-l)) t_1 = cos(Float64(K / 2.0)) tmp = 0.0 if (l <= -6.6) tmp = Float64(U + Float64(t_1 * Float64(J * Float64(27.0 - t_0)))); elseif (l <= 0.6) tmp = fma(J, Float64(t_1 * Float64(l * 2.0)), U); elseif (l <= 3e+100) tmp = Float64(Float64(Float64(exp(l) - t_0) * J) + U); else tmp = Float64(U + Float64(t_1 * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Exp[(-l)], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -6.6], N[(U + N[(t$95$1 * N[(J * N[(27.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.6], N[(J * N[(t$95$1 * N[(l * 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 3e+100], N[(N[(N[(N[Exp[l], $MachinePrecision] - t$95$0), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$1 * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-\ell}\\
t_1 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;\ell \leq -6.6:\\
\;\;\;\;U + t\_1 \cdot \left(J \cdot \left(27 - t\_0\right)\right)\\
\mathbf{elif}\;\ell \leq 0.6:\\
\;\;\;\;\mathsf{fma}\left(J, t\_1 \cdot \left(\ell \cdot 2\right), U\right)\\
\mathbf{elif}\;\ell \leq 3 \cdot 10^{+100}:\\
\;\;\;\;\left(e^{\ell} - t\_0\right) \cdot J + U\\
\mathbf{else}:\\
\;\;\;\;U + t\_1 \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < -6.5999999999999996Initial program 100.0%
Applied egg-rr99.0%
if -6.5999999999999996 < l < 0.599999999999999978Initial program 67.2%
associate-*l*67.2%
fma-define67.2%
Simplified67.2%
Taylor expanded in l around 0 99.3%
*-commutative99.3%
Simplified99.3%
if 0.599999999999999978 < l < 2.99999999999999985e100Initial program 100.0%
Taylor expanded in K around 0 70.6%
if 2.99999999999999985e100 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
unpow2100.0%
Applied egg-rr100.0%
Final simplification97.5%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.0041) (+ U (* J (* (* l 2.0) (cos (* K 0.5))))) (+ U (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.0041) {
tmp = U + (J * ((l * 2.0) * cos((K * 0.5))));
} else {
tmp = U + (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.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 (cos((k / 2.0d0)) <= 0.0041d0) then
tmp = u + (j * ((l * 2.0d0) * cos((k * 0.5d0))))
else
tmp = u + (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0)))))
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.0041) {
tmp = U + (J * ((l * 2.0) * Math.cos((K * 0.5))));
} else {
tmp = U + (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= 0.0041: tmp = U + (J * ((l * 2.0) * math.cos((K * 0.5)))) else: tmp = U + (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.0041) tmp = Float64(U + Float64(J * Float64(Float64(l * 2.0) * cos(Float64(K * 0.5))))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= 0.0041) tmp = U + (J * ((l * 2.0) * cos((K * 0.5)))); else tmp = U + (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.0041], N[(U + N[(J * N[(N[(l * 2.0), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.0041:\\
\;\;\;\;U + J \cdot \left(\left(\ell \cdot 2\right) \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.00410000000000000035Initial program 82.7%
Taylor expanded in l around 0 61.8%
*-commutative61.8%
associate-*l*61.8%
*-commutative61.8%
associate-*l*61.8%
Simplified61.8%
if 0.00410000000000000035 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.9%
Taylor expanded in l around 0 87.6%
Taylor expanded in K around 0 82.9%
Final simplification76.6%
(FPCore (J l K U) :precision binary64 (+ U (* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l))))))))
double code(double J, double l, double K, double U) {
return U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * 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 + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
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 + (0.3333333333333333 * (l * l))))));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); 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[(0.3333333333333333 * N[(l * l), $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 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)
\end{array}
Initial program 84.2%
Taylor expanded in l around 0 89.5%
unpow289.5%
Applied egg-rr89.5%
Final simplification89.5%
(FPCore (J l K U) :precision binary64 (+ U (* J (* (* l 2.0) (cos (* K 0.5))))))
double code(double J, double l, double K, double U) {
return U + (J * ((l * 2.0) * cos((K * 0.5))));
}
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) * cos((k * 0.5d0))))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * ((l * 2.0) * Math.cos((K * 0.5))));
}
def code(J, l, K, U): return U + (J * ((l * 2.0) * math.cos((K * 0.5))))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(Float64(l * 2.0) * cos(Float64(K * 0.5))))) end
function tmp = code(J, l, K, U) tmp = U + (J * ((l * 2.0) * cos((K * 0.5)))); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(N[(l * 2.0), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\left(\ell \cdot 2\right) \cdot \cos \left(K \cdot 0.5\right)\right)
\end{array}
Initial program 84.2%
Taylor expanded in l around 0 62.2%
*-commutative62.2%
associate-*l*62.2%
*-commutative62.2%
associate-*l*62.2%
Simplified62.2%
Final simplification62.2%
(FPCore (J l K U) :precision binary64 (if (<= l -1.35e+28) (* U (- U -4.0)) (if (<= l 1020.0) U (- -4.0 (* U U)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.35e+28) {
tmp = U * (U - -4.0);
} else if (l <= 1020.0) {
tmp = U;
} else {
tmp = -4.0 - (U * 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 <= (-1.35d+28)) then
tmp = u * (u - (-4.0d0))
else if (l <= 1020.0d0) then
tmp = u
else
tmp = (-4.0d0) - (u * u)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.35e+28) {
tmp = U * (U - -4.0);
} else if (l <= 1020.0) {
tmp = U;
} else {
tmp = -4.0 - (U * U);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1.35e+28: tmp = U * (U - -4.0) elif l <= 1020.0: tmp = U else: tmp = -4.0 - (U * U) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1.35e+28) tmp = Float64(U * Float64(U - -4.0)); elseif (l <= 1020.0) tmp = U; else tmp = Float64(-4.0 - Float64(U * U)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -1.35e+28) tmp = U * (U - -4.0); elseif (l <= 1020.0) tmp = U; else tmp = -4.0 - (U * U); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.35e+28], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1020.0], U, N[(-4.0 - N[(U * U), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{+28}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 1020:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;-4 - U \cdot U\\
\end{array}
\end{array}
if l < -1.3500000000000001e28Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr24.5%
if -1.3500000000000001e28 < l < 1020Initial program 68.9%
associate-*l*68.9%
fma-define68.9%
Simplified68.9%
Taylor expanded in J around 0 62.8%
if 1020 < l Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr18.4%
cancel-sign-sub-inv18.4%
Simplified18.4%
(FPCore (J l K U) :precision binary64 (if (<= l -1.35e+28) (* U (- U -4.0)) (if (<= l 0.54) U (* U (- 2.0 U)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.35e+28) {
tmp = U * (U - -4.0);
} else if (l <= 0.54) {
tmp = U;
} else {
tmp = U * (2.0 - U);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-1.35d+28)) then
tmp = u * (u - (-4.0d0))
else if (l <= 0.54d0) then
tmp = u
else
tmp = u * (2.0d0 - u)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.35e+28) {
tmp = U * (U - -4.0);
} else if (l <= 0.54) {
tmp = U;
} else {
tmp = U * (2.0 - U);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1.35e+28: tmp = U * (U - -4.0) elif l <= 0.54: tmp = U else: tmp = U * (2.0 - U) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1.35e+28) tmp = Float64(U * Float64(U - -4.0)); elseif (l <= 0.54) tmp = U; else tmp = Float64(U * Float64(2.0 - U)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -1.35e+28) tmp = U * (U - -4.0); elseif (l <= 0.54) tmp = U; else tmp = U * (2.0 - U); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.35e+28], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.54], U, N[(U * N[(2.0 - U), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{+28}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 0.54:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(2 - U\right)\\
\end{array}
\end{array}
if l < -1.3500000000000001e28Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr24.5%
if -1.3500000000000001e28 < l < 0.54000000000000004Initial program 68.7%
associate-*l*68.7%
fma-define68.7%
Simplified68.7%
Taylor expanded in J around 0 63.3%
if 0.54000000000000004 < l Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr18.0%
Taylor expanded in U around 0 18.0%
mul-1-neg18.0%
unsub-neg18.0%
Simplified18.0%
(FPCore (J l K U) :precision binary64 (if (<= l -6.6e+35) (* U U) (if (<= l 0.54) U (* U (- 2.0 U)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -6.6e+35) {
tmp = U * U;
} else if (l <= 0.54) {
tmp = U;
} else {
tmp = U * (2.0 - U);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-6.6d+35)) then
tmp = u * u
else if (l <= 0.54d0) then
tmp = u
else
tmp = u * (2.0d0 - u)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -6.6e+35) {
tmp = U * U;
} else if (l <= 0.54) {
tmp = U;
} else {
tmp = U * (2.0 - U);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -6.6e+35: tmp = U * U elif l <= 0.54: tmp = U else: tmp = U * (2.0 - U) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -6.6e+35) tmp = Float64(U * U); elseif (l <= 0.54) tmp = U; else tmp = Float64(U * Float64(2.0 - U)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -6.6e+35) tmp = U * U; elseif (l <= 0.54) tmp = U; else tmp = U * (2.0 - U); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -6.6e+35], N[(U * U), $MachinePrecision], If[LessEqual[l, 0.54], U, N[(U * N[(2.0 - U), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.6 \cdot 10^{+35}:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 0.54:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(2 - U\right)\\
\end{array}
\end{array}
if l < -6.6000000000000003e35Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr24.7%
if -6.6000000000000003e35 < l < 0.54000000000000004Initial program 68.9%
associate-*l*68.9%
fma-define68.9%
Simplified68.9%
Taylor expanded in J around 0 62.8%
if 0.54000000000000004 < l Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr18.0%
Taylor expanded in U around 0 18.0%
mul-1-neg18.0%
unsub-neg18.0%
Simplified18.0%
(FPCore (J l K U) :precision binary64 (if (or (<= l -6.6e+35) (not (<= l 15000.0))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -6.6e+35) || !(l <= 15000.0)) {
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 <= (-6.6d+35)) .or. (.not. (l <= 15000.0d0))) 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 <= -6.6e+35) || !(l <= 15000.0)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -6.6e+35) or not (l <= 15000.0): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -6.6e+35) || !(l <= 15000.0)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -6.6e+35) || ~((l <= 15000.0))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -6.6e+35], N[Not[LessEqual[l, 15000.0]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.6 \cdot 10^{+35} \lor \neg \left(\ell \leq 15000\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -6.6000000000000003e35 or 15000 < l Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr20.5%
if -6.6000000000000003e35 < l < 15000Initial program 69.4%
associate-*l*69.4%
fma-define69.4%
Simplified69.4%
Taylor expanded in J around 0 61.9%
Final simplification41.9%
(FPCore (J l K U) :precision binary64 (+ U (* l (* J 2.0))))
double code(double J, double l, double K, double U) {
return U + (l * (J * 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 + (l * (j * 2.0d0))
end function
public static double code(double J, double l, double K, double U) {
return U + (l * (J * 2.0));
}
def code(J, l, K, U): return U + (l * (J * 2.0))
function code(J, l, K, U) return Float64(U + Float64(l * Float64(J * 2.0))) end
function tmp = code(J, l, K, U) tmp = U + (l * (J * 2.0)); end
code[J_, l_, K_, U_] := N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \ell \cdot \left(J \cdot 2\right)
\end{array}
Initial program 84.2%
Taylor expanded in l around 0 62.2%
*-commutative62.2%
associate-*l*62.2%
*-commutative62.2%
associate-*l*62.2%
Simplified62.2%
Taylor expanded in K around 0 50.5%
associate-*r*50.5%
*-commutative50.5%
Simplified50.5%
Final simplification50.5%
(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.2%
associate-*l*84.2%
fma-define84.2%
Simplified84.2%
Taylor expanded in J around 0 33.0%
(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.2%
associate-*l*84.2%
fma-define84.2%
Simplified84.2%
Applied egg-rr24.0%
+-commutative24.0%
Simplified24.0%
Taylor expanded in U around 0 2.7%
herbie shell --seed 2024165
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))