
(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 19 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 (- (exp l) (exp (- l)))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 2e-10)))
(+ (* (* t_0 J) (cos (/ K 2.0))) U)
(fma
l
(* (cos (* K 0.5)) (* J (fma 0.3333333333333333 (pow l 2.0) 2.0)))
U))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 2e-10)) {
tmp = ((t_0 * J) * cos((K / 2.0))) + U;
} else {
tmp = fma(l, (cos((K * 0.5)) * (J * fma(0.3333333333333333, pow(l, 2.0), 2.0))), U);
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 2e-10)) tmp = Float64(Float64(Float64(t_0 * J) * cos(Float64(K / 2.0))) + U); else tmp = fma(l, Float64(cos(Float64(K * 0.5)) * Float64(J * fma(0.3333333333333333, (l ^ 2.0), 2.0))), U); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 2e-10]], $MachinePrecision]], N[(N[(N[(t$95$0 * J), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_0 \leq -\infty \lor \neg \left(t\_0 \leq 2 \cdot 10^{-10}\right):\\
\;\;\;\;\left(t\_0 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right) + U\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, \cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333, {\ell}^{2}, 2\right)\right), U\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 2.00000000000000007e-10 < (-.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))) < 2.00000000000000007e-10Initial program 68.0%
Taylor expanded in l around 0 99.9%
+-commutative99.9%
fma-define99.9%
associate-*r*99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-rgt-out99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
distribute-lft-out99.9%
fma-define99.9%
Simplified99.9%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 2e-10)))
(+ (* (* t_0 J) (cos (/ K 2.0))) U)
(+ U (* l (* (cos (* K 0.5)) (* J 2.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 2e-10)) {
tmp = ((t_0 * J) * cos((K / 2.0))) + U;
} else {
tmp = U + (l * (cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 2e-10)) {
tmp = ((t_0 * J) * Math.cos((K / 2.0))) + U;
} else {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) tmp = 0 if (t_0 <= -math.inf) or not (t_0 <= 2e-10): tmp = ((t_0 * J) * math.cos((K / 2.0))) + U else: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) return tmp
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 2e-10)) tmp = Float64(Float64(Float64(t_0 * J) * cos(Float64(K / 2.0))) + U); else tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = exp(l) - exp(-l); tmp = 0.0; if ((t_0 <= -Inf) || ~((t_0 <= 2e-10))) tmp = ((t_0 * J) * cos((K / 2.0))) + U; else tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 2e-10]], $MachinePrecision]], N[(N[(N[(t$95$0 * J), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_0 \leq -\infty \lor \neg \left(t\_0 \leq 2 \cdot 10^{-10}\right):\\
\;\;\;\;\left(t\_0 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 2.00000000000000007e-10 < (-.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))) < 2.00000000000000007e-10Initial program 68.0%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*r*99.9%
associate-*l*99.9%
*-commutative99.9%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ (* (- (exp l) (exp (- l))) J) U)) (t_1 (cos (* K 0.5))))
(if (<= l -4.5e+116)
(* (* t_1 (pow l 3.0)) (* J 0.3333333333333333))
(if (<= l -0.08)
t_0
(if (<= l 480000000.0)
(+
U
(*
(cos (/ K 2.0))
(* l (+ (* J 2.0) (* 0.3333333333333333 (* J (pow l 2.0)))))))
(if (<= l 1.15e+82)
t_0
(+ U (* 0.3333333333333333 (* t_1 (* J (pow l 3.0)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = ((exp(l) - exp(-l)) * J) + U;
double t_1 = cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -0.08) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (cos((K / 2.0)) * (l * ((J * 2.0) + (0.3333333333333333 * (J * pow(l, 2.0))))));
} else if (l <= 1.15e+82) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * pow(l, 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((exp(l) - exp(-l)) * j) + u
t_1 = cos((k * 0.5d0))
if (l <= (-4.5d+116)) then
tmp = (t_1 * (l ** 3.0d0)) * (j * 0.3333333333333333d0)
else if (l <= (-0.08d0)) then
tmp = t_0
else if (l <= 480000000.0d0) then
tmp = u + (cos((k / 2.0d0)) * (l * ((j * 2.0d0) + (0.3333333333333333d0 * (j * (l ** 2.0d0))))))
else if (l <= 1.15d+82) then
tmp = t_0
else
tmp = u + (0.3333333333333333d0 * (t_1 * (j * (l ** 3.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double t_1 = Math.cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * Math.pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -0.08) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (Math.cos((K / 2.0)) * (l * ((J * 2.0) + (0.3333333333333333 * (J * Math.pow(l, 2.0))))));
} else if (l <= 1.15e+82) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * Math.pow(l, 3.0))));
}
return tmp;
}
def code(J, l, K, U): t_0 = ((math.exp(l) - math.exp(-l)) * J) + U t_1 = math.cos((K * 0.5)) tmp = 0 if l <= -4.5e+116: tmp = (t_1 * math.pow(l, 3.0)) * (J * 0.3333333333333333) elif l <= -0.08: tmp = t_0 elif l <= 480000000.0: tmp = U + (math.cos((K / 2.0)) * (l * ((J * 2.0) + (0.3333333333333333 * (J * math.pow(l, 2.0)))))) elif l <= 1.15e+82: tmp = t_0 else: tmp = U + (0.3333333333333333 * (t_1 * (J * math.pow(l, 3.0)))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) t_1 = cos(Float64(K * 0.5)) tmp = 0.0 if (l <= -4.5e+116) tmp = Float64(Float64(t_1 * (l ^ 3.0)) * Float64(J * 0.3333333333333333)); elseif (l <= -0.08) tmp = t_0; elseif (l <= 480000000.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(Float64(J * 2.0) + Float64(0.3333333333333333 * Float64(J * (l ^ 2.0))))))); elseif (l <= 1.15e+82) tmp = t_0; else tmp = Float64(U + Float64(0.3333333333333333 * Float64(t_1 * Float64(J * (l ^ 3.0))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = ((exp(l) - exp(-l)) * J) + U; t_1 = cos((K * 0.5)); tmp = 0.0; if (l <= -4.5e+116) tmp = (t_1 * (l ^ 3.0)) * (J * 0.3333333333333333); elseif (l <= -0.08) tmp = t_0; elseif (l <= 480000000.0) tmp = U + (cos((K / 2.0)) * (l * ((J * 2.0) + (0.3333333333333333 * (J * (l ^ 2.0)))))); elseif (l <= 1.15e+82) tmp = t_0; else tmp = U + (0.3333333333333333 * (t_1 * (J * (l ^ 3.0)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -4.5e+116], N[(N[(t$95$1 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -0.08], t$95$0, If[LessEqual[l, 480000000.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(N[(J * 2.0), $MachinePrecision] + N[(0.3333333333333333 * N[(J * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.15e+82], t$95$0, N[(U + N[(0.3333333333333333 * N[(t$95$1 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
t_1 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+116}:\\
\;\;\;\;\left(t\_1 \cdot {\ell}^{3}\right) \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{elif}\;\ell \leq -0.08:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 480000000:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2 + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{2}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 1.15 \cdot 10^{+82}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(t\_1 \cdot \left(J \cdot {\ell}^{3}\right)\right)\\
\end{array}
\end{array}
if l < -4.50000000000000016e116Initial program 100.0%
Taylor expanded in l around 0 100.0%
distribute-lft-in100.0%
*-commutative100.0%
associate-*l*100.0%
unpow2100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in U around -inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
if -4.50000000000000016e116 < l < -0.0800000000000000017 or 4.8e8 < l < 1.14999999999999994e82Initial program 100.0%
Taylor expanded in K around 0 80.6%
if -0.0800000000000000017 < l < 4.8e8Initial program 69.0%
Taylor expanded in l around 0 98.7%
if 1.14999999999999994e82 < l Initial program 100.0%
Taylor expanded in l around 0 98.2%
Taylor expanded in l around inf 98.2%
associate-*r*98.2%
Simplified98.2%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ (* (- (exp l) (exp (- l))) J) U)) (t_1 (cos (* K 0.5))))
(if (<= l -4.5e+116)
(* (* t_1 (pow l 3.0)) (* J 0.3333333333333333))
(if (<= l -9.6e-5)
t_0
(if (<= l 480000000.0)
(+ U (* l (* t_1 (* J 2.0))))
(if (<= l 7.8e+88)
t_0
(+ U (* 0.3333333333333333 (* t_1 (* J (pow l 3.0)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = ((exp(l) - exp(-l)) * J) + U;
double t_1 = cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -9.6e-5) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (l * (t_1 * (J * 2.0)));
} else if (l <= 7.8e+88) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * pow(l, 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((exp(l) - exp(-l)) * j) + u
t_1 = cos((k * 0.5d0))
if (l <= (-4.5d+116)) then
tmp = (t_1 * (l ** 3.0d0)) * (j * 0.3333333333333333d0)
else if (l <= (-9.6d-5)) then
tmp = t_0
else if (l <= 480000000.0d0) then
tmp = u + (l * (t_1 * (j * 2.0d0)))
else if (l <= 7.8d+88) then
tmp = t_0
else
tmp = u + (0.3333333333333333d0 * (t_1 * (j * (l ** 3.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double t_1 = Math.cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * Math.pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -9.6e-5) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (l * (t_1 * (J * 2.0)));
} else if (l <= 7.8e+88) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * Math.pow(l, 3.0))));
}
return tmp;
}
def code(J, l, K, U): t_0 = ((math.exp(l) - math.exp(-l)) * J) + U t_1 = math.cos((K * 0.5)) tmp = 0 if l <= -4.5e+116: tmp = (t_1 * math.pow(l, 3.0)) * (J * 0.3333333333333333) elif l <= -9.6e-5: tmp = t_0 elif l <= 480000000.0: tmp = U + (l * (t_1 * (J * 2.0))) elif l <= 7.8e+88: tmp = t_0 else: tmp = U + (0.3333333333333333 * (t_1 * (J * math.pow(l, 3.0)))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) t_1 = cos(Float64(K * 0.5)) tmp = 0.0 if (l <= -4.5e+116) tmp = Float64(Float64(t_1 * (l ^ 3.0)) * Float64(J * 0.3333333333333333)); elseif (l <= -9.6e-5) tmp = t_0; elseif (l <= 480000000.0) tmp = Float64(U + Float64(l * Float64(t_1 * Float64(J * 2.0)))); elseif (l <= 7.8e+88) tmp = t_0; else tmp = Float64(U + Float64(0.3333333333333333 * Float64(t_1 * Float64(J * (l ^ 3.0))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = ((exp(l) - exp(-l)) * J) + U; t_1 = cos((K * 0.5)); tmp = 0.0; if (l <= -4.5e+116) tmp = (t_1 * (l ^ 3.0)) * (J * 0.3333333333333333); elseif (l <= -9.6e-5) tmp = t_0; elseif (l <= 480000000.0) tmp = U + (l * (t_1 * (J * 2.0))); elseif (l <= 7.8e+88) tmp = t_0; else tmp = U + (0.3333333333333333 * (t_1 * (J * (l ^ 3.0)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -4.5e+116], N[(N[(t$95$1 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -9.6e-5], t$95$0, If[LessEqual[l, 480000000.0], N[(U + N[(l * N[(t$95$1 * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.8e+88], t$95$0, N[(U + N[(0.3333333333333333 * N[(t$95$1 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
t_1 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+116}:\\
\;\;\;\;\left(t\_1 \cdot {\ell}^{3}\right) \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{elif}\;\ell \leq -9.6 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 480000000:\\
\;\;\;\;U + \ell \cdot \left(t\_1 \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 7.8 \cdot 10^{+88}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(t\_1 \cdot \left(J \cdot {\ell}^{3}\right)\right)\\
\end{array}
\end{array}
if l < -4.50000000000000016e116Initial program 100.0%
Taylor expanded in l around 0 100.0%
distribute-lft-in100.0%
*-commutative100.0%
associate-*l*100.0%
unpow2100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in U around -inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
if -4.50000000000000016e116 < l < -9.6000000000000002e-5 or 4.8e8 < l < 7.8000000000000002e88Initial program 100.0%
Taylor expanded in K around 0 80.6%
if -9.6000000000000002e-5 < l < 4.8e8Initial program 69.0%
Taylor expanded in l around 0 98.5%
*-commutative98.5%
associate-*r*98.6%
associate-*l*98.6%
*-commutative98.6%
associate-*r*98.6%
*-commutative98.6%
Simplified98.6%
if 7.8000000000000002e88 < l Initial program 100.0%
Taylor expanded in l around 0 98.2%
Taylor expanded in l around inf 98.2%
associate-*r*98.2%
Simplified98.2%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ (* (- (exp l) (exp (- l))) J) U)) (t_1 (cos (* K 0.5))))
(if (<= l -4.5e+116)
(* (* t_1 (pow l 3.0)) (* J 0.3333333333333333))
(if (<= l -0.009)
t_0
(if (<= l 480000000.0)
(+
U
(*
(cos (/ K 2.0))
(* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0)))))))
(if (<= l 1.55e+87)
t_0
(+ U (* 0.3333333333333333 (* t_1 (* J (pow l 3.0)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = ((exp(l) - exp(-l)) * J) + U;
double t_1 = cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -0.009) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0))))));
} else if (l <= 1.55e+87) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * pow(l, 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((exp(l) - exp(-l)) * j) + u
t_1 = cos((k * 0.5d0))
if (l <= (-4.5d+116)) then
tmp = (t_1 * (l ** 3.0d0)) * (j * 0.3333333333333333d0)
else if (l <= (-0.009d0)) then
tmp = t_0
else if (l <= 480000000.0d0) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0))))))
else if (l <= 1.55d+87) then
tmp = t_0
else
tmp = u + (0.3333333333333333d0 * (t_1 * (j * (l ** 3.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double t_1 = Math.cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * Math.pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -0.009) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))));
} else if (l <= 1.55e+87) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * Math.pow(l, 3.0))));
}
return tmp;
}
def code(J, l, K, U): t_0 = ((math.exp(l) - math.exp(-l)) * J) + U t_1 = math.cos((K * 0.5)) tmp = 0 if l <= -4.5e+116: tmp = (t_1 * math.pow(l, 3.0)) * (J * 0.3333333333333333) elif l <= -0.009: tmp = t_0 elif l <= 480000000.0: tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0)))))) elif l <= 1.55e+87: tmp = t_0 else: tmp = U + (0.3333333333333333 * (t_1 * (J * math.pow(l, 3.0)))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) t_1 = cos(Float64(K * 0.5)) tmp = 0.0 if (l <= -4.5e+116) tmp = Float64(Float64(t_1 * (l ^ 3.0)) * Float64(J * 0.3333333333333333)); elseif (l <= -0.009) tmp = t_0; elseif (l <= 480000000.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))))); elseif (l <= 1.55e+87) tmp = t_0; else tmp = Float64(U + Float64(0.3333333333333333 * Float64(t_1 * Float64(J * (l ^ 3.0))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = ((exp(l) - exp(-l)) * J) + U; t_1 = cos((K * 0.5)); tmp = 0.0; if (l <= -4.5e+116) tmp = (t_1 * (l ^ 3.0)) * (J * 0.3333333333333333); elseif (l <= -0.009) tmp = t_0; elseif (l <= 480000000.0) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0)))))); elseif (l <= 1.55e+87) tmp = t_0; else tmp = U + (0.3333333333333333 * (t_1 * (J * (l ^ 3.0)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -4.5e+116], N[(N[(t$95$1 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -0.009], t$95$0, If[LessEqual[l, 480000000.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.55e+87], t$95$0, N[(U + N[(0.3333333333333333 * N[(t$95$1 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
t_1 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+116}:\\
\;\;\;\;\left(t\_1 \cdot {\ell}^{3}\right) \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{elif}\;\ell \leq -0.009:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 480000000:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 1.55 \cdot 10^{+87}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(t\_1 \cdot \left(J \cdot {\ell}^{3}\right)\right)\\
\end{array}
\end{array}
if l < -4.50000000000000016e116Initial program 100.0%
Taylor expanded in l around 0 100.0%
distribute-lft-in100.0%
*-commutative100.0%
associate-*l*100.0%
unpow2100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in U around -inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
if -4.50000000000000016e116 < l < -0.00899999999999999932 or 4.8e8 < l < 1.55e87Initial program 100.0%
Taylor expanded in K around 0 80.6%
if -0.00899999999999999932 < l < 4.8e8Initial program 69.0%
Taylor expanded in l around 0 98.7%
if 1.55e87 < l Initial program 100.0%
Taylor expanded in l around 0 98.2%
Taylor expanded in l around inf 98.2%
associate-*r*98.2%
Simplified98.2%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ (* (- (exp l) (exp (- l))) J) U)) (t_1 (cos (* K 0.5))))
(if (<= l -4.5e+116)
(* (* t_1 (pow l 3.0)) (* J 0.3333333333333333))
(if (<= l -0.05)
t_0
(if (<= l 480000000.0)
(+
U
(*
(cos (/ K 2.0))
(* J (+ (* l 2.0) (* 0.3333333333333333 (pow l 3.0))))))
(if (<= l 7.8e+88)
t_0
(+ U (* 0.3333333333333333 (* t_1 (* J (pow l 3.0)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = ((exp(l) - exp(-l)) * J) + U;
double t_1 = cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -0.05) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * pow(l, 3.0)))));
} else if (l <= 7.8e+88) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * pow(l, 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((exp(l) - exp(-l)) * j) + u
t_1 = cos((k * 0.5d0))
if (l <= (-4.5d+116)) then
tmp = (t_1 * (l ** 3.0d0)) * (j * 0.3333333333333333d0)
else if (l <= (-0.05d0)) then
tmp = t_0
else if (l <= 480000000.0d0) then
tmp = u + (cos((k / 2.0d0)) * (j * ((l * 2.0d0) + (0.3333333333333333d0 * (l ** 3.0d0)))))
else if (l <= 7.8d+88) then
tmp = t_0
else
tmp = u + (0.3333333333333333d0 * (t_1 * (j * (l ** 3.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double t_1 = Math.cos((K * 0.5));
double tmp;
if (l <= -4.5e+116) {
tmp = (t_1 * Math.pow(l, 3.0)) * (J * 0.3333333333333333);
} else if (l <= -0.05) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (Math.cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * Math.pow(l, 3.0)))));
} else if (l <= 7.8e+88) {
tmp = t_0;
} else {
tmp = U + (0.3333333333333333 * (t_1 * (J * Math.pow(l, 3.0))));
}
return tmp;
}
def code(J, l, K, U): t_0 = ((math.exp(l) - math.exp(-l)) * J) + U t_1 = math.cos((K * 0.5)) tmp = 0 if l <= -4.5e+116: tmp = (t_1 * math.pow(l, 3.0)) * (J * 0.3333333333333333) elif l <= -0.05: tmp = t_0 elif l <= 480000000.0: tmp = U + (math.cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * math.pow(l, 3.0))))) elif l <= 7.8e+88: tmp = t_0 else: tmp = U + (0.3333333333333333 * (t_1 * (J * math.pow(l, 3.0)))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) t_1 = cos(Float64(K * 0.5)) tmp = 0.0 if (l <= -4.5e+116) tmp = Float64(Float64(t_1 * (l ^ 3.0)) * Float64(J * 0.3333333333333333)); elseif (l <= -0.05) tmp = t_0; elseif (l <= 480000000.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(Float64(l * 2.0) + Float64(0.3333333333333333 * (l ^ 3.0)))))); elseif (l <= 7.8e+88) tmp = t_0; else tmp = Float64(U + Float64(0.3333333333333333 * Float64(t_1 * Float64(J * (l ^ 3.0))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = ((exp(l) - exp(-l)) * J) + U; t_1 = cos((K * 0.5)); tmp = 0.0; if (l <= -4.5e+116) tmp = (t_1 * (l ^ 3.0)) * (J * 0.3333333333333333); elseif (l <= -0.05) tmp = t_0; elseif (l <= 480000000.0) tmp = U + (cos((K / 2.0)) * (J * ((l * 2.0) + (0.3333333333333333 * (l ^ 3.0))))); elseif (l <= 7.8e+88) tmp = t_0; else tmp = U + (0.3333333333333333 * (t_1 * (J * (l ^ 3.0)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -4.5e+116], N[(N[(t$95$1 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -0.05], t$95$0, If[LessEqual[l, 480000000.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * 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, 7.8e+88], t$95$0, N[(U + N[(0.3333333333333333 * N[(t$95$1 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
t_1 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+116}:\\
\;\;\;\;\left(t\_1 \cdot {\ell}^{3}\right) \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{elif}\;\ell \leq -0.05:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 480000000:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2 + 0.3333333333333333 \cdot {\ell}^{3}\right)\right)\\
\mathbf{elif}\;\ell \leq 7.8 \cdot 10^{+88}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(t\_1 \cdot \left(J \cdot {\ell}^{3}\right)\right)\\
\end{array}
\end{array}
if l < -4.50000000000000016e116Initial program 100.0%
Taylor expanded in l around 0 100.0%
distribute-lft-in100.0%
*-commutative100.0%
associate-*l*100.0%
unpow2100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in U around -inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
if -4.50000000000000016e116 < l < -0.050000000000000003 or 4.8e8 < l < 7.8000000000000002e88Initial program 100.0%
Taylor expanded in K around 0 80.6%
if -0.050000000000000003 < l < 4.8e8Initial program 69.0%
Taylor expanded in l around 0 98.7%
distribute-lft-in98.7%
*-commutative98.7%
associate-*l*98.7%
unpow298.7%
pow398.7%
Applied egg-rr98.7%
if 7.8000000000000002e88 < l Initial program 100.0%
Taylor expanded in l around 0 98.2%
Taylor expanded in l around inf 98.2%
associate-*r*98.2%
Simplified98.2%
Final simplification96.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ (* (- (exp l) (exp (- l))) J) U))
(t_1 (cos (* K 0.5)))
(t_2 (* (* t_1 (pow l 3.0)) (* J 0.3333333333333333))))
(if (<= l -4.5e+116)
t_2
(if (<= l -0.019)
t_0
(if (<= l 480000000.0)
(+ U (* l (* t_1 (* J 2.0))))
(if (<= l 7.8e+88) t_0 t_2))))))
double code(double J, double l, double K, double U) {
double t_0 = ((exp(l) - exp(-l)) * J) + U;
double t_1 = cos((K * 0.5));
double t_2 = (t_1 * pow(l, 3.0)) * (J * 0.3333333333333333);
double tmp;
if (l <= -4.5e+116) {
tmp = t_2;
} else if (l <= -0.019) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (l * (t_1 * (J * 2.0)));
} else if (l <= 7.8e+88) {
tmp = t_0;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_0 = ((exp(l) - exp(-l)) * j) + u
t_1 = cos((k * 0.5d0))
t_2 = (t_1 * (l ** 3.0d0)) * (j * 0.3333333333333333d0)
if (l <= (-4.5d+116)) then
tmp = t_2
else if (l <= (-0.019d0)) then
tmp = t_0
else if (l <= 480000000.0d0) then
tmp = u + (l * (t_1 * (j * 2.0d0)))
else if (l <= 7.8d+88) then
tmp = t_0
else
tmp = t_2
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double t_1 = Math.cos((K * 0.5));
double t_2 = (t_1 * Math.pow(l, 3.0)) * (J * 0.3333333333333333);
double tmp;
if (l <= -4.5e+116) {
tmp = t_2;
} else if (l <= -0.019) {
tmp = t_0;
} else if (l <= 480000000.0) {
tmp = U + (l * (t_1 * (J * 2.0)));
} else if (l <= 7.8e+88) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(J, l, K, U): t_0 = ((math.exp(l) - math.exp(-l)) * J) + U t_1 = math.cos((K * 0.5)) t_2 = (t_1 * math.pow(l, 3.0)) * (J * 0.3333333333333333) tmp = 0 if l <= -4.5e+116: tmp = t_2 elif l <= -0.019: tmp = t_0 elif l <= 480000000.0: tmp = U + (l * (t_1 * (J * 2.0))) elif l <= 7.8e+88: tmp = t_0 else: tmp = t_2 return tmp
function code(J, l, K, U) t_0 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) t_1 = cos(Float64(K * 0.5)) t_2 = Float64(Float64(t_1 * (l ^ 3.0)) * Float64(J * 0.3333333333333333)) tmp = 0.0 if (l <= -4.5e+116) tmp = t_2; elseif (l <= -0.019) tmp = t_0; elseif (l <= 480000000.0) tmp = Float64(U + Float64(l * Float64(t_1 * Float64(J * 2.0)))); elseif (l <= 7.8e+88) tmp = t_0; else tmp = t_2; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = ((exp(l) - exp(-l)) * J) + U; t_1 = cos((K * 0.5)); t_2 = (t_1 * (l ^ 3.0)) * (J * 0.3333333333333333); tmp = 0.0; if (l <= -4.5e+116) tmp = t_2; elseif (l <= -0.019) tmp = t_0; elseif (l <= 480000000.0) tmp = U + (l * (t_1 * (J * 2.0))); elseif (l <= 7.8e+88) tmp = t_0; else tmp = t_2; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4.5e+116], t$95$2, If[LessEqual[l, -0.019], t$95$0, If[LessEqual[l, 480000000.0], N[(U + N[(l * N[(t$95$1 * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.8e+88], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
t_1 := \cos \left(K \cdot 0.5\right)\\
t_2 := \left(t\_1 \cdot {\ell}^{3}\right) \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+116}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\ell \leq -0.019:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 480000000:\\
\;\;\;\;U + \ell \cdot \left(t\_1 \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 7.8 \cdot 10^{+88}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if l < -4.50000000000000016e116 or 7.8000000000000002e88 < l Initial program 100.0%
Taylor expanded in l around 0 99.0%
distribute-lft-in99.0%
*-commutative99.0%
associate-*l*99.0%
unpow299.0%
pow399.0%
Applied egg-rr99.0%
Taylor expanded in U around -inf 99.0%
mul-1-neg99.0%
*-commutative99.0%
distribute-rgt-neg-in99.0%
Simplified99.0%
Taylor expanded in l around inf 99.0%
*-commutative99.0%
*-commutative99.0%
associate-*l*99.0%
*-commutative99.0%
Simplified99.0%
if -4.50000000000000016e116 < l < -0.0189999999999999995 or 4.8e8 < l < 7.8000000000000002e88Initial program 100.0%
Taylor expanded in K around 0 80.6%
if -0.0189999999999999995 < l < 4.8e8Initial program 69.0%
Taylor expanded in l around 0 98.5%
*-commutative98.5%
associate-*r*98.6%
associate-*l*98.6%
*-commutative98.6%
associate-*r*98.6%
*-commutative98.6%
Simplified98.6%
Final simplification96.2%
(FPCore (J l K U) :precision binary64 (if (or (<= l -0.0023) (not (<= l 480000000.0))) (+ (* (- (exp l) (exp (- l))) J) U) (+ U (* l (* (cos (* K 0.5)) (* J 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.0023) || !(l <= 480000000.0)) {
tmp = ((exp(l) - exp(-l)) * J) + U;
} else {
tmp = U + (l * (cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-0.0023d0)) .or. (.not. (l <= 480000000.0d0))) then
tmp = ((exp(l) - exp(-l)) * j) + u
else
tmp = u + (l * (cos((k * 0.5d0)) * (j * 2.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.0023) || !(l <= 480000000.0)) {
tmp = ((Math.exp(l) - Math.exp(-l)) * J) + U;
} else {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -0.0023) or not (l <= 480000000.0): tmp = ((math.exp(l) - math.exp(-l)) * J) + U else: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -0.0023) || !(l <= 480000000.0)) tmp = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U); else tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -0.0023) || ~((l <= 480000000.0))) tmp = ((exp(l) - exp(-l)) * J) + U; else tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -0.0023], N[Not[LessEqual[l, 480000000.0]], $MachinePrecision]], N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.0023 \lor \neg \left(\ell \leq 480000000\right):\\
\;\;\;\;\left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -0.0023 or 4.8e8 < l Initial program 100.0%
Taylor expanded in K around 0 76.2%
if -0.0023 < l < 4.8e8Initial program 69.0%
Taylor expanded in l around 0 98.5%
*-commutative98.5%
associate-*r*98.6%
associate-*l*98.6%
*-commutative98.6%
associate-*r*98.6%
*-commutative98.6%
Simplified98.6%
Final simplification87.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* 0.3333333333333333 (pow l 3.0)))))
(if (<= l -5.3e+45)
t_0
(if (<= l -8.5e+16)
(pow U -4.0)
(if (<= l 5e+98)
(+ U (* 2.0 (* J (* l (cos (* K 0.5))))))
(+ U t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * pow(l, 3.0));
double tmp;
if (l <= -5.3e+45) {
tmp = t_0;
} else if (l <= -8.5e+16) {
tmp = pow(U, -4.0);
} else if (l <= 5e+98) {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
} else {
tmp = U + 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 = j * (0.3333333333333333d0 * (l ** 3.0d0))
if (l <= (-5.3d+45)) then
tmp = t_0
else if (l <= (-8.5d+16)) then
tmp = u ** (-4.0d0)
else if (l <= 5d+98) then
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
else
tmp = u + t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * Math.pow(l, 3.0));
double tmp;
if (l <= -5.3e+45) {
tmp = t_0;
} else if (l <= -8.5e+16) {
tmp = Math.pow(U, -4.0);
} else if (l <= 5e+98) {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
} else {
tmp = U + t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (0.3333333333333333 * math.pow(l, 3.0)) tmp = 0 if l <= -5.3e+45: tmp = t_0 elif l <= -8.5e+16: tmp = math.pow(U, -4.0) elif l <= 5e+98: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) else: tmp = U + t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))) tmp = 0.0 if (l <= -5.3e+45) tmp = t_0; elseif (l <= -8.5e+16) tmp = U ^ -4.0; elseif (l <= 5e+98) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); else tmp = Float64(U + t_0); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (0.3333333333333333 * (l ^ 3.0)); tmp = 0.0; if (l <= -5.3e+45) tmp = t_0; elseif (l <= -8.5e+16) tmp = U ^ -4.0; elseif (l <= 5e+98) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); else tmp = U + t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5.3e+45], t$95$0, If[LessEqual[l, -8.5e+16], N[Power[U, -4.0], $MachinePrecision], If[LessEqual[l, 5e+98], N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\\
\mathbf{if}\;\ell \leq -5.3 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -8.5 \cdot 10^{+16}:\\
\;\;\;\;{U}^{-4}\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+98}:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t\_0\\
\end{array}
\end{array}
if l < -5.29999999999999991e45Initial program 100.0%
Taylor expanded in l around 0 89.9%
Taylor expanded in K around 0 71.4%
Taylor expanded in U around inf 71.4%
Taylor expanded in l around inf 71.4%
associate-*r*71.4%
*-commutative71.4%
associate-*r*71.4%
Simplified71.4%
if -5.29999999999999991e45 < l < -8.5e16Initial program 100.0%
Applied egg-rr56.1%
if -8.5e16 < l < 4.9999999999999998e98Initial program 72.9%
Taylor expanded in l around 0 88.6%
if 4.9999999999999998e98 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in K around 0 77.1%
Taylor expanded in l around inf 77.1%
associate-*r*77.1%
*-commutative77.1%
associate-*r*77.1%
Simplified77.1%
Final simplification81.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* 0.3333333333333333 (pow l 3.0)))))
(if (<= l -1.05e+47)
t_0
(if (<= l -7.8e+18)
(pow U -4.0)
(if (<= l 5e+98)
(+ U (* l (* (cos (* K 0.5)) (* J 2.0))))
(+ U t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * pow(l, 3.0));
double tmp;
if (l <= -1.05e+47) {
tmp = t_0;
} else if (l <= -7.8e+18) {
tmp = pow(U, -4.0);
} else if (l <= 5e+98) {
tmp = U + (l * (cos((K * 0.5)) * (J * 2.0)));
} else {
tmp = U + 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 = j * (0.3333333333333333d0 * (l ** 3.0d0))
if (l <= (-1.05d+47)) then
tmp = t_0
else if (l <= (-7.8d+18)) then
tmp = u ** (-4.0d0)
else if (l <= 5d+98) then
tmp = u + (l * (cos((k * 0.5d0)) * (j * 2.0d0)))
else
tmp = u + t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * Math.pow(l, 3.0));
double tmp;
if (l <= -1.05e+47) {
tmp = t_0;
} else if (l <= -7.8e+18) {
tmp = Math.pow(U, -4.0);
} else if (l <= 5e+98) {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
} else {
tmp = U + t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (0.3333333333333333 * math.pow(l, 3.0)) tmp = 0 if l <= -1.05e+47: tmp = t_0 elif l <= -7.8e+18: tmp = math.pow(U, -4.0) elif l <= 5e+98: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) else: tmp = U + t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))) tmp = 0.0 if (l <= -1.05e+47) tmp = t_0; elseif (l <= -7.8e+18) tmp = U ^ -4.0; elseif (l <= 5e+98) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); else tmp = Float64(U + t_0); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (0.3333333333333333 * (l ^ 3.0)); tmp = 0.0; if (l <= -1.05e+47) tmp = t_0; elseif (l <= -7.8e+18) tmp = U ^ -4.0; elseif (l <= 5e+98) tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); else tmp = U + t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.05e+47], t$95$0, If[LessEqual[l, -7.8e+18], N[Power[U, -4.0], $MachinePrecision], If[LessEqual[l, 5e+98], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\\
\mathbf{if}\;\ell \leq -1.05 \cdot 10^{+47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -7.8 \cdot 10^{+18}:\\
\;\;\;\;{U}^{-4}\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+98}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t\_0\\
\end{array}
\end{array}
if l < -1.05e47Initial program 100.0%
Taylor expanded in l around 0 89.9%
Taylor expanded in K around 0 71.4%
Taylor expanded in U around inf 71.4%
Taylor expanded in l around inf 71.4%
associate-*r*71.4%
*-commutative71.4%
associate-*r*71.4%
Simplified71.4%
if -1.05e47 < l < -7.8e18Initial program 100.0%
Applied egg-rr56.1%
if -7.8e18 < l < 4.9999999999999998e98Initial program 72.9%
Taylor expanded in l around 0 88.6%
*-commutative88.6%
associate-*r*88.7%
associate-*l*88.7%
*-commutative88.7%
associate-*r*88.7%
*-commutative88.7%
Simplified88.7%
if 4.9999999999999998e98 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in K around 0 77.1%
Taylor expanded in l around inf 77.1%
associate-*r*77.1%
*-commutative77.1%
associate-*r*77.1%
Simplified77.1%
Final simplification81.6%
(FPCore (J l K U)
:precision binary64
(if (<= l -8.5e+16)
(* U (+ 1.0 (* 0.3333333333333333 (* J (/ (pow l 3.0) U)))))
(if (<= l 120.0)
(+ U (* l (* (cos (* K 0.5)) (* J 2.0))))
(*
U
(+ 1.0 (/ (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))) U))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -8.5e+16) {
tmp = U * (1.0 + (0.3333333333333333 * (J * (pow(l, 3.0) / U))));
} else if (l <= 120.0) {
tmp = U + (l * (cos((K * 0.5)) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0))))) / U));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-8.5d+16)) then
tmp = u * (1.0d0 + (0.3333333333333333d0 * (j * ((l ** 3.0d0) / u))))
else if (l <= 120.0d0) then
tmp = u + (l * (cos((k * 0.5d0)) * (j * 2.0d0)))
else
tmp = u * (1.0d0 + ((j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0))))) / u))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -8.5e+16) {
tmp = U * (1.0 + (0.3333333333333333 * (J * (Math.pow(l, 3.0) / U))));
} else if (l <= 120.0) {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))) / U));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -8.5e+16: tmp = U * (1.0 + (0.3333333333333333 * (J * (math.pow(l, 3.0) / U)))) elif l <= 120.0: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) else: tmp = U * (1.0 + ((J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) / U)) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -8.5e+16) tmp = Float64(U * Float64(1.0 + Float64(0.3333333333333333 * Float64(J * Float64((l ^ 3.0) / U))))); elseif (l <= 120.0) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); else tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))) / U))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -8.5e+16) tmp = U * (1.0 + (0.3333333333333333 * (J * ((l ^ 3.0) / U)))); elseif (l <= 120.0) tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); else tmp = U * (1.0 + ((J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0))))) / U)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -8.5e+16], N[(U * N[(1.0 + N[(0.3333333333333333 * N[(J * N[(N[Power[l, 3.0], $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 120.0], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(1.0 + N[(N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{+16}:\\
\;\;\;\;U \cdot \left(1 + 0.3333333333333333 \cdot \left(J \cdot \frac{{\ell}^{3}}{U}\right)\right)\\
\mathbf{elif}\;\ell \leq 120:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)}{U}\right)\\
\end{array}
\end{array}
if l < -8.5e16Initial program 100.0%
Taylor expanded in l around 0 79.6%
Taylor expanded in K around 0 62.0%
Taylor expanded in U around inf 66.3%
Taylor expanded in l around inf 66.3%
associate-/l*67.9%
Simplified67.9%
if -8.5e16 < l < 120Initial program 69.3%
Taylor expanded in l around 0 97.0%
*-commutative97.0%
associate-*r*97.0%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.0%
*-commutative97.0%
Simplified97.0%
if 120 < l Initial program 100.0%
Taylor expanded in l around 0 82.4%
Taylor expanded in K around 0 62.3%
Taylor expanded in U around inf 66.7%
Final simplification82.0%
(FPCore (J l K U) :precision binary64 (if (or (<= l -8.5e+16) (not (<= l 62.0))) (* U (+ 1.0 (* 0.3333333333333333 (* J (/ (pow l 3.0) U))))) (+ U (* l (* (cos (* K 0.5)) (* J 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -8.5e+16) || !(l <= 62.0)) {
tmp = U * (1.0 + (0.3333333333333333 * (J * (pow(l, 3.0) / U))));
} else {
tmp = U + (l * (cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-8.5d+16)) .or. (.not. (l <= 62.0d0))) then
tmp = u * (1.0d0 + (0.3333333333333333d0 * (j * ((l ** 3.0d0) / u))))
else
tmp = u + (l * (cos((k * 0.5d0)) * (j * 2.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -8.5e+16) || !(l <= 62.0)) {
tmp = U * (1.0 + (0.3333333333333333 * (J * (Math.pow(l, 3.0) / U))));
} else {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -8.5e+16) or not (l <= 62.0): tmp = U * (1.0 + (0.3333333333333333 * (J * (math.pow(l, 3.0) / U)))) else: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -8.5e+16) || !(l <= 62.0)) tmp = Float64(U * Float64(1.0 + Float64(0.3333333333333333 * Float64(J * Float64((l ^ 3.0) / U))))); else tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -8.5e+16) || ~((l <= 62.0))) tmp = U * (1.0 + (0.3333333333333333 * (J * ((l ^ 3.0) / U)))); else tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -8.5e+16], N[Not[LessEqual[l, 62.0]], $MachinePrecision]], N[(U * N[(1.0 + N[(0.3333333333333333 * N[(J * N[(N[Power[l, 3.0], $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{+16} \lor \neg \left(\ell \leq 62\right):\\
\;\;\;\;U \cdot \left(1 + 0.3333333333333333 \cdot \left(J \cdot \frac{{\ell}^{3}}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -8.5e16 or 62 < l Initial program 100.0%
Taylor expanded in l around 0 81.0%
Taylor expanded in K around 0 62.2%
Taylor expanded in U around inf 66.5%
Taylor expanded in l around inf 66.5%
associate-/l*67.3%
Simplified67.3%
if -8.5e16 < l < 62Initial program 69.3%
Taylor expanded in l around 0 97.0%
*-commutative97.0%
associate-*r*97.0%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.0%
*-commutative97.0%
Simplified97.0%
Final simplification82.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* 0.3333333333333333 (pow l 3.0)))))
(if (<= l -1.46e+49)
t_0
(if (<= l 1.4e+33) (* U (+ 1.0 (* J (* l (/ 2.0 U))))) (+ U t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * pow(l, 3.0));
double tmp;
if (l <= -1.46e+49) {
tmp = t_0;
} else if (l <= 1.4e+33) {
tmp = U * (1.0 + (J * (l * (2.0 / U))));
} else {
tmp = U + 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 = j * (0.3333333333333333d0 * (l ** 3.0d0))
if (l <= (-1.46d+49)) then
tmp = t_0
else if (l <= 1.4d+33) then
tmp = u * (1.0d0 + (j * (l * (2.0d0 / u))))
else
tmp = u + t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * Math.pow(l, 3.0));
double tmp;
if (l <= -1.46e+49) {
tmp = t_0;
} else if (l <= 1.4e+33) {
tmp = U * (1.0 + (J * (l * (2.0 / U))));
} else {
tmp = U + t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (0.3333333333333333 * math.pow(l, 3.0)) tmp = 0 if l <= -1.46e+49: tmp = t_0 elif l <= 1.4e+33: tmp = U * (1.0 + (J * (l * (2.0 / U)))) else: tmp = U + t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))) tmp = 0.0 if (l <= -1.46e+49) tmp = t_0; elseif (l <= 1.4e+33) tmp = Float64(U * Float64(1.0 + Float64(J * Float64(l * Float64(2.0 / U))))); else tmp = Float64(U + t_0); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (0.3333333333333333 * (l ^ 3.0)); tmp = 0.0; if (l <= -1.46e+49) tmp = t_0; elseif (l <= 1.4e+33) tmp = U * (1.0 + (J * (l * (2.0 / U)))); else tmp = U + t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.46e+49], t$95$0, If[LessEqual[l, 1.4e+33], N[(U * N[(1.0 + N[(J * N[(l * N[(2.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\\
\mathbf{if}\;\ell \leq -1.46 \cdot 10^{+49}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+33}:\\
\;\;\;\;U \cdot \left(1 + J \cdot \left(\ell \cdot \frac{2}{U}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + t\_0\\
\end{array}
\end{array}
if l < -1.46000000000000008e49Initial program 100.0%
Taylor expanded in l around 0 91.4%
Taylor expanded in K around 0 72.7%
Taylor expanded in U around inf 72.7%
Taylor expanded in l around inf 72.8%
associate-*r*72.8%
*-commutative72.8%
associate-*r*72.8%
Simplified72.8%
if -1.46000000000000008e49 < l < 1.4e33Initial program 72.9%
Taylor expanded in l around 0 88.2%
Taylor expanded in K around 0 73.4%
Taylor expanded in U around inf 75.2%
Taylor expanded in l around 0 75.2%
*-commutative75.2%
associate-/l*75.8%
associate-*l*75.8%
associate-*l/75.8%
associate-/l*75.8%
Simplified75.8%
if 1.4e33 < l Initial program 100.0%
Taylor expanded in l around 0 88.5%
Taylor expanded in K around 0 66.1%
Taylor expanded in l around inf 66.1%
associate-*r*66.1%
*-commutative66.1%
associate-*r*66.1%
Simplified66.1%
Final simplification72.9%
(FPCore (J l K U) :precision binary64 (if (or (<= l -1.95e+48) (not (<= l 2.7e+30))) (* J (* 0.3333333333333333 (pow l 3.0))) (* U (+ 1.0 (* J (* l (/ 2.0 U)))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.95e+48) || !(l <= 2.7e+30)) {
tmp = J * (0.3333333333333333 * pow(l, 3.0));
} else {
tmp = U * (1.0 + (J * (l * (2.0 / U))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-1.95d+48)) .or. (.not. (l <= 2.7d+30))) then
tmp = j * (0.3333333333333333d0 * (l ** 3.0d0))
else
tmp = u * (1.0d0 + (j * (l * (2.0d0 / u))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -1.95e+48) || !(l <= 2.7e+30)) {
tmp = J * (0.3333333333333333 * Math.pow(l, 3.0));
} else {
tmp = U * (1.0 + (J * (l * (2.0 / U))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -1.95e+48) or not (l <= 2.7e+30): tmp = J * (0.3333333333333333 * math.pow(l, 3.0)) else: tmp = U * (1.0 + (J * (l * (2.0 / U)))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -1.95e+48) || !(l <= 2.7e+30)) tmp = Float64(J * Float64(0.3333333333333333 * (l ^ 3.0))); else tmp = Float64(U * Float64(1.0 + Float64(J * Float64(l * Float64(2.0 / U))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -1.95e+48) || ~((l <= 2.7e+30))) tmp = J * (0.3333333333333333 * (l ^ 3.0)); else tmp = U * (1.0 + (J * (l * (2.0 / U)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -1.95e+48], N[Not[LessEqual[l, 2.7e+30]], $MachinePrecision]], N[(J * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(1.0 + N[(J * N[(l * N[(2.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.95 \cdot 10^{+48} \lor \neg \left(\ell \leq 2.7 \cdot 10^{+30}\right):\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(1 + J \cdot \left(\ell \cdot \frac{2}{U}\right)\right)\\
\end{array}
\end{array}
if l < -1.95e48 or 2.6999999999999999e30 < l Initial program 100.0%
Taylor expanded in l around 0 89.9%
Taylor expanded in K around 0 69.3%
Taylor expanded in U around inf 70.1%
Taylor expanded in l around inf 69.3%
associate-*r*69.3%
*-commutative69.3%
associate-*r*69.3%
Simplified69.3%
if -1.95e48 < l < 2.6999999999999999e30Initial program 72.9%
Taylor expanded in l around 0 88.2%
Taylor expanded in K around 0 73.4%
Taylor expanded in U around inf 75.2%
Taylor expanded in l around 0 75.2%
*-commutative75.2%
associate-/l*75.8%
associate-*l*75.8%
associate-*l/75.8%
associate-/l*75.8%
Simplified75.8%
Final simplification72.9%
(FPCore (J l K U) :precision binary64 (if (or (<= l -950.0) (not (<= l 660.0))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -950.0) || !(l <= 660.0)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-950.0d0)) .or. (.not. (l <= 660.0d0))) then
tmp = u * u
else
tmp = u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -950.0) || !(l <= 660.0)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -950.0) or not (l <= 660.0): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -950.0) || !(l <= 660.0)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -950.0) || ~((l <= 660.0))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -950.0], N[Not[LessEqual[l, 660.0]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -950 \lor \neg \left(\ell \leq 660\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -950 or 660 < l Initial program 100.0%
Applied egg-rr18.3%
if -950 < l < 660Initial program 68.8%
Taylor expanded in J around 0 67.4%
Final simplification42.3%
(FPCore (J l K U) :precision binary64 (if (<= l 1.42e+56) (+ U (* J (* l 2.0))) (* U U)))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.42e+56) {
tmp = U + (J * (l * 2.0));
} 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 <= 1.42d+56) then
tmp = u + (j * (l * 2.0d0))
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 <= 1.42e+56) {
tmp = U + (J * (l * 2.0));
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.42e+56: tmp = U + (J * (l * 2.0)) else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.42e+56) tmp = Float64(U + Float64(J * Float64(l * 2.0))); else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.42e+56) tmp = U + (J * (l * 2.0)); else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.42e+56], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.42 \cdot 10^{+56}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < 1.42e56Initial program 80.7%
Taylor expanded in l around 0 87.4%
Taylor expanded in K around 0 71.8%
Taylor expanded in l around 0 59.5%
*-commutative59.5%
associate-*r*59.5%
*-commutative59.5%
Simplified59.5%
if 1.42e56 < l Initial program 100.0%
Applied egg-rr29.0%
Final simplification53.1%
(FPCore (J l K U) :precision binary64 (* U (+ 1.0 (* J (* l (/ 2.0 U))))))
double code(double J, double l, double K, double U) {
return U * (1.0 + (J * (l * (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 = u * (1.0d0 + (j * (l * (2.0d0 / u))))
end function
public static double code(double J, double l, double K, double U) {
return U * (1.0 + (J * (l * (2.0 / U))));
}
def code(J, l, K, U): return U * (1.0 + (J * (l * (2.0 / U))))
function code(J, l, K, U) return Float64(U * Float64(1.0 + Float64(J * Float64(l * Float64(2.0 / U))))) end
function tmp = code(J, l, K, U) tmp = U * (1.0 + (J * (l * (2.0 / U)))); end
code[J_, l_, K_, U_] := N[(U * N[(1.0 + N[(J * N[(l * N[(2.0 / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U \cdot \left(1 + J \cdot \left(\ell \cdot \frac{2}{U}\right)\right)
\end{array}
Initial program 84.8%
Taylor expanded in l around 0 89.0%
Taylor expanded in K around 0 71.6%
Taylor expanded in U around inf 73.0%
Taylor expanded in l around 0 56.5%
*-commutative56.5%
associate-/l*60.6%
associate-*l*60.6%
associate-*l/60.6%
associate-/l*60.6%
Simplified60.6%
Final simplification60.6%
(FPCore (J l K U) :precision binary64 1.0)
double code(double J, double l, double K, double U) {
return 1.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 = 1.0d0
end function
public static double code(double J, double l, double K, double U) {
return 1.0;
}
def code(J, l, K, U): return 1.0
function code(J, l, K, U) return 1.0 end
function tmp = code(J, l, K, U) tmp = 1.0; end
code[J_, l_, K_, U_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 84.8%
Applied egg-rr2.8%
*-inverses2.8%
Simplified2.8%
Final simplification2.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 84.8%
Taylor expanded in J around 0 34.0%
Final simplification34.0%
herbie shell --seed 2024071
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))