
(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 20 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 (- INFINITY)) (not (<= t_1 0.0)))
(+ (* (* t_1 J) t_0) U)
(+ U (* t_0 (* l (+ (* 0.3333333333333333 (* J (* l l))) (* J 2.0))))))))
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 <= -((double) INFINITY)) || !(t_1 <= 0.0)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0))));
}
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) - Math.exp(-l);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 0.0)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0))));
}
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 <= -math.inf) or not (t_1 <= 0.0): tmp = ((t_1 * J) * t_0) + U else: tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0)))) 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 <= Float64(-Inf)) || !(t_1 <= 0.0)) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = Float64(U + Float64(t_0 * Float64(l * Float64(Float64(0.3333333333333333 * Float64(J * Float64(l * l))) + Float64(J * 2.0))))); 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 <= -Inf) || ~((t_1 <= 0.0))) tmp = ((t_1 * J) * t_0) + U; else tmp = U + (t_0 * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0)))); 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(l * N[(N[(0.3333333333333333 * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(J * 2.0), $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 -\infty \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\left(t\_1 \cdot J\right) \cdot t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right) + J \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 0.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 0.0Initial program 75.4%
Taylor expanded in l around 0 100.0%
unpow2100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+
U
(*
(cos (/ K 2.0))
(* l (+ (* 0.3333333333333333 (* J (* l l))) (* J 2.0))))))
(t_1 (exp (- l))))
(if (<= l -3.5e+145)
t_0
(if (<= l -63.0)
(+ U (* J (- 27.0 t_1)))
(if (or (<= l 2.25e+14) (not (<= l 8.8e+136)))
t_0
(+ (* (- (exp l) t_1) J) U))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0))));
double t_1 = exp(-l);
double tmp;
if (l <= -3.5e+145) {
tmp = t_0;
} else if (l <= -63.0) {
tmp = U + (J * (27.0 - t_1));
} else if ((l <= 2.25e+14) || !(l <= 8.8e+136)) {
tmp = t_0;
} else {
tmp = ((exp(l) - t_1) * J) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = u + (cos((k / 2.0d0)) * (l * ((0.3333333333333333d0 * (j * (l * l))) + (j * 2.0d0))))
t_1 = exp(-l)
if (l <= (-3.5d+145)) then
tmp = t_0
else if (l <= (-63.0d0)) then
tmp = u + (j * (27.0d0 - t_1))
else if ((l <= 2.25d+14) .or. (.not. (l <= 8.8d+136))) then
tmp = t_0
else
tmp = ((exp(l) - t_1) * j) + u
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)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0))));
double t_1 = Math.exp(-l);
double tmp;
if (l <= -3.5e+145) {
tmp = t_0;
} else if (l <= -63.0) {
tmp = U + (J * (27.0 - t_1));
} else if ((l <= 2.25e+14) || !(l <= 8.8e+136)) {
tmp = t_0;
} else {
tmp = ((Math.exp(l) - t_1) * J) + U;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0)))) t_1 = math.exp(-l) tmp = 0 if l <= -3.5e+145: tmp = t_0 elif l <= -63.0: tmp = U + (J * (27.0 - t_1)) elif (l <= 2.25e+14) or not (l <= 8.8e+136): tmp = t_0 else: tmp = ((math.exp(l) - t_1) * J) + U return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(Float64(0.3333333333333333 * Float64(J * Float64(l * l))) + Float64(J * 2.0))))) t_1 = exp(Float64(-l)) tmp = 0.0 if (l <= -3.5e+145) tmp = t_0; elseif (l <= -63.0) tmp = Float64(U + Float64(J * Float64(27.0 - t_1))); elseif ((l <= 2.25e+14) || !(l <= 8.8e+136)) tmp = t_0; else tmp = Float64(Float64(Float64(exp(l) - t_1) * J) + U); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0)))); t_1 = exp(-l); tmp = 0.0; if (l <= -3.5e+145) tmp = t_0; elseif (l <= -63.0) tmp = U + (J * (27.0 - t_1)); elseif ((l <= 2.25e+14) || ~((l <= 8.8e+136))) tmp = t_0; else tmp = ((exp(l) - t_1) * J) + U; 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[(l * N[(N[(0.3333333333333333 * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-l)], $MachinePrecision]}, If[LessEqual[l, -3.5e+145], t$95$0, If[LessEqual[l, -63.0], N[(U + N[(J * N[(27.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.25e+14], N[Not[LessEqual[l, 8.8e+136]], $MachinePrecision]], t$95$0, N[(N[(N[(N[Exp[l], $MachinePrecision] - t$95$1), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right) + J \cdot 2\right)\right)\\
t_1 := e^{-\ell}\\
\mathbf{if}\;\ell \leq -3.5 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -63:\\
\;\;\;\;U + J \cdot \left(27 - t\_1\right)\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+14} \lor \neg \left(\ell \leq 8.8 \cdot 10^{+136}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(e^{\ell} - t\_1\right) \cdot J + U\\
\end{array}
\end{array}
if l < -3.5000000000000001e145 or -63 < l < 2.25e14 or 8.7999999999999998e136 < l Initial program 84.5%
Taylor expanded in l around 0 99.5%
unpow299.5%
Applied egg-rr99.5%
if -3.5000000000000001e145 < l < -63Initial program 100.0%
Taylor expanded in K around 0 93.5%
Applied egg-rr93.5%
if 2.25e14 < l < 8.7999999999999998e136Initial program 100.0%
Taylor expanded in K around 0 88.9%
Final simplification97.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+
U
(*
(cos (/ K 2.0))
(* l (+ (* 0.3333333333333333 (* J (* l l))) (* J 2.0)))))))
(if (<= l -5.6e+145)
t_0
(if (<= l -63.0)
(+ U (* J (- 27.0 (exp (- l)))))
(if (or (<= l 2.25e+14) (not (<= l 4.8e+146)))
t_0
(+ U (* J (- (exp l) 27.0))))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0))));
double tmp;
if (l <= -5.6e+145) {
tmp = t_0;
} else if (l <= -63.0) {
tmp = U + (J * (27.0 - exp(-l)));
} else if ((l <= 2.25e+14) || !(l <= 4.8e+146)) {
tmp = t_0;
} else {
tmp = U + (J * (exp(l) - 27.0));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = u + (cos((k / 2.0d0)) * (l * ((0.3333333333333333d0 * (j * (l * l))) + (j * 2.0d0))))
if (l <= (-5.6d+145)) then
tmp = t_0
else if (l <= (-63.0d0)) then
tmp = u + (j * (27.0d0 - exp(-l)))
else if ((l <= 2.25d+14) .or. (.not. (l <= 4.8d+146))) then
tmp = t_0
else
tmp = u + (j * (exp(l) - 27.0d0))
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)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0))));
double tmp;
if (l <= -5.6e+145) {
tmp = t_0;
} else if (l <= -63.0) {
tmp = U + (J * (27.0 - Math.exp(-l)));
} else if ((l <= 2.25e+14) || !(l <= 4.8e+146)) {
tmp = t_0;
} else {
tmp = U + (J * (Math.exp(l) - 27.0));
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0)))) tmp = 0 if l <= -5.6e+145: tmp = t_0 elif l <= -63.0: tmp = U + (J * (27.0 - math.exp(-l))) elif (l <= 2.25e+14) or not (l <= 4.8e+146): tmp = t_0 else: tmp = U + (J * (math.exp(l) - 27.0)) return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(Float64(0.3333333333333333 * Float64(J * Float64(l * l))) + Float64(J * 2.0))))) tmp = 0.0 if (l <= -5.6e+145) tmp = t_0; elseif (l <= -63.0) tmp = Float64(U + Float64(J * Float64(27.0 - exp(Float64(-l))))); elseif ((l <= 2.25e+14) || !(l <= 4.8e+146)) tmp = t_0; else tmp = Float64(U + Float64(J * Float64(exp(l) - 27.0))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (cos((K / 2.0)) * (l * ((0.3333333333333333 * (J * (l * l))) + (J * 2.0)))); tmp = 0.0; if (l <= -5.6e+145) tmp = t_0; elseif (l <= -63.0) tmp = U + (J * (27.0 - exp(-l))); elseif ((l <= 2.25e+14) || ~((l <= 4.8e+146))) tmp = t_0; else tmp = U + (J * (exp(l) - 27.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[(l * N[(N[(0.3333333333333333 * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5.6e+145], t$95$0, If[LessEqual[l, -63.0], N[(U + N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.25e+14], N[Not[LessEqual[l, 4.8e+146]], $MachinePrecision]], t$95$0, N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right) + J \cdot 2\right)\right)\\
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -63:\\
\;\;\;\;U + J \cdot \left(27 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+14} \lor \neg \left(\ell \leq 4.8 \cdot 10^{+146}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 27\right)\\
\end{array}
\end{array}
if l < -5.5999999999999997e145 or -63 < l < 2.25e14 or 4.8000000000000004e146 < l Initial program 84.5%
Taylor expanded in l around 0 99.5%
unpow299.5%
Applied egg-rr99.5%
if -5.5999999999999997e145 < l < -63Initial program 100.0%
Taylor expanded in K around 0 93.5%
Applied egg-rr93.5%
if 2.25e14 < l < 4.8000000000000004e146Initial program 100.0%
Taylor expanded in K around 0 88.9%
Applied egg-rr88.9%
Final simplification97.6%
(FPCore (J l K U)
:precision binary64
(if (<= l -63.0)
(+ U (* J (- 27.0 (exp (- l)))))
(if (<= l 2.25e+14)
(+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))
(+ U (* J (- (exp l) 27.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (J * (exp(l) - 27.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 <= (-63.0d0)) then
tmp = u + (j * (27.0d0 - exp(-l)))
else if (l <= 2.25d+14) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
else
tmp = u + (j * (exp(l) - 27.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - Math.exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (J * (Math.exp(l) - 27.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -63.0: tmp = U + (J * (27.0 - math.exp(-l))) elif l <= 2.25e+14: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) else: tmp = U + (J * (math.exp(l) - 27.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -63.0) tmp = Float64(U + Float64(J * Float64(27.0 - exp(Float64(-l))))); elseif (l <= 2.25e+14) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 27.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -63.0) tmp = U + (J * (27.0 - exp(-l))); elseif (l <= 2.25e+14) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); else tmp = U + (J * (exp(l) - 27.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -63.0], N[(U + N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.25e+14], 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] - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -63:\\
\;\;\;\;U + J \cdot \left(27 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+14}:\\
\;\;\;\;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} - 27\right)\\
\end{array}
\end{array}
if l < -63Initial program 100.0%
Taylor expanded in K around 0 80.0%
Applied egg-rr80.0%
if -63 < l < 2.25e14Initial program 75.8%
Taylor expanded in l around 0 99.2%
*-commutative99.2%
associate-*l*99.2%
Simplified99.2%
if 2.25e14 < l Initial program 100.0%
Taylor expanded in K around 0 85.9%
Applied egg-rr85.9%
Final simplification91.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -63.0)
(+ U (* J (- 27.0 (exp (- l)))))
(if (<= l 2.25e+14)
(+ U (* l (* (* J 2.0) (cos (* K 0.5)))))
(+ U (* J (- (exp l) 27.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (l * ((J * 2.0) * cos((K * 0.5))));
} else {
tmp = U + (J * (exp(l) - 27.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 <= (-63.0d0)) then
tmp = u + (j * (27.0d0 - exp(-l)))
else if (l <= 2.25d+14) then
tmp = u + (l * ((j * 2.0d0) * cos((k * 0.5d0))))
else
tmp = u + (j * (exp(l) - 27.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - Math.exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (l * ((J * 2.0) * Math.cos((K * 0.5))));
} else {
tmp = U + (J * (Math.exp(l) - 27.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -63.0: tmp = U + (J * (27.0 - math.exp(-l))) elif l <= 2.25e+14: tmp = U + (l * ((J * 2.0) * math.cos((K * 0.5)))) else: tmp = U + (J * (math.exp(l) - 27.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -63.0) tmp = Float64(U + Float64(J * Float64(27.0 - exp(Float64(-l))))); elseif (l <= 2.25e+14) tmp = Float64(U + Float64(l * Float64(Float64(J * 2.0) * cos(Float64(K * 0.5))))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 27.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -63.0) tmp = U + (J * (27.0 - exp(-l))); elseif (l <= 2.25e+14) tmp = U + (l * ((J * 2.0) * cos((K * 0.5)))); else tmp = U + (J * (exp(l) - 27.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -63.0], N[(U + N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.25e+14], N[(U + N[(l * N[(N[(J * 2.0), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -63:\\
\;\;\;\;U + J \cdot \left(27 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+14}:\\
\;\;\;\;U + \ell \cdot \left(\left(J \cdot 2\right) \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 27\right)\\
\end{array}
\end{array}
if l < -63Initial program 100.0%
Taylor expanded in K around 0 80.0%
Applied egg-rr80.0%
if -63 < l < 2.25e14Initial program 75.8%
Taylor expanded in l around 0 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.2%
*-commutative99.2%
associate-*r*99.2%
*-commutative99.2%
associate-*l*99.2%
Simplified99.2%
if 2.25e14 < l Initial program 100.0%
Taylor expanded in K around 0 85.9%
Applied egg-rr85.9%
Final simplification91.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -63.0)
(+ U (* J (- 27.0 (exp (- l)))))
(if (<= l 2.25e+14)
(+ U (* J (* l (* 2.0 (cos (* K 0.5))))))
(+ U (* J (- (exp l) 27.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (J * (l * (2.0 * cos((K * 0.5)))));
} else {
tmp = U + (J * (exp(l) - 27.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 <= (-63.0d0)) then
tmp = u + (j * (27.0d0 - exp(-l)))
else if (l <= 2.25d+14) then
tmp = u + (j * (l * (2.0d0 * cos((k * 0.5d0)))))
else
tmp = u + (j * (exp(l) - 27.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - Math.exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (J * (l * (2.0 * Math.cos((K * 0.5)))));
} else {
tmp = U + (J * (Math.exp(l) - 27.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -63.0: tmp = U + (J * (27.0 - math.exp(-l))) elif l <= 2.25e+14: tmp = U + (J * (l * (2.0 * math.cos((K * 0.5))))) else: tmp = U + (J * (math.exp(l) - 27.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -63.0) tmp = Float64(U + Float64(J * Float64(27.0 - exp(Float64(-l))))); elseif (l <= 2.25e+14) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 * cos(Float64(K * 0.5)))))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 27.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -63.0) tmp = U + (J * (27.0 - exp(-l))); elseif (l <= 2.25e+14) tmp = U + (J * (l * (2.0 * cos((K * 0.5))))); else tmp = U + (J * (exp(l) - 27.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -63.0], N[(U + N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.25e+14], N[(U + N[(J * N[(l * N[(2.0 * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -63:\\
\;\;\;\;U + J \cdot \left(27 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+14}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 27\right)\\
\end{array}
\end{array}
if l < -63Initial program 100.0%
Taylor expanded in K around 0 80.0%
Applied egg-rr80.0%
if -63 < l < 2.25e14Initial program 75.8%
Taylor expanded in l around 0 99.2%
unpow299.2%
Applied egg-rr99.2%
Taylor expanded in l around 0 99.1%
*-commutative99.1%
associate-*r*99.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
Simplified99.1%
if 2.25e14 < l Initial program 100.0%
Taylor expanded in K around 0 85.9%
Applied egg-rr85.9%
Final simplification91.0%
(FPCore (J l K U)
:precision binary64
(if (<= l -63.0)
(+ U (* J (- 27.0 (exp (- l)))))
(if (<= l 2.25e+14)
(+ U (* 2.0 (* J (* l (cos (* K 0.5))))))
(+ U (* J (- (exp l) 27.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
} else {
tmp = U + (J * (exp(l) - 27.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 <= (-63.0d0)) then
tmp = u + (j * (27.0d0 - exp(-l)))
else if (l <= 2.25d+14) then
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
else
tmp = u + (j * (exp(l) - 27.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -63.0) {
tmp = U + (J * (27.0 - Math.exp(-l)));
} else if (l <= 2.25e+14) {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
} else {
tmp = U + (J * (Math.exp(l) - 27.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -63.0: tmp = U + (J * (27.0 - math.exp(-l))) elif l <= 2.25e+14: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) else: tmp = U + (J * (math.exp(l) - 27.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -63.0) tmp = Float64(U + Float64(J * Float64(27.0 - exp(Float64(-l))))); elseif (l <= 2.25e+14) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 27.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -63.0) tmp = U + (J * (27.0 - exp(-l))); elseif (l <= 2.25e+14) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); else tmp = U + (J * (exp(l) - 27.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -63.0], N[(U + N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.25e+14], 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] - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -63:\\
\;\;\;\;U + J \cdot \left(27 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+14}:\\
\;\;\;\;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} - 27\right)\\
\end{array}
\end{array}
if l < -63Initial program 100.0%
Taylor expanded in K around 0 80.0%
Applied egg-rr80.0%
if -63 < l < 2.25e14Initial program 75.8%
Taylor expanded in l around 0 99.1%
if 2.25e14 < l Initial program 100.0%
Taylor expanded in K around 0 85.9%
Applied egg-rr85.9%
Final simplification91.0%
(FPCore (J l K U) :precision binary64 (if (<= l -5e-52) (+ U (* J (- 27.0 (exp (- l))))) (if (<= l 2.25e+14) (fma J (* l 2.0) U) (+ U (* J (- (exp l) 27.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -5e-52) {
tmp = U + (J * (27.0 - exp(-l)));
} else if (l <= 2.25e+14) {
tmp = fma(J, (l * 2.0), U);
} else {
tmp = U + (J * (exp(l) - 27.0));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -5e-52) tmp = Float64(U + Float64(J * Float64(27.0 - exp(Float64(-l))))); elseif (l <= 2.25e+14) tmp = fma(J, Float64(l * 2.0), U); else tmp = Float64(U + Float64(J * Float64(exp(l) - 27.0))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -5e-52], N[(U + N[(J * N[(27.0 - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.25e+14], N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-52}:\\
\;\;\;\;U + J \cdot \left(27 - e^{-\ell}\right)\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, U\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 27\right)\\
\end{array}
\end{array}
if l < -5e-52Initial program 94.4%
Taylor expanded in K around 0 76.2%
Applied egg-rr76.1%
if -5e-52 < l < 2.25e14Initial program 77.5%
Taylor expanded in l around 0 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
*-commutative99.1%
associate-*r*99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in K around 0 91.6%
+-commutative91.6%
associate-*r*91.6%
*-commutative91.6%
associate-*r*91.6%
fma-define91.6%
Simplified91.6%
if 2.25e14 < l Initial program 100.0%
Taylor expanded in K around 0 85.9%
Applied egg-rr85.9%
Final simplification85.7%
(FPCore (J l K U) :precision binary64 (if (<= l 2.2e+16) (* U (+ 1.0 (* 2.0 (* J (/ l U))))) (+ U (* J (- (exp l) 27.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.2e+16) {
tmp = U * (1.0 + (2.0 * (J * (l / U))));
} else {
tmp = U + (J * (exp(l) - 27.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 <= 2.2d+16) then
tmp = u * (1.0d0 + (2.0d0 * (j * (l / u))))
else
tmp = u + (j * (exp(l) - 27.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.2e+16) {
tmp = U * (1.0 + (2.0 * (J * (l / U))));
} else {
tmp = U + (J * (Math.exp(l) - 27.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 2.2e+16: tmp = U * (1.0 + (2.0 * (J * (l / U)))) else: tmp = U + (J * (math.exp(l) - 27.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 2.2e+16) tmp = Float64(U * Float64(1.0 + Float64(2.0 * Float64(J * Float64(l / U))))); else tmp = Float64(U + Float64(J * Float64(exp(l) - 27.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 2.2e+16) tmp = U * (1.0 + (2.0 * (J * (l / U)))); else tmp = U + (J * (exp(l) - 27.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 2.2e+16], N[(U * N[(1.0 + N[(2.0 * N[(J * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[Exp[l], $MachinePrecision] - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.2 \cdot 10^{+16}:\\
\;\;\;\;U \cdot \left(1 + 2 \cdot \left(J \cdot \frac{\ell}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(e^{\ell} - 27\right)\\
\end{array}
\end{array}
if l < 2.2e16Initial program 84.2%
Taylor expanded in l around 0 75.8%
*-commutative75.8%
*-commutative75.8%
associate-*l*75.8%
*-commutative75.8%
associate-*r*75.8%
*-commutative75.8%
associate-*l*75.8%
Simplified75.8%
Taylor expanded in J around inf 69.3%
Taylor expanded in K around 0 59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in U around inf 68.3%
associate-/l*69.8%
Simplified69.8%
if 2.2e16 < l Initial program 100.0%
Taylor expanded in K around 0 87.1%
Applied egg-rr87.1%
Final simplification74.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* l (* J 2.0))))
(if (<= l -125000000.0)
t_0
(if (<= l 3.6e+15) U (if (<= l 8.2e+210) (* U U) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = l * (J * 2.0);
double tmp;
if (l <= -125000000.0) {
tmp = t_0;
} else if (l <= 3.6e+15) {
tmp = U;
} else if (l <= 8.2e+210) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = l * (j * 2.0d0)
if (l <= (-125000000.0d0)) then
tmp = t_0
else if (l <= 3.6d+15) then
tmp = u
else if (l <= 8.2d+210) then
tmp = u * u
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = l * (J * 2.0);
double tmp;
if (l <= -125000000.0) {
tmp = t_0;
} else if (l <= 3.6e+15) {
tmp = U;
} else if (l <= 8.2e+210) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = l * (J * 2.0) tmp = 0 if l <= -125000000.0: tmp = t_0 elif l <= 3.6e+15: tmp = U elif l <= 8.2e+210: tmp = U * U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(l * Float64(J * 2.0)) tmp = 0.0 if (l <= -125000000.0) tmp = t_0; elseif (l <= 3.6e+15) tmp = U; elseif (l <= 8.2e+210) tmp = Float64(U * U); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = l * (J * 2.0); tmp = 0.0; if (l <= -125000000.0) tmp = t_0; elseif (l <= 3.6e+15) tmp = U; elseif (l <= 8.2e+210) tmp = U * U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -125000000.0], t$95$0, If[LessEqual[l, 3.6e+15], U, If[LessEqual[l, 8.2e+210], N[(U * U), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(J \cdot 2\right)\\
\mathbf{if}\;\ell \leq -125000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 3.6 \cdot 10^{+15}:\\
\;\;\;\;U\\
\mathbf{elif}\;\ell \leq 8.2 \cdot 10^{+210}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.25e8 or 8.20000000000000002e210 < l Initial program 100.0%
Taylor expanded in l around 0 32.6%
*-commutative32.6%
*-commutative32.6%
associate-*l*32.6%
*-commutative32.6%
associate-*r*32.6%
*-commutative32.6%
associate-*l*32.6%
Simplified32.6%
Taylor expanded in J around inf 34.7%
Taylor expanded in K around 0 28.6%
*-commutative28.6%
Simplified28.6%
Taylor expanded in J around inf 26.8%
associate-*r*26.8%
*-commutative26.8%
Simplified26.8%
if -1.25e8 < l < 3.6e15Initial program 76.2%
Taylor expanded in J around 0 73.5%
if 3.6e15 < l < 8.20000000000000002e210Initial program 100.0%
Applied egg-rr31.7%
Final simplification51.0%
(FPCore (J l K U) :precision binary64 (if (<= l 4e+15) (+ U (* l (* J 2.0))) (if (<= l 6.2e+210) (* U U) (* J (+ (* l 2.0) (/ U J))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 4e+15) {
tmp = U + (l * (J * 2.0));
} else if (l <= 6.2e+210) {
tmp = U * U;
} else {
tmp = J * ((l * 2.0) + (U / J));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 4d+15) then
tmp = u + (l * (j * 2.0d0))
else if (l <= 6.2d+210) then
tmp = u * u
else
tmp = j * ((l * 2.0d0) + (u / j))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 4e+15) {
tmp = U + (l * (J * 2.0));
} else if (l <= 6.2e+210) {
tmp = U * U;
} else {
tmp = J * ((l * 2.0) + (U / J));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 4e+15: tmp = U + (l * (J * 2.0)) elif l <= 6.2e+210: tmp = U * U else: tmp = J * ((l * 2.0) + (U / J)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 4e+15) tmp = Float64(U + Float64(l * Float64(J * 2.0))); elseif (l <= 6.2e+210) tmp = Float64(U * U); else tmp = Float64(J * Float64(Float64(l * 2.0) + Float64(U / J))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 4e+15) tmp = U + (l * (J * 2.0)); elseif (l <= 6.2e+210) tmp = U * U; else tmp = J * ((l * 2.0) + (U / J)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 4e+15], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.2e+210], N[(U * U), $MachinePrecision], N[(J * N[(N[(l * 2.0), $MachinePrecision] + N[(U / J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4 \cdot 10^{+15}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+210}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\ell \cdot 2 + \frac{U}{J}\right)\\
\end{array}
\end{array}
if l < 4e15Initial program 84.1%
Taylor expanded in l around 0 76.1%
*-commutative76.1%
*-commutative76.1%
associate-*l*76.2%
*-commutative76.2%
associate-*r*76.2%
*-commutative76.2%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in K around 0 66.4%
if 4e15 < l < 6.1999999999999999e210Initial program 100.0%
Applied egg-rr31.7%
if 6.1999999999999999e210 < l Initial program 100.0%
Taylor expanded in l around 0 32.6%
*-commutative32.6%
*-commutative32.6%
associate-*l*32.6%
*-commutative32.6%
associate-*r*32.6%
*-commutative32.6%
associate-*l*32.6%
Simplified32.6%
Taylor expanded in J around inf 36.1%
Taylor expanded in K around 0 35.4%
*-commutative35.4%
Simplified35.4%
Final simplification58.3%
(FPCore (J l K U) :precision binary64 (if (<= l 2.35e+17) (+ U (* l (* J 2.0))) (* J (+ (* l 2.0) (* U (* J -3.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.35e+17) {
tmp = U + (l * (J * 2.0));
} else {
tmp = J * ((l * 2.0) + (U * (J * -3.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 <= 2.35d+17) then
tmp = u + (l * (j * 2.0d0))
else
tmp = j * ((l * 2.0d0) + (u * (j * (-3.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.35e+17) {
tmp = U + (l * (J * 2.0));
} else {
tmp = J * ((l * 2.0) + (U * (J * -3.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 2.35e+17: tmp = U + (l * (J * 2.0)) else: tmp = J * ((l * 2.0) + (U * (J * -3.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 2.35e+17) tmp = Float64(U + Float64(l * Float64(J * 2.0))); else tmp = Float64(J * Float64(Float64(l * 2.0) + Float64(U * Float64(J * -3.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 2.35e+17) tmp = U + (l * (J * 2.0)); else tmp = J * ((l * 2.0) + (U * (J * -3.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 2.35e+17], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(J * N[(N[(l * 2.0), $MachinePrecision] + N[(U * N[(J * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.35 \cdot 10^{+17}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\ell \cdot 2 + U \cdot \left(J \cdot -3\right)\right)\\
\end{array}
\end{array}
if l < 2.35e17Initial program 84.2%
Taylor expanded in l around 0 75.4%
*-commutative75.4%
*-commutative75.4%
associate-*l*75.4%
*-commutative75.4%
associate-*r*75.4%
*-commutative75.4%
associate-*l*75.4%
Simplified75.4%
Taylor expanded in K around 0 65.8%
if 2.35e17 < l Initial program 100.0%
Taylor expanded in l around 0 21.5%
*-commutative21.5%
*-commutative21.5%
associate-*l*21.5%
*-commutative21.5%
associate-*r*21.5%
*-commutative21.5%
associate-*l*21.5%
Simplified21.5%
Taylor expanded in J around inf 26.2%
Taylor expanded in K around 0 24.0%
*-commutative24.0%
Simplified24.0%
Applied egg-rr29.0%
associate-*l*29.0%
Simplified29.0%
Final simplification57.0%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* l (* J 2.0)))) (if (<= l 6e+15) (+ U t_0) (if (<= l 6.5e+210) (* U U) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = l * (J * 2.0);
double tmp;
if (l <= 6e+15) {
tmp = U + t_0;
} else if (l <= 6.5e+210) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = l * (j * 2.0d0)
if (l <= 6d+15) then
tmp = u + t_0
else if (l <= 6.5d+210) then
tmp = u * u
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = l * (J * 2.0);
double tmp;
if (l <= 6e+15) {
tmp = U + t_0;
} else if (l <= 6.5e+210) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = l * (J * 2.0) tmp = 0 if l <= 6e+15: tmp = U + t_0 elif l <= 6.5e+210: tmp = U * U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(l * Float64(J * 2.0)) tmp = 0.0 if (l <= 6e+15) tmp = Float64(U + t_0); elseif (l <= 6.5e+210) tmp = Float64(U * U); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = l * (J * 2.0); tmp = 0.0; if (l <= 6e+15) tmp = U + t_0; elseif (l <= 6.5e+210) tmp = U * U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 6e+15], N[(U + t$95$0), $MachinePrecision], If[LessEqual[l, 6.5e+210], N[(U * U), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(J \cdot 2\right)\\
\mathbf{if}\;\ell \leq 6 \cdot 10^{+15}:\\
\;\;\;\;U + t\_0\\
\mathbf{elif}\;\ell \leq 6.5 \cdot 10^{+210}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < 6e15Initial program 84.1%
Taylor expanded in l around 0 76.1%
*-commutative76.1%
*-commutative76.1%
associate-*l*76.2%
*-commutative76.2%
associate-*r*76.2%
*-commutative76.2%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in K around 0 66.4%
if 6e15 < l < 6.4999999999999996e210Initial program 100.0%
Applied egg-rr31.7%
if 6.4999999999999996e210 < l Initial program 100.0%
Taylor expanded in l around 0 32.6%
*-commutative32.6%
*-commutative32.6%
associate-*l*32.6%
*-commutative32.6%
associate-*r*32.6%
*-commutative32.6%
associate-*l*32.6%
Simplified32.6%
Taylor expanded in J around inf 36.1%
Taylor expanded in K around 0 35.4%
*-commutative35.4%
Simplified35.4%
Taylor expanded in J around inf 32.2%
associate-*r*32.2%
*-commutative32.2%
Simplified32.2%
Final simplification57.9%
(FPCore (J l K U) :precision binary64 (if (<= l 3.4e+17) (+ U (* l (* J 2.0))) (* J (- (* l 2.0) (* J U)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 3.4e+17) {
tmp = U + (l * (J * 2.0));
} else {
tmp = J * ((l * 2.0) - (J * 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 <= 3.4d+17) then
tmp = u + (l * (j * 2.0d0))
else
tmp = j * ((l * 2.0d0) - (j * u))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 3.4e+17) {
tmp = U + (l * (J * 2.0));
} else {
tmp = J * ((l * 2.0) - (J * U));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 3.4e+17: tmp = U + (l * (J * 2.0)) else: tmp = J * ((l * 2.0) - (J * U)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 3.4e+17) tmp = Float64(U + Float64(l * Float64(J * 2.0))); else tmp = Float64(J * Float64(Float64(l * 2.0) - Float64(J * U))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 3.4e+17) tmp = U + (l * (J * 2.0)); else tmp = J * ((l * 2.0) - (J * U)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 3.4e+17], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(J * N[(N[(l * 2.0), $MachinePrecision] - N[(J * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.4 \cdot 10^{+17}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\ell \cdot 2 - J \cdot U\right)\\
\end{array}
\end{array}
if l < 3.4e17Initial program 84.2%
Taylor expanded in l around 0 75.4%
*-commutative75.4%
*-commutative75.4%
associate-*l*75.4%
*-commutative75.4%
associate-*r*75.4%
*-commutative75.4%
associate-*l*75.4%
Simplified75.4%
Taylor expanded in K around 0 65.8%
if 3.4e17 < l Initial program 100.0%
Taylor expanded in l around 0 21.5%
*-commutative21.5%
*-commutative21.5%
associate-*l*21.5%
*-commutative21.5%
associate-*r*21.5%
*-commutative21.5%
associate-*l*21.5%
Simplified21.5%
Taylor expanded in J around inf 26.2%
Taylor expanded in K around 0 24.0%
*-commutative24.0%
Simplified24.0%
Applied egg-rr20.8%
fma-undefine20.8%
*-commutative20.8%
distribute-lft1-in20.8%
metadata-eval20.8%
distribute-rgt1-in29.0%
metadata-eval29.0%
neg-mul-129.0%
distribute-rgt-neg-in29.0%
Simplified29.0%
Final simplification57.0%
(FPCore (J l K U) :precision binary64 (if (or (<= l -35000000000.0) (not (<= l 3.6e+15))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -35000000000.0) || !(l <= 3.6e+15)) {
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 <= (-35000000000.0d0)) .or. (.not. (l <= 3.6d+15))) 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 <= -35000000000.0) || !(l <= 3.6e+15)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -35000000000.0) or not (l <= 3.6e+15): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -35000000000.0) || !(l <= 3.6e+15)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -35000000000.0) || ~((l <= 3.6e+15))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -35000000000.0], N[Not[LessEqual[l, 3.6e+15]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -35000000000 \lor \neg \left(\ell \leq 3.6 \cdot 10^{+15}\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -3.5e10 or 3.6e15 < l Initial program 100.0%
Applied egg-rr19.0%
if -3.5e10 < l < 3.6e15Initial program 76.5%
Taylor expanded in J around 0 72.4%
Final simplification46.3%
(FPCore (J l K U) :precision binary64 (if (<= l -6.2e+14) (* U (- U -4.0)) (if (<= l 4e+15) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -6.2e+14) {
tmp = U * (U - -4.0);
} else if (l <= 4e+15) {
tmp = U;
} else {
tmp = 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 <= (-6.2d+14)) then
tmp = u * (u - (-4.0d0))
else if (l <= 4d+15) then
tmp = u
else
tmp = u * u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -6.2e+14) {
tmp = U * (U - -4.0);
} else if (l <= 4e+15) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -6.2e+14: tmp = U * (U - -4.0) elif l <= 4e+15: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -6.2e+14) tmp = Float64(U * Float64(U - -4.0)); elseif (l <= 4e+15) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -6.2e+14) tmp = U * (U - -4.0); elseif (l <= 4e+15) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -6.2e+14], N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4e+15], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{+14}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{+15}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -6.2e14Initial program 100.0%
Applied egg-rr15.8%
if -6.2e14 < l < 4e15Initial program 76.5%
Taylor expanded in J around 0 72.4%
if 4e15 < l Initial program 100.0%
Applied egg-rr22.1%
(FPCore (J l K U) :precision binary64 (* U (+ 1.0 (* 2.0 (* J (/ l U))))))
double code(double J, double l, double K, double U) {
return U * (1.0 + (2.0 * (J * (l / 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 * (1.0d0 + (2.0d0 * (j * (l / u))))
end function
public static double code(double J, double l, double K, double U) {
return U * (1.0 + (2.0 * (J * (l / U))));
}
def code(J, l, K, U): return U * (1.0 + (2.0 * (J * (l / U))))
function code(J, l, K, U) return Float64(U * Float64(1.0 + Float64(2.0 * Float64(J * Float64(l / U))))) end
function tmp = code(J, l, K, U) tmp = U * (1.0 + (2.0 * (J * (l / U)))); end
code[J_, l_, K_, U_] := N[(U * N[(1.0 + N[(2.0 * N[(J * N[(l / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U \cdot \left(1 + 2 \cdot \left(J \cdot \frac{\ell}{U}\right)\right)
\end{array}
Initial program 88.0%
Taylor expanded in l around 0 62.6%
*-commutative62.6%
*-commutative62.6%
associate-*l*62.6%
*-commutative62.6%
associate-*r*62.6%
*-commutative62.6%
associate-*l*62.6%
Simplified62.6%
Taylor expanded in J around inf 58.8%
Taylor expanded in K around 0 50.9%
*-commutative50.9%
Simplified50.9%
Taylor expanded in U around inf 60.4%
associate-/l*63.4%
Simplified63.4%
(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 88.0%
Taylor expanded in J around 0 38.0%
(FPCore (J l K U) :precision binary64 J)
double code(double J, double l, double K, double U) {
return J;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = j
end function
public static double code(double J, double l, double K, double U) {
return J;
}
def code(J, l, K, U): return J
function code(J, l, K, U) return J end
function tmp = code(J, l, K, U) tmp = J; end
code[J_, l_, K_, U_] := J
\begin{array}{l}
\\
J
\end{array}
Initial program 88.0%
Taylor expanded in l around 0 62.6%
*-commutative62.6%
*-commutative62.6%
associate-*l*62.6%
*-commutative62.6%
associate-*r*62.6%
*-commutative62.6%
associate-*l*62.6%
Simplified62.6%
Taylor expanded in J around inf 58.8%
Taylor expanded in K around 0 50.9%
*-commutative50.9%
Simplified50.9%
Applied egg-rr5.0%
*-commutative5.0%
associate-/l*3.1%
*-inverses3.1%
*-rgt-identity3.1%
Simplified3.1%
(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 88.0%
Applied egg-rr2.7%
Taylor expanded in U around 0 2.9%
herbie shell --seed 2024181
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))