
(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 13 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))) (t_2 (- (exp l) t_1)))
(if (<= t_2 (- INFINITY))
(+ (* (* J (- 27.0 t_1)) t_0) U)
(if (<= t_2 5e-14)
(+ U (* t_0 (* J (* l 2.0))))
(+ U (* t_0 (* t_2 J)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = exp(-l);
double t_2 = exp(l) - t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = ((J * (27.0 - t_1)) * t_0) + U;
} else if (t_2 <= 5e-14) {
tmp = U + (t_0 * (J * (l * 2.0)));
} else {
tmp = U + (t_0 * (t_2 * J));
}
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 t_2 = Math.exp(l) - t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = ((J * (27.0 - t_1)) * t_0) + U;
} else if (t_2 <= 5e-14) {
tmp = U + (t_0 * (J * (l * 2.0)));
} else {
tmp = U + (t_0 * (t_2 * J));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = math.exp(-l) t_2 = math.exp(l) - t_1 tmp = 0 if t_2 <= -math.inf: tmp = ((J * (27.0 - t_1)) * t_0) + U elif t_2 <= 5e-14: tmp = U + (t_0 * (J * (l * 2.0))) else: tmp = U + (t_0 * (t_2 * J)) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = exp(Float64(-l)) t_2 = Float64(exp(l) - t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(J * Float64(27.0 - t_1)) * t_0) + U); elseif (t_2 <= 5e-14) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * 2.0)))); else tmp = Float64(U + Float64(t_0 * Float64(t_2 * J))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(-l); t_2 = exp(l) - t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = ((J * (27.0 - t_1)) * t_0) + U; elseif (t_2 <= 5e-14) tmp = U + (t_0 * (J * (l * 2.0))); else tmp = U + (t_0 * (t_2 * J)); 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]}, Block[{t$95$2 = N[(N[Exp[l], $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(J * N[(27.0 - t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[t$95$2, 5e-14], N[(U + N[(t$95$0 * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$0 * N[(t$95$2 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{-\ell}\\
t_2 := e^{\ell} - t\_1\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(J \cdot \left(27 - t\_1\right)\right) \cdot t\_0 + U\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-14}:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(t\_2 \cdot J\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))) < 5.0000000000000002e-14Initial program 71.6%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
if 5.0000000000000002e-14 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= l -4.0)
(+ (* (* J (- 27.0 (exp (- l)))) t_0) U)
(if (or (<= l 160.0) (not (<= l 5.8e+88)))
(+ U (* t_0 (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))
(+ U (* J (- (exp l) 1.5)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (l <= -4.0) {
tmp = ((J * (27.0 - exp(-l))) * t_0) + U;
} else if ((l <= 160.0) || !(l <= 5.8e+88)) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + (J * (exp(l) - 1.5));
}
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 <= (-4.0d0)) then
tmp = ((j * (27.0d0 - exp(-l))) * t_0) + u
else if ((l <= 160.0d0) .or. (.not. (l <= 5.8d+88))) then
tmp = u + (t_0 * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
else
tmp = u + (j * (exp(l) - 1.5d0))
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 <= -4.0) {
tmp = ((J * (27.0 - Math.exp(-l))) * t_0) + U;
} else if ((l <= 160.0) || !(l <= 5.8e+88)) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + (J * (Math.exp(l) - 1.5));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if l <= -4.0: tmp = ((J * (27.0 - math.exp(-l))) * t_0) + U elif (l <= 160.0) or not (l <= 5.8e+88): tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) else: tmp = U + (J * (math.exp(l) - 1.5)) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (l <= -4.0) tmp = Float64(Float64(Float64(J * Float64(27.0 - exp(Float64(-l)))) * t_0) + U); elseif ((l <= 160.0) || !(l <= 5.8e+88)) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 1.5))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (l <= -4.0) tmp = ((J * (27.0 - exp(-l))) * t_0) + U; elseif ((l <= 160.0) || ~((l <= 5.8e+88))) tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); else tmp = U + (J * (exp(l) - 1.5)); 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, -4.0], N[(N[(N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[Or[LessEqual[l, 160.0], N[Not[LessEqual[l, 5.8e+88]], $MachinePrecision]], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;\ell \leq -4:\\
\;\;\;\;\left(J \cdot \left(27 - e^{-\ell}\right)\right) \cdot t\_0 + U\\
\mathbf{elif}\;\ell \leq 160 \lor \neg \left(\ell \leq 5.8 \cdot 10^{+88}\right):\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 1.5\right)\\
\end{array}
\end{array}
if l < -4Initial program 100.0%
Applied egg-rr100.0%
if -4 < l < 160 or 5.7999999999999999e88 < l Initial program 80.2%
Taylor expanded in l around 0 99.4%
unpow299.4%
Applied egg-rr99.4%
if 160 < l < 5.7999999999999999e88Initial program 100.0%
Taylor expanded in K around 0 82.4%
Applied egg-rr82.4%
Final simplification98.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+
U
(*
(cos (/ K 2.0))
(* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))))
(if (<= l -2.7e+130)
t_0
(if (<= l -7.5)
(+ (* J (- 27.0 (exp (- l)))) U)
(if (or (<= l 160.0) (not (<= l 5.8e+88)))
t_0
(+ U (* J (- (exp l) 1.5))))))))
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 tmp;
if (l <= -2.7e+130) {
tmp = t_0;
} else if (l <= -7.5) {
tmp = (J * (27.0 - exp(-l))) + U;
} else if ((l <= 160.0) || !(l <= 5.8e+88)) {
tmp = t_0;
} else {
tmp = U + (J * (exp(l) - 1.5));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
if (l <= (-2.7d+130)) then
tmp = t_0
else if (l <= (-7.5d0)) then
tmp = (j * (27.0d0 - exp(-l))) + u
else if ((l <= 160.0d0) .or. (.not. (l <= 5.8d+88))) then
tmp = t_0
else
tmp = u + (j * (exp(l) - 1.5d0))
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 tmp;
if (l <= -2.7e+130) {
tmp = t_0;
} else if (l <= -7.5) {
tmp = (J * (27.0 - Math.exp(-l))) + U;
} else if ((l <= 160.0) || !(l <= 5.8e+88)) {
tmp = t_0;
} else {
tmp = U + (J * (Math.exp(l) - 1.5));
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) tmp = 0 if l <= -2.7e+130: tmp = t_0 elif l <= -7.5: tmp = (J * (27.0 - math.exp(-l))) + U elif (l <= 160.0) or not (l <= 5.8e+88): tmp = t_0 else: tmp = U + (J * (math.exp(l) - 1.5)) 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))))))) tmp = 0.0 if (l <= -2.7e+130) tmp = t_0; elseif (l <= -7.5) tmp = Float64(Float64(J * Float64(27.0 - exp(Float64(-l)))) + U); elseif ((l <= 160.0) || !(l <= 5.8e+88)) tmp = t_0; else tmp = Float64(U + Float64(J * Float64(exp(l) - 1.5))); 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)))))); tmp = 0.0; if (l <= -2.7e+130) tmp = t_0; elseif (l <= -7.5) tmp = (J * (27.0 - exp(-l))) + U; elseif ((l <= 160.0) || ~((l <= 5.8e+88))) tmp = t_0; else tmp = U + (J * (exp(l) - 1.5)); 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]}, If[LessEqual[l, -2.7e+130], t$95$0, If[LessEqual[l, -7.5], N[(N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[Or[LessEqual[l, 160.0], N[Not[LessEqual[l, 5.8e+88]], $MachinePrecision]], t$95$0, N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\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)\\
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{+130}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -7.5:\\
\;\;\;\;J \cdot \left(27 - e^{-\ell}\right) + U\\
\mathbf{elif}\;\ell \leq 160 \lor \neg \left(\ell \leq 5.8 \cdot 10^{+88}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 1.5\right)\\
\end{array}
\end{array}
if l < -2.6999999999999998e130 or -7.5 < l < 160 or 5.7999999999999999e88 < l Initial program 83.3%
Taylor expanded in l around 0 99.5%
unpow299.5%
Applied egg-rr99.5%
if -2.6999999999999998e130 < l < -7.5Initial program 100.0%
Taylor expanded in K around 0 75.0%
Applied egg-rr75.0%
if 160 < l < 5.7999999999999999e88Initial program 100.0%
Taylor expanded in K around 0 82.4%
Applied egg-rr82.4%
Final simplification95.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (* l 2.0)))))
(if (<= l -2.45e+203)
t_0
(if (<= l -820.0)
(/ (- 4096.0 (pow U 3.0)) 256.0)
(if (<= l 160.0) t_0 (+ U (* J (- (exp l) 1.5))))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * 2.0));
double tmp;
if (l <= -2.45e+203) {
tmp = t_0;
} else if (l <= -820.0) {
tmp = (4096.0 - pow(U, 3.0)) / 256.0;
} else if (l <= 160.0) {
tmp = t_0;
} else {
tmp = U + (J * (exp(l) - 1.5));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = u + (j * (l * 2.0d0))
if (l <= (-2.45d+203)) then
tmp = t_0
else if (l <= (-820.0d0)) then
tmp = (4096.0d0 - (u ** 3.0d0)) / 256.0d0
else if (l <= 160.0d0) then
tmp = t_0
else
tmp = u + (j * (exp(l) - 1.5d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * 2.0));
double tmp;
if (l <= -2.45e+203) {
tmp = t_0;
} else if (l <= -820.0) {
tmp = (4096.0 - Math.pow(U, 3.0)) / 256.0;
} else if (l <= 160.0) {
tmp = t_0;
} else {
tmp = U + (J * (Math.exp(l) - 1.5));
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (J * (l * 2.0)) tmp = 0 if l <= -2.45e+203: tmp = t_0 elif l <= -820.0: tmp = (4096.0 - math.pow(U, 3.0)) / 256.0 elif l <= 160.0: tmp = t_0 else: tmp = U + (J * (math.exp(l) - 1.5)) return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64(l * 2.0))) tmp = 0.0 if (l <= -2.45e+203) tmp = t_0; elseif (l <= -820.0) tmp = Float64(Float64(4096.0 - (U ^ 3.0)) / 256.0); elseif (l <= 160.0) tmp = t_0; else tmp = Float64(U + Float64(J * Float64(exp(l) - 1.5))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (J * (l * 2.0)); tmp = 0.0; if (l <= -2.45e+203) tmp = t_0; elseif (l <= -820.0) tmp = (4096.0 - (U ^ 3.0)) / 256.0; elseif (l <= 160.0) tmp = t_0; else tmp = U + (J * (exp(l) - 1.5)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.45e+203], t$95$0, If[LessEqual[l, -820.0], N[(N[(4096.0 - N[Power[U, 3.0], $MachinePrecision]), $MachinePrecision] / 256.0), $MachinePrecision], If[LessEqual[l, 160.0], t$95$0, N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{if}\;\ell \leq -2.45 \cdot 10^{+203}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -820:\\
\;\;\;\;\frac{4096 - {U}^{3}}{256}\\
\mathbf{elif}\;\ell \leq 160:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 1.5\right)\\
\end{array}
\end{array}
if l < -2.4499999999999999e203 or -820 < l < 160Initial program 75.2%
Taylor expanded in l around 0 94.6%
*-commutative94.6%
associate-*r*94.6%
associate-*l*94.6%
*-commutative94.6%
*-commutative94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in K around 0 82.4%
*-commutative82.4%
associate-*r*82.4%
*-commutative82.4%
Simplified82.4%
if -2.4499999999999999e203 < l < -820Initial program 100.0%
Applied egg-rr3.3%
fmm-undef3.3%
metadata-eval3.3%
Simplified3.3%
flip3--5.5%
metadata-eval5.5%
metadata-eval5.5%
distribute-rgt-out5.5%
+-commutative5.5%
Applied egg-rr5.5%
Taylor expanded in U around 0 38.1%
if 160 < l Initial program 100.0%
Taylor expanded in K around 0 79.4%
Applied egg-rr79.4%
Final simplification73.7%
(FPCore (J l K U)
:precision binary64
(if (<= l -4.5)
(+ (* J (- 27.0 (exp (- l)))) U)
(if (<= l 160.0)
(+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))
(+ U (* J (- (exp l) 1.5))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.5) {
tmp = (J * (27.0 - exp(-l))) + U;
} else if (l <= 160.0) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (J * (exp(l) - 1.5));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-4.5d0)) then
tmp = (j * (27.0d0 - exp(-l))) + u
else if (l <= 160.0d0) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
else
tmp = u + (j * (exp(l) - 1.5d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.5) {
tmp = (J * (27.0 - Math.exp(-l))) + U;
} else if (l <= 160.0) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (J * (Math.exp(l) - 1.5));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -4.5: tmp = (J * (27.0 - math.exp(-l))) + U elif l <= 160.0: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) else: tmp = U + (J * (math.exp(l) - 1.5)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -4.5) tmp = Float64(Float64(J * Float64(27.0 - exp(Float64(-l)))) + U); elseif (l <= 160.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 1.5))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -4.5) tmp = (J * (27.0 - exp(-l))) + U; elseif (l <= 160.0) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); else tmp = U + (J * (exp(l) - 1.5)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.5], N[(N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 160.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.5:\\
\;\;\;\;J \cdot \left(27 - e^{-\ell}\right) + U\\
\mathbf{elif}\;\ell \leq 160:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 1.5\right)\\
\end{array}
\end{array}
if l < -4.5Initial program 100.0%
Taylor expanded in K around 0 80.3%
Applied egg-rr80.3%
if -4.5 < l < 160Initial program 72.3%
Taylor expanded in l around 0 99.2%
*-commutative99.2%
associate-*l*99.2%
Simplified99.2%
if 160 < l Initial program 100.0%
Taylor expanded in K around 0 79.4%
Applied egg-rr79.4%
Final simplification89.4%
(FPCore (J l K U)
:precision binary64
(if (<= l -4.0)
(+ (* J (- 27.0 (exp (- l)))) U)
(if (<= l 160.0)
(+ U (* 2.0 (* J (* l (cos (* K 0.5))))))
(+ U (* J (- (exp l) 1.5))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.0) {
tmp = (J * (27.0 - exp(-l))) + U;
} else if (l <= 160.0) {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
} else {
tmp = U + (J * (exp(l) - 1.5));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-4.0d0)) then
tmp = (j * (27.0d0 - exp(-l))) + u
else if (l <= 160.0d0) then
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
else
tmp = u + (j * (exp(l) - 1.5d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.0) {
tmp = (J * (27.0 - Math.exp(-l))) + U;
} else if (l <= 160.0) {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
} else {
tmp = U + (J * (Math.exp(l) - 1.5));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -4.0: tmp = (J * (27.0 - math.exp(-l))) + U elif l <= 160.0: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) else: tmp = U + (J * (math.exp(l) - 1.5)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -4.0) tmp = Float64(Float64(J * Float64(27.0 - exp(Float64(-l)))) + U); elseif (l <= 160.0) 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.5))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -4.0) tmp = (J * (27.0 - exp(-l))) + U; elseif (l <= 160.0) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); else tmp = U + (J * (exp(l) - 1.5)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.0], N[(N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 160.0], 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.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4:\\
\;\;\;\;J \cdot \left(27 - e^{-\ell}\right) + U\\
\mathbf{elif}\;\ell \leq 160:\\
\;\;\;\;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.5\right)\\
\end{array}
\end{array}
if l < -4Initial program 100.0%
Taylor expanded in K around 0 80.3%
Applied egg-rr80.3%
if -4 < l < 160Initial program 72.3%
Taylor expanded in l around 0 99.2%
if 160 < l Initial program 100.0%
Taylor expanded in K around 0 79.4%
Applied egg-rr79.4%
Final simplification89.4%
(FPCore (J l K U) :precision binary64 (if (<= l -3.5) (+ (* J (- 27.0 (exp (- l)))) U) (if (<= l 160.0) (+ U (* J (* l 2.0))) (+ U (* J (- (exp l) 1.5))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -3.5) {
tmp = (J * (27.0 - exp(-l))) + U;
} else if (l <= 160.0) {
tmp = U + (J * (l * 2.0));
} else {
tmp = U + (J * (exp(l) - 1.5));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-3.5d0)) then
tmp = (j * (27.0d0 - exp(-l))) + u
else if (l <= 160.0d0) then
tmp = u + (j * (l * 2.0d0))
else
tmp = u + (j * (exp(l) - 1.5d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -3.5) {
tmp = (J * (27.0 - Math.exp(-l))) + U;
} else if (l <= 160.0) {
tmp = U + (J * (l * 2.0));
} else {
tmp = U + (J * (Math.exp(l) - 1.5));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -3.5: tmp = (J * (27.0 - math.exp(-l))) + U elif l <= 160.0: tmp = U + (J * (l * 2.0)) else: tmp = U + (J * (math.exp(l) - 1.5)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -3.5) tmp = Float64(Float64(J * Float64(27.0 - exp(Float64(-l)))) + U); elseif (l <= 160.0) tmp = Float64(U + Float64(J * Float64(l * 2.0))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 1.5))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -3.5) tmp = (J * (27.0 - exp(-l))) + U; elseif (l <= 160.0) tmp = U + (J * (l * 2.0)); else tmp = U + (J * (exp(l) - 1.5)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -3.5], N[(N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 160.0], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.5:\\
\;\;\;\;J \cdot \left(27 - e^{-\ell}\right) + U\\
\mathbf{elif}\;\ell \leq 160:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 1.5\right)\\
\end{array}
\end{array}
if l < -3.5Initial program 100.0%
Taylor expanded in K around 0 80.3%
Applied egg-rr80.3%
if -3.5 < l < 160Initial program 72.3%
Taylor expanded in l around 0 99.2%
*-commutative99.2%
associate-*r*99.2%
associate-*l*99.2%
*-commutative99.2%
*-commutative99.2%
*-commutative99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in K around 0 86.4%
*-commutative86.4%
associate-*r*86.4%
*-commutative86.4%
Simplified86.4%
if 160 < l Initial program 100.0%
Taylor expanded in K around 0 79.4%
Applied egg-rr79.4%
Final simplification83.1%
(FPCore (J l K U) :precision binary64 (if (or (<= l -1.05e+202) (not (<= l -800.0))) (+ U (* J (* l 2.0))) (/ (- 4096.0 (pow U 3.0)) 256.0)))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.05e+202) || !(l <= -800.0)) {
tmp = U + (J * (l * 2.0));
} else {
tmp = (4096.0 - pow(U, 3.0)) / 256.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 <= (-1.05d+202)) .or. (.not. (l <= (-800.0d0)))) then
tmp = u + (j * (l * 2.0d0))
else
tmp = (4096.0d0 - (u ** 3.0d0)) / 256.0d0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.05e+202) || !(l <= -800.0)) {
tmp = U + (J * (l * 2.0));
} else {
tmp = (4096.0 - Math.pow(U, 3.0)) / 256.0;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -1.05e+202) or not (l <= -800.0): tmp = U + (J * (l * 2.0)) else: tmp = (4096.0 - math.pow(U, 3.0)) / 256.0 return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -1.05e+202) || !(l <= -800.0)) tmp = Float64(U + Float64(J * Float64(l * 2.0))); else tmp = Float64(Float64(4096.0 - (U ^ 3.0)) / 256.0); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -1.05e+202) || ~((l <= -800.0))) tmp = U + (J * (l * 2.0)); else tmp = (4096.0 - (U ^ 3.0)) / 256.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -1.05e+202], N[Not[LessEqual[l, -800.0]], $MachinePrecision]], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(4096.0 - N[Power[U, 3.0], $MachinePrecision]), $MachinePrecision] / 256.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.05 \cdot 10^{+202} \lor \neg \left(\ell \leq -800\right):\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{4096 - {U}^{3}}{256}\\
\end{array}
\end{array}
if l < -1.05e202 or -800 < l Initial program 83.2%
Taylor expanded in l around 0 73.4%
*-commutative73.4%
associate-*r*73.4%
associate-*l*73.4%
*-commutative73.4%
*-commutative73.4%
*-commutative73.4%
associate-*l*73.4%
Simplified73.4%
Taylor expanded in K around 0 63.2%
*-commutative63.2%
associate-*r*63.6%
*-commutative63.6%
Simplified63.6%
if -1.05e202 < l < -800Initial program 100.0%
Applied egg-rr3.3%
fmm-undef3.3%
metadata-eval3.3%
Simplified3.3%
flip3--5.5%
metadata-eval5.5%
metadata-eval5.5%
distribute-rgt-out5.5%
+-commutative5.5%
Applied egg-rr5.5%
Taylor expanded in U around 0 38.1%
Final simplification59.0%
(FPCore (J l K U) :precision binary64 (if (or (<= l -1.05e+198) (not (<= l -2500.0))) (+ U (* J (* l 2.0))) (/ (- 256.0 (* U U)) (+ U 16.0))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.05e+198) || !(l <= -2500.0)) {
tmp = U + (J * (l * 2.0));
} else {
tmp = (256.0 - (U * U)) / (U + 16.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 <= (-1.05d+198)) .or. (.not. (l <= (-2500.0d0)))) then
tmp = u + (j * (l * 2.0d0))
else
tmp = (256.0d0 - (u * u)) / (u + 16.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.05e+198) || !(l <= -2500.0)) {
tmp = U + (J * (l * 2.0));
} else {
tmp = (256.0 - (U * U)) / (U + 16.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -1.05e+198) or not (l <= -2500.0): tmp = U + (J * (l * 2.0)) else: tmp = (256.0 - (U * U)) / (U + 16.0) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -1.05e+198) || !(l <= -2500.0)) tmp = Float64(U + Float64(J * Float64(l * 2.0))); else tmp = Float64(Float64(256.0 - Float64(U * U)) / Float64(U + 16.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -1.05e+198) || ~((l <= -2500.0))) tmp = U + (J * (l * 2.0)); else tmp = (256.0 - (U * U)) / (U + 16.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -1.05e+198], N[Not[LessEqual[l, -2500.0]], $MachinePrecision]], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(256.0 - N[(U * U), $MachinePrecision]), $MachinePrecision] / N[(U + 16.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.05 \cdot 10^{+198} \lor \neg \left(\ell \leq -2500\right):\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{256 - U \cdot U}{U + 16}\\
\end{array}
\end{array}
if l < -1.05000000000000006e198 or -2500 < l Initial program 83.2%
Taylor expanded in l around 0 73.4%
*-commutative73.4%
associate-*r*73.4%
associate-*l*73.4%
*-commutative73.4%
*-commutative73.4%
*-commutative73.4%
associate-*l*73.4%
Simplified73.4%
Taylor expanded in K around 0 63.2%
*-commutative63.2%
associate-*r*63.6%
*-commutative63.6%
Simplified63.6%
if -1.05000000000000006e198 < l < -2500Initial program 100.0%
Applied egg-rr3.3%
fmm-undef3.3%
metadata-eval3.3%
Simplified3.3%
sub-neg3.3%
flip-+33.9%
metadata-eval33.9%
Applied egg-rr33.9%
Final simplification58.3%
(FPCore (J l K U) :precision binary64 (if (or (<= l -1000.0) (not (<= l 1.52e+29))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1000.0) || !(l <= 1.52e+29)) {
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 <= (-1000.0d0)) .or. (.not. (l <= 1.52d+29))) 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 <= -1000.0) || !(l <= 1.52e+29)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -1000.0) or not (l <= 1.52e+29): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -1000.0) || !(l <= 1.52e+29)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -1000.0) || ~((l <= 1.52e+29))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -1000.0], N[Not[LessEqual[l, 1.52e+29]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1000 \lor \neg \left(\ell \leq 1.52 \cdot 10^{+29}\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -1e3 or 1.52e29 < l Initial program 100.0%
Applied egg-rr15.0%
if -1e3 < l < 1.52e29Initial program 72.9%
Taylor expanded in J around 0 69.4%
Final simplification42.6%
(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 86.3%
Taylor expanded in l around 0 63.4%
*-commutative63.4%
associate-*r*63.4%
associate-*l*63.4%
*-commutative63.4%
*-commutative63.4%
*-commutative63.4%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in K around 0 54.5%
*-commutative54.5%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
Final simplification54.9%
(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 86.3%
Taylor expanded in J around 0 36.2%
(FPCore (J l K U) :precision binary64 0.25)
double code(double J, double l, double K, double U) {
return 0.25;
}
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 = 0.25d0
end function
public static double code(double J, double l, double K, double U) {
return 0.25;
}
def code(J, l, K, U): return 0.25
function code(J, l, K, U) return 0.25 end
function tmp = code(J, l, K, U) tmp = 0.25; end
code[J_, l_, K_, U_] := 0.25
\begin{array}{l}
\\
0.25
\end{array}
Initial program 86.3%
Applied egg-rr22.6%
Taylor expanded in U around 0 2.9%
herbie shell --seed 2024182
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))