
(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))) (t_2 (- (exp l) t_1)))
(if (<= t_2 (- INFINITY))
(+ (* (* J (- 27.0 t_1)) t_0) U)
(if (<= t_2 0.0) (+ 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 <= 0.0) {
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 <= 0.0) {
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 <= 0.0: 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 <= 0.0) 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 <= 0.0) 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, 0.0], 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 0:\\
\;\;\;\;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))) < 0.0Initial program 71.4%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
if 0.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(if (or (<= l -3.6e+108)
(not (or (<= l -0.021) (and (not (<= l 15000000.0)) (<= l 7.2e+98)))))
(+ U (* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))
(+ U (* (- (exp l) (exp (- l))) J))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -3.6e+108) || !((l <= -0.021) || (!(l <= 15000000.0) && (l <= 7.2e+98)))) {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + ((exp(l) - exp(-l)) * 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 <= (-3.6d+108)) .or. (.not. (l <= (-0.021d0)) .or. (.not. (l <= 15000000.0d0)) .and. (l <= 7.2d+98))) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
else
tmp = u + ((exp(l) - exp(-l)) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -3.6e+108) || !((l <= -0.021) || (!(l <= 15000000.0) && (l <= 7.2e+98)))) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + ((Math.exp(l) - Math.exp(-l)) * J);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -3.6e+108) or not ((l <= -0.021) or (not (l <= 15000000.0) and (l <= 7.2e+98))): tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) else: tmp = U + ((math.exp(l) - math.exp(-l)) * J) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -3.6e+108) || !((l <= -0.021) || (!(l <= 15000000.0) && (l <= 7.2e+98)))) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); else tmp = Float64(U + Float64(Float64(exp(l) - exp(Float64(-l))) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -3.6e+108) || ~(((l <= -0.021) || (~((l <= 15000000.0)) && (l <= 7.2e+98))))) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); else tmp = U + ((exp(l) - exp(-l)) * J); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -3.6e+108], N[Not[Or[LessEqual[l, -0.021], And[N[Not[LessEqual[l, 15000000.0]], $MachinePrecision], LessEqual[l, 7.2e+98]]]], $MachinePrecision]], 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], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.6 \cdot 10^{+108} \lor \neg \left(\ell \leq -0.021 \lor \neg \left(\ell \leq 15000000\right) \land \ell \leq 7.2 \cdot 10^{+98}\right):\\
\;\;\;\;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{else}:\\
\;\;\;\;U + \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\end{array}
\end{array}
if l < -3.6e108 or -0.0210000000000000013 < l < 1.5e7 or 7.19999999999999962e98 < l Initial program 84.0%
Taylor expanded in l around 0 99.2%
unpow299.2%
Applied egg-rr99.2%
if -3.6e108 < l < -0.0210000000000000013 or 1.5e7 < l < 7.19999999999999962e98Initial program 100.0%
Taylor expanded in K around 0 72.1%
Final simplification94.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (exp (- l))))
(if (<= l -4.0)
(+ (* (* J (- 27.0 t_1)) t_0) U)
(if (<= l 15000000.0)
(+ U (* t_0 (* J (+ (* l 2.0) (* 0.3333333333333333 (pow l 3.0))))))
(if (<= l 5.8e+98)
(+ U (* (- (exp l) t_1) J))
(+ U (* t_0 (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l))))))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = exp(-l);
double tmp;
if (l <= -4.0) {
tmp = ((J * (27.0 - t_1)) * t_0) + U;
} else if (l <= 15000000.0) {
tmp = U + (t_0 * (J * ((l * 2.0) + (0.3333333333333333 * pow(l, 3.0)))));
} else if (l <= 5.8e+98) {
tmp = U + ((exp(l) - t_1) * J);
} else {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(-l)
if (l <= (-4.0d0)) then
tmp = ((j * (27.0d0 - t_1)) * t_0) + u
else if (l <= 15000000.0d0) then
tmp = u + (t_0 * (j * ((l * 2.0d0) + (0.3333333333333333d0 * (l ** 3.0d0)))))
else if (l <= 5.8d+98) then
tmp = u + ((exp(l) - t_1) * j)
else
tmp = u + (t_0 * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(-l);
double tmp;
if (l <= -4.0) {
tmp = ((J * (27.0 - t_1)) * t_0) + U;
} else if (l <= 15000000.0) {
tmp = U + (t_0 * (J * ((l * 2.0) + (0.3333333333333333 * Math.pow(l, 3.0)))));
} else if (l <= 5.8e+98) {
tmp = U + ((Math.exp(l) - t_1) * J);
} else {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = math.exp(-l) tmp = 0 if l <= -4.0: tmp = ((J * (27.0 - t_1)) * t_0) + U elif l <= 15000000.0: tmp = U + (t_0 * (J * ((l * 2.0) + (0.3333333333333333 * math.pow(l, 3.0))))) elif l <= 5.8e+98: tmp = U + ((math.exp(l) - t_1) * J) else: tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = exp(Float64(-l)) tmp = 0.0 if (l <= -4.0) tmp = Float64(Float64(Float64(J * Float64(27.0 - t_1)) * t_0) + U); elseif (l <= 15000000.0) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(Float64(l * 2.0) + Float64(0.3333333333333333 * (l ^ 3.0)))))); elseif (l <= 5.8e+98) tmp = Float64(U + Float64(Float64(exp(l) - t_1) * J)); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(-l); tmp = 0.0; if (l <= -4.0) tmp = ((J * (27.0 - t_1)) * t_0) + U; elseif (l <= 15000000.0) tmp = U + (t_0 * (J * ((l * 2.0) + (0.3333333333333333 * (l ^ 3.0))))); elseif (l <= 5.8e+98) tmp = U + ((exp(l) - t_1) * J); else tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-l)], $MachinePrecision]}, If[LessEqual[l, -4.0], N[(N[(N[(J * N[(27.0 - t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 15000000.0], N[(U + N[(t$95$0 * N[(J * N[(N[(l * 2.0), $MachinePrecision] + N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+98], N[(U + N[(N[(N[Exp[l], $MachinePrecision] - t$95$1), $MachinePrecision] * J), $MachinePrecision]), $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]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{-\ell}\\
\mathbf{if}\;\ell \leq -4:\\
\;\;\;\;\left(J \cdot \left(27 - t\_1\right)\right) \cdot t\_0 + U\\
\mathbf{elif}\;\ell \leq 15000000:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot 2 + 0.3333333333333333 \cdot {\ell}^{3}\right)\right)\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+98}:\\
\;\;\;\;U + \left(e^{\ell} - t\_1\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \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 < -4Initial program 100.0%
Applied egg-rr100.0%
if -4 < l < 1.5e7Initial program 72.3%
Taylor expanded in l around 0 98.6%
distribute-lft-in98.6%
*-commutative98.6%
associate-*l*98.6%
unpow298.6%
pow398.6%
Applied egg-rr98.6%
if 1.5e7 < l < 5.8000000000000002e98Initial program 100.0%
Taylor expanded in K around 0 68.0%
if 5.8000000000000002e98 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
unpow2100.0%
Applied egg-rr100.0%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (exp (- l))))
(if (<= l -4.0)
(+ (* (* J (- 27.0 t_1)) t_0) U)
(if (or (<= l 15000000.0) (not (<= l 7e+98)))
(+ U (* t_0 (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))
(+ U (* (- (exp l) t_1) J))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = exp(-l);
double tmp;
if (l <= -4.0) {
tmp = ((J * (27.0 - t_1)) * t_0) + U;
} else if ((l <= 15000000.0) || !(l <= 7e+98)) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + ((exp(l) - t_1) * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(-l)
if (l <= (-4.0d0)) then
tmp = ((j * (27.0d0 - t_1)) * t_0) + u
else if ((l <= 15000000.0d0) .or. (.not. (l <= 7d+98))) then
tmp = u + (t_0 * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
else
tmp = u + ((exp(l) - t_1) * j)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(-l);
double tmp;
if (l <= -4.0) {
tmp = ((J * (27.0 - t_1)) * t_0) + U;
} else if ((l <= 15000000.0) || !(l <= 7e+98)) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + ((Math.exp(l) - t_1) * J);
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = math.exp(-l) tmp = 0 if l <= -4.0: tmp = ((J * (27.0 - t_1)) * t_0) + U elif (l <= 15000000.0) or not (l <= 7e+98): tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) else: tmp = U + ((math.exp(l) - t_1) * J) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = exp(Float64(-l)) tmp = 0.0 if (l <= -4.0) tmp = Float64(Float64(Float64(J * Float64(27.0 - t_1)) * t_0) + U); elseif ((l <= 15000000.0) || !(l <= 7e+98)) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); else tmp = Float64(U + Float64(Float64(exp(l) - t_1) * J)); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(-l); tmp = 0.0; if (l <= -4.0) tmp = ((J * (27.0 - t_1)) * t_0) + U; elseif ((l <= 15000000.0) || ~((l <= 7e+98))) tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); else tmp = U + ((exp(l) - t_1) * 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]}, If[LessEqual[l, -4.0], N[(N[(N[(J * N[(27.0 - t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], If[Or[LessEqual[l, 15000000.0], N[Not[LessEqual[l, 7e+98]], $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[(N[(N[Exp[l], $MachinePrecision] - t$95$1), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{-\ell}\\
\mathbf{if}\;\ell \leq -4:\\
\;\;\;\;\left(J \cdot \left(27 - t\_1\right)\right) \cdot t\_0 + U\\
\mathbf{elif}\;\ell \leq 15000000 \lor \neg \left(\ell \leq 7 \cdot 10^{+98}\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 + \left(e^{\ell} - t\_1\right) \cdot J\\
\end{array}
\end{array}
if l < -4Initial program 100.0%
Applied egg-rr100.0%
if -4 < l < 1.5e7 or 7e98 < l Initial program 80.9%
Taylor expanded in l around 0 99.1%
unpow299.1%
Applied egg-rr99.1%
if 1.5e7 < l < 7e98Initial program 100.0%
Taylor expanded in K around 0 68.0%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.04)
(+ U (* t_0 (* J (* l 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.04) {
tmp = U + (t_0 * (J * (l * 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.04d0)) then
tmp = u + (t_0 * (j * (l * 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.04) {
tmp = U + (t_0 * (J * (l * 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.04: tmp = U + (t_0 * (J * (l * 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.04) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * 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.04) tmp = U + (t_0 * (J * (l * 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.04], N[(U + N[(t$95$0 * N[(J * N[(l * 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.04:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \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.0400000000000000008Initial program 86.0%
Taylor expanded in l around 0 55.8%
*-commutative55.8%
associate-*l*55.8%
Simplified55.8%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 86.9%
Taylor expanded in l around 0 88.4%
Taylor expanded in K around 0 84.6%
Final simplification77.0%
(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 86.7%
Taylor expanded in l around 0 87.3%
unpow287.3%
Applied egg-rr87.3%
Final simplification87.3%
(FPCore (J l K U) :precision binary64 (if (<= l -1.15e+64) (+ 0.25 (* (pow U 3.0) -16.0)) (if (<= l 700.0) U (pow U -4.0))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.15e+64) {
tmp = 0.25 + (pow(U, 3.0) * -16.0);
} else if (l <= 700.0) {
tmp = U;
} else {
tmp = pow(U, -4.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.15d+64)) then
tmp = 0.25d0 + ((u ** 3.0d0) * (-16.0d0))
else if (l <= 700.0d0) then
tmp = u
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.15e+64) {
tmp = 0.25 + (Math.pow(U, 3.0) * -16.0);
} else if (l <= 700.0) {
tmp = U;
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1.15e+64: tmp = 0.25 + (math.pow(U, 3.0) * -16.0) elif l <= 700.0: tmp = U else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1.15e+64) tmp = Float64(0.25 + Float64((U ^ 3.0) * -16.0)); elseif (l <= 700.0) tmp = U; else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -1.15e+64) tmp = 0.25 + ((U ^ 3.0) * -16.0); elseif (l <= 700.0) tmp = U; else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.15e+64], N[(0.25 + N[(N[Power[U, 3.0], $MachinePrecision] * -16.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 700.0], U, N[Power[U, -4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{+64}:\\
\;\;\;\;0.25 + {U}^{3} \cdot -16\\
\mathbf{elif}\;\ell \leq 700:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < -1.15e64Initial program 100.0%
Applied egg-rr1.8%
flip3-+5.6%
metadata-eval5.6%
metadata-eval5.6%
distribute-rgt-out--5.6%
Applied egg-rr5.6%
Taylor expanded in U around 0 10.3%
frac-2neg10.3%
div-inv10.3%
+-commutative10.3%
distribute-neg-in10.3%
unpow310.3%
distribute-rgt-neg-out10.3%
add-sqr-sqrt2.9%
sqrt-unprod14.2%
sqr-neg14.2%
sqrt-unprod11.3%
add-sqr-sqrt22.6%
unpow322.6%
metadata-eval22.6%
metadata-eval22.6%
metadata-eval22.6%
Applied egg-rr22.6%
*-commutative22.6%
+-commutative22.6%
distribute-rgt-in22.6%
metadata-eval22.6%
Simplified22.6%
if -1.15e64 < l < 700Initial program 73.4%
Taylor expanded in J around 0 68.0%
if 700 < l Initial program 100.0%
Applied egg-rr27.0%
(FPCore (J l K U) :precision binary64 (if (<= l -950.0) (pow U -3.0) (if (<= l 780.0) U (pow U -4.0))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -950.0) {
tmp = pow(U, -3.0);
} else if (l <= 780.0) {
tmp = U;
} else {
tmp = pow(U, -4.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 <= (-950.0d0)) then
tmp = u ** (-3.0d0)
else if (l <= 780.0d0) then
tmp = u
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -950.0) {
tmp = Math.pow(U, -3.0);
} else if (l <= 780.0) {
tmp = U;
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -950.0: tmp = math.pow(U, -3.0) elif l <= 780.0: tmp = U else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -950.0) tmp = U ^ -3.0; elseif (l <= 780.0) tmp = U; else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -950.0) tmp = U ^ -3.0; elseif (l <= 780.0) tmp = U; else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -950.0], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 780.0], U, N[Power[U, -4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -950:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 780:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < -950Initial program 100.0%
Applied egg-rr18.0%
if -950 < l < 780Initial program 72.1%
Taylor expanded in J around 0 71.2%
if 780 < l Initial program 100.0%
Applied egg-rr27.0%
(FPCore (J l K U) :precision binary64 (if (<= l -1.3e+53) (* U U) (if (<= l 750.0) U (pow U -4.0))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.3e+53) {
tmp = U * U;
} else if (l <= 750.0) {
tmp = U;
} else {
tmp = pow(U, -4.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.3d+53)) then
tmp = u * u
else if (l <= 750.0d0) then
tmp = u
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.3e+53) {
tmp = U * U;
} else if (l <= 750.0) {
tmp = U;
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -1.3e+53: tmp = U * U elif l <= 750.0: tmp = U else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -1.3e+53) tmp = Float64(U * U); elseif (l <= 750.0) tmp = U; else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -1.3e+53) tmp = U * U; elseif (l <= 750.0) tmp = U; else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.3e+53], N[(U * U), $MachinePrecision], If[LessEqual[l, 750.0], U, N[Power[U, -4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{+53}:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 750:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < -1.29999999999999999e53Initial program 100.0%
Applied egg-rr17.9%
if -1.29999999999999999e53 < l < 750Initial program 73.0%
Taylor expanded in J around 0 69.0%
if 750 < l Initial program 100.0%
Applied egg-rr27.0%
(FPCore (J l K U) :precision binary64 (+ U (* (cos (/ K 2.0)) (* J (* l 2.0)))))
double code(double J, double l, double K, double U) {
return U + (cos((K / 2.0)) * (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 + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
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)));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * (l * 2.0)))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); end
code[J_, l_, K_, U_] := N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)
\end{array}
Initial program 86.7%
Taylor expanded in l around 0 64.0%
*-commutative64.0%
associate-*l*64.0%
Simplified64.0%
Final simplification64.0%
(FPCore (J l K U) :precision binary64 (+ U (* 2.0 (* J (* l (cos (* K 0.5)))))))
double code(double J, double l, double K, double U) {
return U + (2.0 * (J * (l * 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 + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
end function
public static double code(double J, double l, double K, double U) {
return U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
}
def code(J, l, K, U): return U + (2.0 * (J * (l * math.cos((K * 0.5)))))
function code(J, l, K, U) return Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))) end
function tmp = code(J, l, K, U) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); end
code[J_, l_, K_, U_] := N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)
\end{array}
Initial program 86.7%
Taylor expanded in l around 0 64.0%
Final simplification64.0%
(FPCore (J l K U) :precision binary64 (if (<= l -4.9e+48) (* U U) (if (<= l 2.05e+27) U (* U (- U -4.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.9e+48) {
tmp = U * U;
} else if (l <= 2.05e+27) {
tmp = U;
} else {
tmp = U * (U - -4.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 <= (-4.9d+48)) then
tmp = u * u
else if (l <= 2.05d+27) then
tmp = u
else
tmp = u * (u - (-4.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4.9e+48) {
tmp = U * U;
} else if (l <= 2.05e+27) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -4.9e+48: tmp = U * U elif l <= 2.05e+27: tmp = U else: tmp = U * (U - -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -4.9e+48) tmp = Float64(U * U); elseif (l <= 2.05e+27) tmp = U; else tmp = Float64(U * Float64(U - -4.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -4.9e+48) tmp = U * U; elseif (l <= 2.05e+27) tmp = U; else tmp = U * (U - -4.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -4.9e+48], N[(U * U), $MachinePrecision], If[LessEqual[l, 2.05e+27], U, N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.9 \cdot 10^{+48}:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 2.05 \cdot 10^{+27}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\end{array}
\end{array}
if l < -4.9000000000000003e48Initial program 100.0%
Applied egg-rr17.9%
if -4.9000000000000003e48 < l < 2.0500000000000001e27Initial program 74.0%
Taylor expanded in J around 0 66.5%
if 2.0500000000000001e27 < l Initial program 100.0%
Applied egg-rr14.6%
(FPCore (J l K U) :precision binary64 (if (or (<= l -1.02e+48) (not (<= l 4.5e+47))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.02e+48) || !(l <= 4.5e+47)) {
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 <= (-1.02d+48)) .or. (.not. (l <= 4.5d+47))) 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 <= -1.02e+48) || !(l <= 4.5e+47)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -1.02e+48) or not (l <= 4.5e+47): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -1.02e+48) || !(l <= 4.5e+47)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -1.02e+48) || ~((l <= 4.5e+47))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -1.02e+48], N[Not[LessEqual[l, 4.5e+47]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.02 \cdot 10^{+48} \lor \neg \left(\ell \leq 4.5 \cdot 10^{+47}\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -1.02e48 or 4.49999999999999979e47 < l Initial program 100.0%
Applied egg-rr16.4%
if -1.02e48 < l < 4.49999999999999979e47Initial program 75.0%
Taylor expanded in J around 0 64.1%
Final simplification41.8%
(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.7%
Taylor expanded in J around 0 34.9%
(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.7%
Applied egg-rr25.3%
Taylor expanded in U around 0 2.7%
herbie shell --seed 2024144
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))