
(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 22 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 4e-7)))
(+ (* (cos (/ K 2.0)) (* t_0 J)) U)
(+
U
(*
(* J (cos (* K 0.5)))
(+ (* 0.3333333333333333 (pow l 3.0)) (* l 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 <= 4e-7)) {
tmp = (cos((K / 2.0)) * (t_0 * J)) + U;
} else {
tmp = U + ((J * cos((K * 0.5))) * ((0.3333333333333333 * pow(l, 3.0)) + (l * 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 <= 4e-7)) {
tmp = (Math.cos((K / 2.0)) * (t_0 * J)) + U;
} else {
tmp = U + ((J * Math.cos((K * 0.5))) * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 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 <= 4e-7): tmp = (math.cos((K / 2.0)) * (t_0 * J)) + U else: tmp = U + ((J * math.cos((K * 0.5))) * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 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 <= 4e-7)) tmp = Float64(Float64(cos(Float64(K / 2.0)) * Float64(t_0 * J)) + U); else tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 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 <= 4e-7))) tmp = (cos((K / 2.0)) * (t_0 * J)) + U; else tmp = U + ((J * cos((K * 0.5))) * ((0.3333333333333333 * (l ^ 3.0)) + (l * 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, 4e-7]], $MachinePrecision]], N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 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 4 \cdot 10^{-7}\right):\\
\;\;\;\;\cos \left(\frac{K}{2}\right) \cdot \left(t_0 \cdot J\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 3.9999999999999998e-7 < (-.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))) < 3.9999999999999998e-7Initial program 71.3%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in l around 0 100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* 0.3333333333333333 (pow l 3.0)))
(t_1 (* J (cos (* K 0.5))))
(t_2 (+ U (* t_1 t_0)))
(t_3 (* (- (exp l) (exp (- l))) J)))
(if (<= l -6.1e+85)
t_2
(if (<= l -7800000000.0)
(+ U (* (+ (* -0.125 (* K K)) 1.0) t_3))
(if (<= l 0.07)
(+ U (* t_1 (+ t_0 (* l 2.0))))
(if (<= l 6e+51) (+ U t_3) t_2))))))
double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 * pow(l, 3.0);
double t_1 = J * cos((K * 0.5));
double t_2 = U + (t_1 * t_0);
double t_3 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -6.1e+85) {
tmp = t_2;
} else if (l <= -7800000000.0) {
tmp = U + (((-0.125 * (K * K)) + 1.0) * t_3);
} else if (l <= 0.07) {
tmp = U + (t_1 * (t_0 + (l * 2.0)));
} else if (l <= 6e+51) {
tmp = U + t_3;
} 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) :: t_3
real(8) :: tmp
t_0 = 0.3333333333333333d0 * (l ** 3.0d0)
t_1 = j * cos((k * 0.5d0))
t_2 = u + (t_1 * t_0)
t_3 = (exp(l) - exp(-l)) * j
if (l <= (-6.1d+85)) then
tmp = t_2
else if (l <= (-7800000000.0d0)) then
tmp = u + ((((-0.125d0) * (k * k)) + 1.0d0) * t_3)
else if (l <= 0.07d0) then
tmp = u + (t_1 * (t_0 + (l * 2.0d0)))
else if (l <= 6d+51) then
tmp = u + t_3
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 = 0.3333333333333333 * Math.pow(l, 3.0);
double t_1 = J * Math.cos((K * 0.5));
double t_2 = U + (t_1 * t_0);
double t_3 = (Math.exp(l) - Math.exp(-l)) * J;
double tmp;
if (l <= -6.1e+85) {
tmp = t_2;
} else if (l <= -7800000000.0) {
tmp = U + (((-0.125 * (K * K)) + 1.0) * t_3);
} else if (l <= 0.07) {
tmp = U + (t_1 * (t_0 + (l * 2.0)));
} else if (l <= 6e+51) {
tmp = U + t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(J, l, K, U): t_0 = 0.3333333333333333 * math.pow(l, 3.0) t_1 = J * math.cos((K * 0.5)) t_2 = U + (t_1 * t_0) t_3 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -6.1e+85: tmp = t_2 elif l <= -7800000000.0: tmp = U + (((-0.125 * (K * K)) + 1.0) * t_3) elif l <= 0.07: tmp = U + (t_1 * (t_0 + (l * 2.0))) elif l <= 6e+51: tmp = U + t_3 else: tmp = t_2 return tmp
function code(J, l, K, U) t_0 = Float64(0.3333333333333333 * (l ^ 3.0)) t_1 = Float64(J * cos(Float64(K * 0.5))) t_2 = Float64(U + Float64(t_1 * t_0)) t_3 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -6.1e+85) tmp = t_2; elseif (l <= -7800000000.0) tmp = Float64(U + Float64(Float64(Float64(-0.125 * Float64(K * K)) + 1.0) * t_3)); elseif (l <= 0.07) tmp = Float64(U + Float64(t_1 * Float64(t_0 + Float64(l * 2.0)))); elseif (l <= 6e+51) tmp = Float64(U + t_3); else tmp = t_2; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 0.3333333333333333 * (l ^ 3.0); t_1 = J * cos((K * 0.5)); t_2 = U + (t_1 * t_0); t_3 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -6.1e+85) tmp = t_2; elseif (l <= -7800000000.0) tmp = U + (((-0.125 * (K * K)) + 1.0) * t_3); elseif (l <= 0.07) tmp = U + (t_1 * (t_0 + (l * 2.0))); elseif (l <= 6e+51) tmp = U + t_3; else tmp = t_2; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(U + N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -6.1e+85], t$95$2, If[LessEqual[l, -7800000000.0], N[(U + N[(N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.07], N[(U + N[(t$95$1 * N[(t$95$0 + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+51], N[(U + t$95$3), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot {\ell}^{3}\\
t_1 := J \cdot \cos \left(K \cdot 0.5\right)\\
t_2 := U + t_1 \cdot t_0\\
t_3 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -6.1 \cdot 10^{+85}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq -7800000000:\\
\;\;\;\;U + \left(-0.125 \cdot \left(K \cdot K\right) + 1\right) \cdot t_3\\
\mathbf{elif}\;\ell \leq 0.07:\\
\;\;\;\;U + t_1 \cdot \left(t_0 + \ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+51}:\\
\;\;\;\;U + t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if l < -6.09999999999999981e85 or 6e51 < l Initial program 100.0%
Taylor expanded in l around 0 96.2%
*-commutative96.2%
associate-*l*96.2%
*-commutative96.2%
associate-*r*96.2%
*-commutative96.2%
associate-*l*96.2%
*-commutative96.2%
associate-*r*96.2%
distribute-rgt-out96.2%
+-commutative96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in l around inf 96.2%
if -6.09999999999999981e85 < l < -7.8e9Initial program 100.0%
Taylor expanded in K around 0 0.0%
associate-*r*0.0%
distribute-rgt1-in92.9%
unpow292.9%
Simplified92.9%
if -7.8e9 < l < 0.070000000000000007Initial program 71.5%
Taylor expanded in l around 0 99.2%
*-commutative99.2%
associate-*l*99.2%
*-commutative99.2%
associate-*r*99.2%
*-commutative99.2%
associate-*l*99.2%
*-commutative99.2%
associate-*r*99.2%
distribute-rgt-out99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Taylor expanded in l around 0 99.2%
if 0.070000000000000007 < l < 6e51Initial program 100.0%
Taylor expanded in K around 0 90.9%
Final simplification97.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (cos (* K 0.5))))
(t_1 (+ U (* t_0 (* 0.3333333333333333 (pow l 3.0)))))
(t_2 (* (- (exp l) (exp (- l))) J)))
(if (<= l -2.65e+101)
t_1
(if (<= l -225.0)
t_2
(if (<= l 0.00235)
(+ U (* t_0 (* l 2.0)))
(if (<= l 6e+51) (+ U t_2) t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = J * cos((K * 0.5));
double t_1 = U + (t_0 * (0.3333333333333333 * pow(l, 3.0)));
double t_2 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -2.65e+101) {
tmp = t_1;
} else if (l <= -225.0) {
tmp = t_2;
} else if (l <= 0.00235) {
tmp = U + (t_0 * (l * 2.0));
} else if (l <= 6e+51) {
tmp = U + t_2;
} else {
tmp = t_1;
}
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 = j * cos((k * 0.5d0))
t_1 = u + (t_0 * (0.3333333333333333d0 * (l ** 3.0d0)))
t_2 = (exp(l) - exp(-l)) * j
if (l <= (-2.65d+101)) then
tmp = t_1
else if (l <= (-225.0d0)) then
tmp = t_2
else if (l <= 0.00235d0) then
tmp = u + (t_0 * (l * 2.0d0))
else if (l <= 6d+51) then
tmp = u + t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * Math.cos((K * 0.5));
double t_1 = U + (t_0 * (0.3333333333333333 * Math.pow(l, 3.0)));
double t_2 = (Math.exp(l) - Math.exp(-l)) * J;
double tmp;
if (l <= -2.65e+101) {
tmp = t_1;
} else if (l <= -225.0) {
tmp = t_2;
} else if (l <= 0.00235) {
tmp = U + (t_0 * (l * 2.0));
} else if (l <= 6e+51) {
tmp = U + t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * math.cos((K * 0.5)) t_1 = U + (t_0 * (0.3333333333333333 * math.pow(l, 3.0))) t_2 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -2.65e+101: tmp = t_1 elif l <= -225.0: tmp = t_2 elif l <= 0.00235: tmp = U + (t_0 * (l * 2.0)) elif l <= 6e+51: tmp = U + t_2 else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = Float64(J * cos(Float64(K * 0.5))) t_1 = Float64(U + Float64(t_0 * Float64(0.3333333333333333 * (l ^ 3.0)))) t_2 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -2.65e+101) tmp = t_1; elseif (l <= -225.0) tmp = t_2; elseif (l <= 0.00235) tmp = Float64(U + Float64(t_0 * Float64(l * 2.0))); elseif (l <= 6e+51) tmp = Float64(U + t_2); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * cos((K * 0.5)); t_1 = U + (t_0 * (0.3333333333333333 * (l ^ 3.0))); t_2 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -2.65e+101) tmp = t_1; elseif (l <= -225.0) tmp = t_2; elseif (l <= 0.00235) tmp = U + (t_0 * (l * 2.0)); elseif (l <= 6e+51) tmp = U + t_2; else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(t$95$0 * N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -2.65e+101], t$95$1, If[LessEqual[l, -225.0], t$95$2, If[LessEqual[l, 0.00235], N[(U + N[(t$95$0 * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+51], N[(U + t$95$2), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \cos \left(K \cdot 0.5\right)\\
t_1 := U + t_0 \cdot \left(0.3333333333333333 \cdot {\ell}^{3}\right)\\
t_2 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -2.65 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -225:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq 0.00235:\\
\;\;\;\;U + t_0 \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+51}:\\
\;\;\;\;U + t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -2.65000000000000003e101 or 6e51 < l Initial program 100.0%
Taylor expanded in l around 0 97.0%
*-commutative97.0%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.0%
*-commutative97.0%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.0%
distribute-rgt-out97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in l around inf 97.0%
if -2.65000000000000003e101 < l < -225Initial program 100.0%
Taylor expanded in K around 0 66.7%
Taylor expanded in J around inf 66.7%
if -225 < l < 0.00235000000000000009Initial program 71.3%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
Simplified99.9%
if 0.00235000000000000009 < l < 6e51Initial program 100.0%
Taylor expanded in K around 0 90.9%
Final simplification96.1%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.055) (+ U (* (* J (cos (* K 0.5))) (* l 2.0))) (+ U (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.055) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else {
tmp = U + (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= (-0.055d0)) then
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
else
tmp = u + (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= -0.055) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else {
tmp = U + (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.055: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) else: tmp = U + (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.055) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); else tmp = Float64(U + Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.055) tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); else tmp = U + (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.055], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.055:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.0550000000000000003Initial program 83.8%
Taylor expanded in l around 0 92.6%
*-commutative92.6%
associate-*l*92.7%
*-commutative92.7%
associate-*r*92.7%
*-commutative92.7%
associate-*l*92.7%
*-commutative92.7%
associate-*r*92.7%
distribute-rgt-out92.7%
+-commutative92.7%
fma-def92.7%
Simplified92.7%
Taylor expanded in l around 0 64.9%
*-commutative64.9%
Simplified64.9%
if -0.0550000000000000003 < (cos.f64 (/.f64 K 2)) Initial program 86.3%
Taylor expanded in l around 0 89.9%
*-commutative89.9%
associate-*l*89.9%
*-commutative89.9%
associate-*r*89.9%
*-commutative89.9%
associate-*l*89.9%
*-commutative89.9%
associate-*r*89.9%
distribute-rgt-out89.9%
+-commutative89.9%
fma-def89.9%
Simplified89.9%
Taylor expanded in K around 0 86.1%
Final simplification80.7%
(FPCore (J l K U) :precision binary64 (+ U (* (cos (/ K 2.0)) (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))))
double code(double J, double l, double K, double U) {
return U + (cos((K / 2.0)) * (J * ((0.3333333333333333 * pow(l, 3.0)) + (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 * ((0.3333333333333333d0 * (l ** 3.0d0)) + (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 * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)))); end
code[J_, l_, K_, U_] := N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)
\end{array}
Initial program 85.6%
Taylor expanded in l around 0 90.6%
Final simplification90.6%
(FPCore (J l K U) :precision binary64 (+ U (* (* J (cos (* K 0.5))) (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))))
double code(double J, double l, double K, double U) {
return U + ((J * cos((K * 0.5))) * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0)));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + ((j * cos((k * 0.5d0))) * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0)))
end function
public static double code(double J, double l, double K, double U) {
return U + ((J * Math.cos((K * 0.5))) * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0)));
}
def code(J, l, K, U): return U + ((J * math.cos((K * 0.5))) * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)))
function code(J, l, K, U) return Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0)))) end
function tmp = code(J, l, K, U) tmp = U + ((J * cos((K * 0.5))) * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0))); end
code[J_, l_, K_, U_] := N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)
\end{array}
Initial program 85.6%
Taylor expanded in l around 0 90.6%
*-commutative90.6%
associate-*l*90.6%
*-commutative90.6%
associate-*r*90.6%
*-commutative90.6%
associate-*l*90.6%
*-commutative90.6%
associate-*r*90.6%
distribute-rgt-out90.6%
+-commutative90.6%
fma-def90.6%
Simplified90.6%
Taylor expanded in l around 0 90.6%
Final simplification90.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (- (exp l) (exp (- l))) J)))
(if (<= l -260.0)
t_0
(if (<= l 0.00094)
(+ U (* (* J (cos (* K 0.5))) (* l 2.0)))
(if (<= l 6e+51)
(+ U t_0)
(+
U
(*
(* J (pow l 3.0))
(+ 0.3333333333333333 (* (* K K) -0.041666666666666664)))))))))
double code(double J, double l, double K, double U) {
double t_0 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -260.0) {
tmp = t_0;
} else if (l <= 0.00094) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else if (l <= 6e+51) {
tmp = U + t_0;
} else {
tmp = U + ((J * pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
}
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 = (exp(l) - exp(-l)) * j
if (l <= (-260.0d0)) then
tmp = t_0
else if (l <= 0.00094d0) then
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
else if (l <= 6d+51) then
tmp = u + t_0
else
tmp = u + ((j * (l ** 3.0d0)) * (0.3333333333333333d0 + ((k * k) * (-0.041666666666666664d0))))
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;
double tmp;
if (l <= -260.0) {
tmp = t_0;
} else if (l <= 0.00094) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else if (l <= 6e+51) {
tmp = U + t_0;
} else {
tmp = U + ((J * Math.pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
}
return tmp;
}
def code(J, l, K, U): t_0 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -260.0: tmp = t_0 elif l <= 0.00094: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) elif l <= 6e+51: tmp = U + t_0 else: tmp = U + ((J * math.pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -260.0) tmp = t_0; elseif (l <= 0.00094) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); elseif (l <= 6e+51) tmp = Float64(U + t_0); else tmp = Float64(U + Float64(Float64(J * (l ^ 3.0)) * Float64(0.3333333333333333 + Float64(Float64(K * K) * -0.041666666666666664)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -260.0) tmp = t_0; elseif (l <= 0.00094) tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); elseif (l <= 6e+51) tmp = U + t_0; else tmp = U + ((J * (l ^ 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -260.0], t$95$0, If[LessEqual[l, 0.00094], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+51], N[(U + t$95$0), $MachinePrecision], N[(U + N[(N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(K * K), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -260:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 0.00094:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+51}:\\
\;\;\;\;U + t_0\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot {\ell}^{3}\right) \cdot \left(0.3333333333333333 + \left(K \cdot K\right) \cdot -0.041666666666666664\right)\\
\end{array}
\end{array}
if l < -260Initial program 100.0%
Taylor expanded in K around 0 77.1%
Taylor expanded in J around inf 77.1%
if -260 < l < 9.39999999999999972e-4Initial program 71.3%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
Simplified99.9%
if 9.39999999999999972e-4 < l < 6e51Initial program 100.0%
Taylor expanded in K around 0 90.9%
if 6e51 < l Initial program 100.0%
Taylor expanded in l around 0 93.8%
*-commutative93.8%
associate-*l*93.8%
*-commutative93.8%
associate-*r*93.8%
*-commutative93.8%
associate-*l*93.8%
*-commutative93.8%
associate-*r*93.8%
distribute-rgt-out93.8%
+-commutative93.8%
fma-def93.8%
Simplified93.8%
Taylor expanded in l around inf 93.8%
Taylor expanded in K around 0 4.3%
+-commutative4.3%
unpow24.3%
associate-*r*4.3%
distribute-rgt-out76.6%
Simplified76.6%
Final simplification89.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (- (exp l) (exp (- l))) J)))
(if (<= l -102.0)
t_0
(if (<= l 240.0)
(+ U (* (* J (cos (* K 0.5))) (* l 2.0)))
(if (<= l 5.8e+51)
t_0
(+
U
(*
(* J (pow l 3.0))
(+ 0.3333333333333333 (* (* K K) -0.041666666666666664)))))))))
double code(double J, double l, double K, double U) {
double t_0 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -102.0) {
tmp = t_0;
} else if (l <= 240.0) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else if (l <= 5.8e+51) {
tmp = t_0;
} else {
tmp = U + ((J * pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
}
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 = (exp(l) - exp(-l)) * j
if (l <= (-102.0d0)) then
tmp = t_0
else if (l <= 240.0d0) then
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
else if (l <= 5.8d+51) then
tmp = t_0
else
tmp = u + ((j * (l ** 3.0d0)) * (0.3333333333333333d0 + ((k * k) * (-0.041666666666666664d0))))
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;
double tmp;
if (l <= -102.0) {
tmp = t_0;
} else if (l <= 240.0) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else if (l <= 5.8e+51) {
tmp = t_0;
} else {
tmp = U + ((J * Math.pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
}
return tmp;
}
def code(J, l, K, U): t_0 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -102.0: tmp = t_0 elif l <= 240.0: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) elif l <= 5.8e+51: tmp = t_0 else: tmp = U + ((J * math.pow(l, 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -102.0) tmp = t_0; elseif (l <= 240.0) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); elseif (l <= 5.8e+51) tmp = t_0; else tmp = Float64(U + Float64(Float64(J * (l ^ 3.0)) * Float64(0.3333333333333333 + Float64(Float64(K * K) * -0.041666666666666664)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -102.0) tmp = t_0; elseif (l <= 240.0) tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); elseif (l <= 5.8e+51) tmp = t_0; else tmp = U + ((J * (l ^ 3.0)) * (0.3333333333333333 + ((K * K) * -0.041666666666666664))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -102.0], t$95$0, If[LessEqual[l, 240.0], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+51], t$95$0, N[(U + N[(N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(K * K), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -102:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 240:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+51}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot {\ell}^{3}\right) \cdot \left(0.3333333333333333 + \left(K \cdot K\right) \cdot -0.041666666666666664\right)\\
\end{array}
\end{array}
if l < -102 or 240 < l < 5.7999999999999997e51Initial program 100.0%
Taylor expanded in K around 0 79.0%
Taylor expanded in J around inf 79.0%
if -102 < l < 240Initial program 71.3%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in l around 0 99.9%
*-commutative99.9%
Simplified99.9%
if 5.7999999999999997e51 < l Initial program 100.0%
Taylor expanded in l around 0 93.8%
*-commutative93.8%
associate-*l*93.8%
*-commutative93.8%
associate-*r*93.8%
*-commutative93.8%
associate-*l*93.8%
*-commutative93.8%
associate-*r*93.8%
distribute-rgt-out93.8%
+-commutative93.8%
fma-def93.8%
Simplified93.8%
Taylor expanded in l around inf 93.8%
Taylor expanded in K around 0 4.3%
+-commutative4.3%
unpow24.3%
associate-*r*4.3%
distribute-rgt-out76.6%
Simplified76.6%
Final simplification89.0%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.04) (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25)))) (+ U (* 0.3333333333333333 (* J (pow l 3.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (0.3333333333333333 * (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) :: tmp
if (cos((k / 2.0d0)) <= (-0.04d0)) then
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
else
tmp = u + (0.3333333333333333d0 * (j * (l ** 3.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= -0.04) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.04: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) else: tmp = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); else tmp = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.04) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); else tmp = U + (0.3333333333333333 * (J * (l ^ 3.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.0400000000000000008Initial program 84.3%
Taylor expanded in l around 0 64.4%
Taylor expanded in K around 0 45.2%
+-commutative45.2%
unpow245.2%
associate-*r*45.2%
distribute-rgt-out57.2%
Simplified57.2%
if -0.0400000000000000008 < (cos.f64 (/.f64 K 2)) Initial program 86.1%
Taylor expanded in l around 0 90.4%
*-commutative90.4%
associate-*l*90.3%
*-commutative90.3%
associate-*r*90.3%
*-commutative90.3%
associate-*l*90.3%
*-commutative90.3%
associate-*r*90.3%
distribute-rgt-out90.4%
+-commutative90.4%
fma-def90.4%
Simplified90.4%
Taylor expanded in l around inf 76.3%
Taylor expanded in K around 0 76.3%
Final simplification71.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (pow l 3.0)))
(t_1
(+
U
(* t_0 (+ 0.3333333333333333 (* (* K K) -0.041666666666666664))))))
(if (<= l -2e+142)
(+ U (* 0.3333333333333333 t_0))
(if (<= l -7800000000.0)
t_1
(if (<= l 3500.0)
(+ U (* (* J (cos (* K 0.5))) (* l 2.0)))
(if (<= l 4.9e+51) (log1p (expm1 U)) t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = J * pow(l, 3.0);
double t_1 = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
double tmp;
if (l <= -2e+142) {
tmp = U + (0.3333333333333333 * t_0);
} else if (l <= -7800000000.0) {
tmp = t_1;
} else if (l <= 3500.0) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else if (l <= 4.9e+51) {
tmp = log1p(expm1(U));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = J * Math.pow(l, 3.0);
double t_1 = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
double tmp;
if (l <= -2e+142) {
tmp = U + (0.3333333333333333 * t_0);
} else if (l <= -7800000000.0) {
tmp = t_1;
} else if (l <= 3500.0) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else if (l <= 4.9e+51) {
tmp = Math.log1p(Math.expm1(U));
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * math.pow(l, 3.0) t_1 = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664))) tmp = 0 if l <= -2e+142: tmp = U + (0.3333333333333333 * t_0) elif l <= -7800000000.0: tmp = t_1 elif l <= 3500.0: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) elif l <= 4.9e+51: tmp = math.log1p(math.expm1(U)) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = Float64(J * (l ^ 3.0)) t_1 = Float64(U + Float64(t_0 * Float64(0.3333333333333333 + Float64(Float64(K * K) * -0.041666666666666664)))) tmp = 0.0 if (l <= -2e+142) tmp = Float64(U + Float64(0.3333333333333333 * t_0)); elseif (l <= -7800000000.0) tmp = t_1; elseif (l <= 3500.0) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); elseif (l <= 4.9e+51) tmp = log1p(expm1(U)); else tmp = t_1; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(t$95$0 * N[(0.3333333333333333 + N[(N[(K * K), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e+142], N[(U + N[(0.3333333333333333 * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -7800000000.0], t$95$1, If[LessEqual[l, 3500.0], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.9e+51], N[Log[1 + N[(Exp[U] - 1), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot {\ell}^{3}\\
t_1 := U + t_0 \cdot \left(0.3333333333333333 + \left(K \cdot K\right) \cdot -0.041666666666666664\right)\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{+142}:\\
\;\;\;\;U + 0.3333333333333333 \cdot t_0\\
\mathbf{elif}\;\ell \leq -7800000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 3500:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 4.9 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(U\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -2.0000000000000001e142Initial program 100.0%
Taylor expanded in l around 0 100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
Taylor expanded in K around 0 87.8%
if -2.0000000000000001e142 < l < -7.8e9 or 4.89999999999999983e51 < l Initial program 100.0%
Taylor expanded in l around 0 80.7%
*-commutative80.7%
associate-*l*80.7%
*-commutative80.7%
associate-*r*80.7%
*-commutative80.7%
associate-*l*80.7%
*-commutative80.7%
associate-*r*80.7%
distribute-rgt-out80.7%
+-commutative80.7%
fma-def80.7%
Simplified80.7%
Taylor expanded in l around inf 80.7%
Taylor expanded in K around 0 7.1%
+-commutative7.1%
unpow27.1%
associate-*r*7.1%
distribute-rgt-out68.4%
Simplified68.4%
if -7.8e9 < l < 3500Initial program 71.7%
Taylor expanded in l around 0 98.5%
*-commutative98.5%
associate-*l*98.5%
*-commutative98.5%
associate-*r*98.5%
*-commutative98.5%
associate-*l*98.5%
*-commutative98.5%
associate-*r*98.5%
distribute-rgt-out98.5%
+-commutative98.5%
fma-def98.5%
Simplified98.5%
Taylor expanded in l around 0 98.4%
*-commutative98.4%
Simplified98.4%
if 3500 < l < 4.89999999999999983e51Initial program 100.0%
Applied egg-rr1.8%
Applied egg-rr70.4%
Final simplification86.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (pow l 3.0))))
(if (<= l -7e+140)
(+ U (* 0.3333333333333333 t_0))
(if (or (<= l -7800000000.0) (not (<= l 1.32e+26)))
(+ U (* t_0 (+ 0.3333333333333333 (* (* K K) -0.041666666666666664))))
(+ U (* (* J (cos (* K 0.5))) (* l 2.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = J * pow(l, 3.0);
double tmp;
if (l <= -7e+140) {
tmp = U + (0.3333333333333333 * t_0);
} else if ((l <= -7800000000.0) || !(l <= 1.32e+26)) {
tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
} else {
tmp = U + ((J * cos((K * 0.5))) * (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 = j * (l ** 3.0d0)
if (l <= (-7d+140)) then
tmp = u + (0.3333333333333333d0 * t_0)
else if ((l <= (-7800000000.0d0)) .or. (.not. (l <= 1.32d+26))) then
tmp = u + (t_0 * (0.3333333333333333d0 + ((k * k) * (-0.041666666666666664d0))))
else
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * Math.pow(l, 3.0);
double tmp;
if (l <= -7e+140) {
tmp = U + (0.3333333333333333 * t_0);
} else if ((l <= -7800000000.0) || !(l <= 1.32e+26)) {
tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664)));
} else {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
}
return tmp;
}
def code(J, l, K, U): t_0 = J * math.pow(l, 3.0) tmp = 0 if l <= -7e+140: tmp = U + (0.3333333333333333 * t_0) elif (l <= -7800000000.0) or not (l <= 1.32e+26): tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664))) else: tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) return tmp
function code(J, l, K, U) t_0 = Float64(J * (l ^ 3.0)) tmp = 0.0 if (l <= -7e+140) tmp = Float64(U + Float64(0.3333333333333333 * t_0)); elseif ((l <= -7800000000.0) || !(l <= 1.32e+26)) tmp = Float64(U + Float64(t_0 * Float64(0.3333333333333333 + Float64(Float64(K * K) * -0.041666666666666664)))); else tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (l ^ 3.0); tmp = 0.0; if (l <= -7e+140) tmp = U + (0.3333333333333333 * t_0); elseif ((l <= -7800000000.0) || ~((l <= 1.32e+26))) tmp = U + (t_0 * (0.3333333333333333 + ((K * K) * -0.041666666666666664))); else tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7e+140], N[(U + N[(0.3333333333333333 * t$95$0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, -7800000000.0], N[Not[LessEqual[l, 1.32e+26]], $MachinePrecision]], N[(U + N[(t$95$0 * N[(0.3333333333333333 + N[(N[(K * K), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot {\ell}^{3}\\
\mathbf{if}\;\ell \leq -7 \cdot 10^{+140}:\\
\;\;\;\;U + 0.3333333333333333 \cdot t_0\\
\mathbf{elif}\;\ell \leq -7800000000 \lor \neg \left(\ell \leq 1.32 \cdot 10^{+26}\right):\\
\;\;\;\;U + t_0 \cdot \left(0.3333333333333333 + \left(K \cdot K\right) \cdot -0.041666666666666664\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\end{array}
\end{array}
if l < -6.99999999999999978e140Initial program 100.0%
Taylor expanded in l around 0 100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
Taylor expanded in K around 0 87.8%
if -6.99999999999999978e140 < l < -7.8e9 or 1.32e26 < l Initial program 100.0%
Taylor expanded in l around 0 79.3%
*-commutative79.3%
associate-*l*79.3%
*-commutative79.3%
associate-*r*79.3%
*-commutative79.3%
associate-*l*79.3%
*-commutative79.3%
associate-*r*79.3%
distribute-rgt-out79.3%
+-commutative79.3%
fma-def79.3%
Simplified79.3%
Taylor expanded in l around inf 79.3%
Taylor expanded in K around 0 6.8%
+-commutative6.8%
unpow26.8%
associate-*r*6.8%
distribute-rgt-out67.5%
Simplified67.5%
if -7.8e9 < l < 1.32e26Initial program 73.0%
Taylor expanded in l around 0 94.3%
*-commutative94.3%
associate-*l*94.4%
*-commutative94.4%
associate-*r*94.4%
*-commutative94.4%
associate-*l*94.4%
*-commutative94.4%
associate-*r*94.4%
distribute-rgt-out94.4%
+-commutative94.4%
fma-def94.4%
Simplified94.4%
Taylor expanded in l around 0 94.3%
*-commutative94.3%
Simplified94.3%
Final simplification85.0%
(FPCore (J l K U) :precision binary64 (if (or (<= J -9.5e+17) (not (<= J 2.9e+125))) (+ U (* (cos (/ K 2.0)) (* J (* l 2.0)))) (+ U (* 0.3333333333333333 (* J (pow l 3.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((J <= -9.5e+17) || !(J <= 2.9e+125)) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (0.3333333333333333 * (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) :: tmp
if ((j <= (-9.5d+17)) .or. (.not. (j <= 2.9d+125))) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
else
tmp = u + (0.3333333333333333d0 * (j * (l ** 3.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((J <= -9.5e+17) || !(J <= 2.9e+125)) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = U + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (J <= -9.5e+17) or not (J <= 2.9e+125): tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) else: tmp = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((J <= -9.5e+17) || !(J <= 2.9e+125)) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); else tmp = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((J <= -9.5e+17) || ~((J <= 2.9e+125))) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); else tmp = U + (0.3333333333333333 * (J * (l ^ 3.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[J, -9.5e+17], N[Not[LessEqual[J, 2.9e+125]], $MachinePrecision]], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;J \leq -9.5 \cdot 10^{+17} \lor \neg \left(J \leq 2.9 \cdot 10^{+125}\right):\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\end{array}
\end{array}
if J < -9.5e17 or 2.89999999999999993e125 < J Initial program 68.0%
Taylor expanded in l around 0 85.4%
if -9.5e17 < J < 2.89999999999999993e125Initial program 96.4%
Taylor expanded in l around 0 87.9%
*-commutative87.9%
associate-*l*87.9%
*-commutative87.9%
associate-*r*87.9%
*-commutative87.9%
associate-*l*87.9%
*-commutative87.9%
associate-*r*87.9%
distribute-rgt-out87.9%
+-commutative87.9%
fma-def87.9%
Simplified87.9%
Taylor expanded in l around inf 84.1%
Taylor expanded in K around 0 75.2%
Final simplification79.1%
(FPCore (J l K U) :precision binary64 (if (or (<= J -5.4e+17) (not (<= J 3.4e+125))) (+ U (* (* J (cos (* K 0.5))) (* l 2.0))) (+ U (* 0.3333333333333333 (* J (pow l 3.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((J <= -5.4e+17) || !(J <= 3.4e+125)) {
tmp = U + ((J * cos((K * 0.5))) * (l * 2.0));
} else {
tmp = U + (0.3333333333333333 * (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) :: tmp
if ((j <= (-5.4d+17)) .or. (.not. (j <= 3.4d+125))) then
tmp = u + ((j * cos((k * 0.5d0))) * (l * 2.0d0))
else
tmp = u + (0.3333333333333333d0 * (j * (l ** 3.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((J <= -5.4e+17) || !(J <= 3.4e+125)) {
tmp = U + ((J * Math.cos((K * 0.5))) * (l * 2.0));
} else {
tmp = U + (0.3333333333333333 * (J * Math.pow(l, 3.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (J <= -5.4e+17) or not (J <= 3.4e+125): tmp = U + ((J * math.cos((K * 0.5))) * (l * 2.0)) else: tmp = U + (0.3333333333333333 * (J * math.pow(l, 3.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((J <= -5.4e+17) || !(J <= 3.4e+125)) tmp = Float64(U + Float64(Float64(J * cos(Float64(K * 0.5))) * Float64(l * 2.0))); else tmp = Float64(U + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((J <= -5.4e+17) || ~((J <= 3.4e+125))) tmp = U + ((J * cos((K * 0.5))) * (l * 2.0)); else tmp = U + (0.3333333333333333 * (J * (l ^ 3.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[J, -5.4e+17], N[Not[LessEqual[J, 3.4e+125]], $MachinePrecision]], N[(U + N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;J \leq -5.4 \cdot 10^{+17} \lor \neg \left(J \leq 3.4 \cdot 10^{+125}\right):\\
\;\;\;\;U + \left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(\ell \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;U + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\end{array}
\end{array}
if J < -5.4e17 or 3.3999999999999999e125 < J Initial program 68.0%
Taylor expanded in l around 0 95.1%
*-commutative95.1%
associate-*l*95.1%
*-commutative95.1%
associate-*r*95.1%
*-commutative95.1%
associate-*l*95.1%
*-commutative95.1%
associate-*r*95.1%
distribute-rgt-out95.1%
+-commutative95.1%
fma-def95.1%
Simplified95.1%
Taylor expanded in l around 0 85.5%
*-commutative85.5%
Simplified85.5%
if -5.4e17 < J < 3.3999999999999999e125Initial program 96.4%
Taylor expanded in l around 0 87.9%
*-commutative87.9%
associate-*l*87.9%
*-commutative87.9%
associate-*r*87.9%
*-commutative87.9%
associate-*l*87.9%
*-commutative87.9%
associate-*r*87.9%
distribute-rgt-out87.9%
+-commutative87.9%
fma-def87.9%
Simplified87.9%
Taylor expanded in l around inf 84.1%
Taylor expanded in K around 0 75.2%
Final simplification79.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* K (* J K))) (t_1 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= l -1.9e+173)
(pow U -134217728.0)
(if (<= l -13500000000.0)
t_1
(if (<= l 940.0)
(+ U (* J (* l 2.0)))
(if (<= l 6e+44)
(+
U
(*
J
(+ 512.0 (* (* K K) (+ (* K (* K 1.3333333333333333)) -64.0)))))
(if (or (<= l 8e+103) (not (<= l 8.6e+142)))
t_1
(+
U
(/
(- (* t_0 t_0) (* (* J -8.0) (* J -8.0)))
(- t_0 (* J -8.0)))))))))))
double code(double J, double l, double K, double U) {
double t_0 = K * (J * K);
double t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -1.9e+173) {
tmp = pow(U, -134217728.0);
} else if (l <= -13500000000.0) {
tmp = t_1;
} else if (l <= 940.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 6e+44) {
tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0))));
} else if ((l <= 8e+103) || !(l <= 8.6e+142)) {
tmp = t_1;
} else {
tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.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 = k * (j * k)
t_1 = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
if (l <= (-1.9d+173)) then
tmp = u ** (-134217728.0d0)
else if (l <= (-13500000000.0d0)) then
tmp = t_1
else if (l <= 940.0d0) then
tmp = u + (j * (l * 2.0d0))
else if (l <= 6d+44) then
tmp = u + (j * (512.0d0 + ((k * k) * ((k * (k * 1.3333333333333333d0)) + (-64.0d0)))))
else if ((l <= 8d+103) .or. (.not. (l <= 8.6d+142))) then
tmp = t_1
else
tmp = u + (((t_0 * t_0) - ((j * (-8.0d0)) * (j * (-8.0d0)))) / (t_0 - (j * (-8.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = K * (J * K);
double t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -1.9e+173) {
tmp = Math.pow(U, -134217728.0);
} else if (l <= -13500000000.0) {
tmp = t_1;
} else if (l <= 940.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 6e+44) {
tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0))));
} else if ((l <= 8e+103) || !(l <= 8.6e+142)) {
tmp = t_1;
} else {
tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = K * (J * K) t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25))) tmp = 0 if l <= -1.9e+173: tmp = math.pow(U, -134217728.0) elif l <= -13500000000.0: tmp = t_1 elif l <= 940.0: tmp = U + (J * (l * 2.0)) elif l <= 6e+44: tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0)))) elif (l <= 8e+103) or not (l <= 8.6e+142): tmp = t_1 else: tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.0))) return tmp
function code(J, l, K, U) t_0 = Float64(K * Float64(J * K)) t_1 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) tmp = 0.0 if (l <= -1.9e+173) tmp = U ^ -134217728.0; elseif (l <= -13500000000.0) tmp = t_1; elseif (l <= 940.0) tmp = Float64(U + Float64(J * Float64(l * 2.0))); elseif (l <= 6e+44) tmp = Float64(U + Float64(J * Float64(512.0 + Float64(Float64(K * K) * Float64(Float64(K * Float64(K * 1.3333333333333333)) + -64.0))))); elseif ((l <= 8e+103) || !(l <= 8.6e+142)) tmp = t_1; else tmp = Float64(U + Float64(Float64(Float64(t_0 * t_0) - Float64(Float64(J * -8.0) * Float64(J * -8.0))) / Float64(t_0 - Float64(J * -8.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = K * (J * K); t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25))); tmp = 0.0; if (l <= -1.9e+173) tmp = U ^ -134217728.0; elseif (l <= -13500000000.0) tmp = t_1; elseif (l <= 940.0) tmp = U + (J * (l * 2.0)); elseif (l <= 6e+44) tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0)))); elseif ((l <= 8e+103) || ~((l <= 8.6e+142))) tmp = t_1; else tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(K * N[(J * K), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.9e+173], N[Power[U, -134217728.0], $MachinePrecision], If[LessEqual[l, -13500000000.0], t$95$1, If[LessEqual[l, 940.0], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+44], N[(U + N[(J * N[(512.0 + N[(N[(K * K), $MachinePrecision] * N[(N[(K * N[(K * 1.3333333333333333), $MachinePrecision]), $MachinePrecision] + -64.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 8e+103], N[Not[LessEqual[l, 8.6e+142]], $MachinePrecision]], t$95$1, N[(U + N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(N[(J * -8.0), $MachinePrecision] * N[(J * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - N[(J * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := K \cdot \left(J \cdot K\right)\\
t_1 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{if}\;\ell \leq -1.9 \cdot 10^{+173}:\\
\;\;\;\;{U}^{-134217728}\\
\mathbf{elif}\;\ell \leq -13500000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 940:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+44}:\\
\;\;\;\;U + J \cdot \left(512 + \left(K \cdot K\right) \cdot \left(K \cdot \left(K \cdot 1.3333333333333333\right) + -64\right)\right)\\
\mathbf{elif}\;\ell \leq 8 \cdot 10^{+103} \lor \neg \left(\ell \leq 8.6 \cdot 10^{+142}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;U + \frac{t_0 \cdot t_0 - \left(J \cdot -8\right) \cdot \left(J \cdot -8\right)}{t_0 - J \cdot -8}\\
\end{array}
\end{array}
if l < -1.90000000000000005e173Initial program 100.0%
Applied egg-rr2.8%
Applied egg-rr38.8%
if -1.90000000000000005e173 < l < -1.35e10 or 5.99999999999999974e44 < l < 8e103 or 8.60000000000000025e142 < l Initial program 100.0%
Taylor expanded in l around 0 30.5%
Taylor expanded in K around 0 20.0%
+-commutative20.0%
unpow220.0%
associate-*r*20.0%
distribute-rgt-out44.6%
Simplified44.6%
if -1.35e10 < l < 940Initial program 71.7%
Taylor expanded in K around 0 71.1%
Taylor expanded in l around 0 84.1%
if 940 < l < 5.99999999999999974e44Initial program 100.0%
Applied egg-rr5.3%
Taylor expanded in K around 0 2.1%
associate-+r+2.1%
+-commutative2.1%
associate-*r*2.1%
associate-*r*2.1%
distribute-rgt-out22.1%
*-commutative22.1%
distribute-rgt-in22.1%
+-commutative22.1%
metadata-eval22.1%
pow-sqr22.1%
associate-*r*22.1%
*-commutative22.1%
*-commutative22.1%
distribute-lft-out52.1%
unpow252.1%
unpow252.1%
associate-*r*52.1%
Simplified52.1%
if 8e103 < l < 8.60000000000000025e142Initial program 100.0%
Applied egg-rr2.4%
Taylor expanded in K around 0 22.7%
distribute-rgt-out22.7%
unpow222.7%
Simplified22.7%
distribute-lft-in22.7%
flip-+21.7%
*-commutative21.7%
*-commutative21.7%
associate-*l*21.7%
associate-*l*21.7%
*-commutative21.7%
associate-*l*41.7%
Applied egg-rr41.7%
Final simplification64.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* K (* J K))) (t_1 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= l -13500000000.0)
t_1
(if (<= l 550.0)
(+ U (* J (* l 2.0)))
(if (<= l 2.6e+36)
(+
U
(* J (+ 512.0 (* (* K K) (+ (* K (* K 1.3333333333333333)) -64.0)))))
(if (or (<= l 8e+103) (not (<= l 8.6e+142)))
t_1
(+
U
(/
(- (* t_0 t_0) (* (* J -8.0) (* J -8.0)))
(- t_0 (* J -8.0))))))))))
double code(double J, double l, double K, double U) {
double t_0 = K * (J * K);
double t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -13500000000.0) {
tmp = t_1;
} else if (l <= 550.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 2.6e+36) {
tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0))));
} else if ((l <= 8e+103) || !(l <= 8.6e+142)) {
tmp = t_1;
} else {
tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.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 = k * (j * k)
t_1 = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
if (l <= (-13500000000.0d0)) then
tmp = t_1
else if (l <= 550.0d0) then
tmp = u + (j * (l * 2.0d0))
else if (l <= 2.6d+36) then
tmp = u + (j * (512.0d0 + ((k * k) * ((k * (k * 1.3333333333333333d0)) + (-64.0d0)))))
else if ((l <= 8d+103) .or. (.not. (l <= 8.6d+142))) then
tmp = t_1
else
tmp = u + (((t_0 * t_0) - ((j * (-8.0d0)) * (j * (-8.0d0)))) / (t_0 - (j * (-8.0d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = K * (J * K);
double t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -13500000000.0) {
tmp = t_1;
} else if (l <= 550.0) {
tmp = U + (J * (l * 2.0));
} else if (l <= 2.6e+36) {
tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0))));
} else if ((l <= 8e+103) || !(l <= 8.6e+142)) {
tmp = t_1;
} else {
tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = K * (J * K) t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25))) tmp = 0 if l <= -13500000000.0: tmp = t_1 elif l <= 550.0: tmp = U + (J * (l * 2.0)) elif l <= 2.6e+36: tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0)))) elif (l <= 8e+103) or not (l <= 8.6e+142): tmp = t_1 else: tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.0))) return tmp
function code(J, l, K, U) t_0 = Float64(K * Float64(J * K)) t_1 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) tmp = 0.0 if (l <= -13500000000.0) tmp = t_1; elseif (l <= 550.0) tmp = Float64(U + Float64(J * Float64(l * 2.0))); elseif (l <= 2.6e+36) tmp = Float64(U + Float64(J * Float64(512.0 + Float64(Float64(K * K) * Float64(Float64(K * Float64(K * 1.3333333333333333)) + -64.0))))); elseif ((l <= 8e+103) || !(l <= 8.6e+142)) tmp = t_1; else tmp = Float64(U + Float64(Float64(Float64(t_0 * t_0) - Float64(Float64(J * -8.0) * Float64(J * -8.0))) / Float64(t_0 - Float64(J * -8.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = K * (J * K); t_1 = U + ((l * J) * (2.0 + ((K * K) * -0.25))); tmp = 0.0; if (l <= -13500000000.0) tmp = t_1; elseif (l <= 550.0) tmp = U + (J * (l * 2.0)); elseif (l <= 2.6e+36) tmp = U + (J * (512.0 + ((K * K) * ((K * (K * 1.3333333333333333)) + -64.0)))); elseif ((l <= 8e+103) || ~((l <= 8.6e+142))) tmp = t_1; else tmp = U + (((t_0 * t_0) - ((J * -8.0) * (J * -8.0))) / (t_0 - (J * -8.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(K * N[(J * K), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -13500000000.0], t$95$1, If[LessEqual[l, 550.0], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.6e+36], N[(U + N[(J * N[(512.0 + N[(N[(K * K), $MachinePrecision] * N[(N[(K * N[(K * 1.3333333333333333), $MachinePrecision]), $MachinePrecision] + -64.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 8e+103], N[Not[LessEqual[l, 8.6e+142]], $MachinePrecision]], t$95$1, N[(U + N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(N[(J * -8.0), $MachinePrecision] * N[(J * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - N[(J * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := K \cdot \left(J \cdot K\right)\\
t_1 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{if}\;\ell \leq -13500000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 550:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+36}:\\
\;\;\;\;U + J \cdot \left(512 + \left(K \cdot K\right) \cdot \left(K \cdot \left(K \cdot 1.3333333333333333\right) + -64\right)\right)\\
\mathbf{elif}\;\ell \leq 8 \cdot 10^{+103} \lor \neg \left(\ell \leq 8.6 \cdot 10^{+142}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;U + \frac{t_0 \cdot t_0 - \left(J \cdot -8\right) \cdot \left(J \cdot -8\right)}{t_0 - J \cdot -8}\\
\end{array}
\end{array}
if l < -1.35e10 or 2.6000000000000001e36 < l < 8e103 or 8.60000000000000025e142 < l Initial program 100.0%
Taylor expanded in l around 0 28.5%
Taylor expanded in K around 0 17.4%
+-commutative17.4%
unpow217.4%
associate-*r*17.4%
distribute-rgt-out39.0%
Simplified39.0%
if -1.35e10 < l < 550Initial program 71.7%
Taylor expanded in K around 0 71.1%
Taylor expanded in l around 0 84.1%
if 550 < l < 2.6000000000000001e36Initial program 100.0%
Applied egg-rr5.3%
Taylor expanded in K around 0 2.1%
associate-+r+2.1%
+-commutative2.1%
associate-*r*2.1%
associate-*r*2.1%
distribute-rgt-out22.1%
*-commutative22.1%
distribute-rgt-in22.1%
+-commutative22.1%
metadata-eval22.1%
pow-sqr22.1%
associate-*r*22.1%
*-commutative22.1%
*-commutative22.1%
distribute-lft-out52.1%
unpow252.1%
unpow252.1%
associate-*r*52.1%
Simplified52.1%
if 8e103 < l < 8.60000000000000025e142Initial program 100.0%
Applied egg-rr2.4%
Taylor expanded in K around 0 22.7%
distribute-rgt-out22.7%
unpow222.7%
Simplified22.7%
distribute-lft-in22.7%
flip-+21.7%
*-commutative21.7%
*-commutative21.7%
associate-*l*21.7%
associate-*l*21.7%
*-commutative21.7%
associate-*l*41.7%
Applied egg-rr41.7%
Final simplification62.5%
(FPCore (J l K U) :precision binary64 (if (or (<= l -13500000000.0) (not (<= l 1.32e+26))) (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25)))) (+ U (* J (* l 2.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -13500000000.0) || !(l <= 1.32e+26)) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (J * (l * 2.0));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-13500000000.0d0)) .or. (.not. (l <= 1.32d+26))) then
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
else
tmp = u + (j * (l * 2.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -13500000000.0) || !(l <= 1.32e+26)) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (J * (l * 2.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -13500000000.0) or not (l <= 1.32e+26): tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) else: tmp = U + (J * (l * 2.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -13500000000.0) || !(l <= 1.32e+26)) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); else tmp = Float64(U + Float64(J * Float64(l * 2.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -13500000000.0) || ~((l <= 1.32e+26))) tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); else tmp = U + (J * (l * 2.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -13500000000.0], N[Not[LessEqual[l, 1.32e+26]], $MachinePrecision]], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -13500000000 \lor \neg \left(\ell \leq 1.32 \cdot 10^{+26}\right):\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\end{array}
\end{array}
if l < -1.35e10 or 1.32e26 < l Initial program 100.0%
Taylor expanded in l around 0 27.0%
Taylor expanded in K around 0 18.0%
+-commutative18.0%
unpow218.0%
associate-*r*18.0%
distribute-rgt-out38.2%
Simplified38.2%
if -1.35e10 < l < 1.32e26Initial program 73.2%
Taylor expanded in K around 0 72.5%
Taylor expanded in l around 0 80.0%
Final simplification60.6%
(FPCore (J l K U) :precision binary64 (if (<= l 9e+29) (+ U (* J (* l 2.0))) (if (<= l 3.5e+253) (+ U (* J (+ 512.0 (* (* K K) -64.0)))) (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 9e+29) {
tmp = U + (J * (l * 2.0));
} else if (l <= 3.5e+253) {
tmp = U + (J * (512.0 + ((K * K) * -64.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 <= 9d+29) then
tmp = u + (j * (l * 2.0d0))
else if (l <= 3.5d+253) then
tmp = u + (j * (512.0d0 + ((k * k) * (-64.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 <= 9e+29) {
tmp = U + (J * (l * 2.0));
} else if (l <= 3.5e+253) {
tmp = U + (J * (512.0 + ((K * K) * -64.0)));
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 9e+29: tmp = U + (J * (l * 2.0)) elif l <= 3.5e+253: tmp = U + (J * (512.0 + ((K * K) * -64.0))) else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 9e+29) tmp = Float64(U + Float64(J * Float64(l * 2.0))); elseif (l <= 3.5e+253) tmp = Float64(U + Float64(J * Float64(512.0 + Float64(Float64(K * K) * -64.0)))); else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 9e+29) tmp = U + (J * (l * 2.0)); elseif (l <= 3.5e+253) tmp = U + (J * (512.0 + ((K * K) * -64.0))); else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 9e+29], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.5e+253], N[(U + N[(J * N[(512.0 + N[(N[(K * K), $MachinePrecision] * -64.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 9 \cdot 10^{+29}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 3.5 \cdot 10^{+253}:\\
\;\;\;\;U + J \cdot \left(512 + \left(K \cdot K\right) \cdot -64\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < 9.0000000000000005e29Initial program 82.2%
Taylor expanded in K around 0 74.0%
Taylor expanded in l around 0 60.0%
if 9.0000000000000005e29 < l < 3.49999999999999978e253Initial program 100.0%
Applied egg-rr4.5%
Taylor expanded in K around 0 33.4%
associate-*r*33.4%
distribute-rgt-out33.4%
+-commutative33.4%
*-commutative33.4%
unpow233.4%
Simplified33.4%
if 3.49999999999999978e253 < l Initial program 100.0%
Applied egg-rr2.2%
Applied egg-rr34.1%
Final simplification54.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (* K K)))))
(if (<= l -13500000000.0)
t_0
(if (<= l 1.15e-7) U (if (<= l 4.1e+228) t_0 (* U U))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * (K * K));
double tmp;
if (l <= -13500000000.0) {
tmp = t_0;
} else if (l <= 1.15e-7) {
tmp = U;
} else if (l <= 4.1e+228) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = u + (j * (k * k))
if (l <= (-13500000000.0d0)) then
tmp = t_0
else if (l <= 1.15d-7) then
tmp = u
else if (l <= 4.1d+228) then
tmp = t_0
else
tmp = u * u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (J * (K * K));
double tmp;
if (l <= -13500000000.0) {
tmp = t_0;
} else if (l <= 1.15e-7) {
tmp = U;
} else if (l <= 4.1e+228) {
tmp = t_0;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (J * (K * K)) tmp = 0 if l <= -13500000000.0: tmp = t_0 elif l <= 1.15e-7: tmp = U elif l <= 4.1e+228: tmp = t_0 else: tmp = U * U return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64(K * K))) tmp = 0.0 if (l <= -13500000000.0) tmp = t_0; elseif (l <= 1.15e-7) tmp = U; elseif (l <= 4.1e+228) tmp = t_0; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (J * (K * K)); tmp = 0.0; if (l <= -13500000000.0) tmp = t_0; elseif (l <= 1.15e-7) tmp = U; elseif (l <= 4.1e+228) tmp = t_0; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -13500000000.0], t$95$0, If[LessEqual[l, 1.15e-7], U, If[LessEqual[l, 4.1e+228], t$95$0, N[(U * U), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left(K \cdot K\right)\\
\mathbf{if}\;\ell \leq -13500000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 1.15 \cdot 10^{-7}:\\
\;\;\;\;U\\
\mathbf{elif}\;\ell \leq 4.1 \cdot 10^{+228}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -1.35e10 or 1.14999999999999997e-7 < l < 4.1e228Initial program 99.7%
Applied egg-rr2.8%
Taylor expanded in K around 0 18.2%
distribute-rgt-out18.2%
unpow218.2%
Simplified18.2%
Taylor expanded in K around inf 17.9%
unpow217.9%
*-commutative17.9%
Simplified17.9%
if -1.35e10 < l < 1.14999999999999997e-7Initial program 71.8%
Applied egg-rr48.0%
Taylor expanded in J around 0 69.9%
if 4.1e228 < l Initial program 100.0%
Applied egg-rr1.9%
Applied egg-rr28.6%
Final simplification44.9%
(FPCore (J l K U) :precision binary64 (if (<= l 2.6e+31) (+ U (* J (* l 2.0))) (if (<= l 2.4e+252) (+ U (* J (* K (* K -64.0)))) (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.6e+31) {
tmp = U + (J * (l * 2.0));
} else if (l <= 2.4e+252) {
tmp = U + (J * (K * (K * -64.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 <= 2.6d+31) then
tmp = u + (j * (l * 2.0d0))
else if (l <= 2.4d+252) then
tmp = u + (j * (k * (k * (-64.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 <= 2.6e+31) {
tmp = U + (J * (l * 2.0));
} else if (l <= 2.4e+252) {
tmp = U + (J * (K * (K * -64.0)));
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 2.6e+31: tmp = U + (J * (l * 2.0)) elif l <= 2.4e+252: tmp = U + (J * (K * (K * -64.0))) else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 2.6e+31) tmp = Float64(U + Float64(J * Float64(l * 2.0))); elseif (l <= 2.4e+252) tmp = Float64(U + Float64(J * Float64(K * Float64(K * -64.0)))); else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 2.6e+31) tmp = U + (J * (l * 2.0)); elseif (l <= 2.4e+252) tmp = U + (J * (K * (K * -64.0))); else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 2.6e+31], N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.4e+252], N[(U + N[(J * N[(K * N[(K * -64.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.6 \cdot 10^{+31}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot 2\right)\\
\mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+252}:\\
\;\;\;\;U + J \cdot \left(K \cdot \left(K \cdot -64\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < 2.6e31Initial program 82.2%
Taylor expanded in K around 0 74.0%
Taylor expanded in l around 0 60.0%
if 2.6e31 < l < 2.3999999999999999e252Initial program 100.0%
Applied egg-rr4.5%
Taylor expanded in K around 0 33.4%
associate-*r*33.4%
distribute-rgt-out33.4%
+-commutative33.4%
*-commutative33.4%
unpow233.4%
Simplified33.4%
Taylor expanded in K around inf 32.7%
*-commutative32.7%
unpow232.7%
*-commutative32.7%
associate-*r*32.7%
associate-*l*32.7%
Simplified32.7%
if 2.3999999999999999e252 < l Initial program 100.0%
Applied egg-rr2.2%
Applied egg-rr34.1%
Final simplification54.8%
(FPCore (J l K U) :precision binary64 (if (<= l -2.2e+26) (* U U) (if (<= l 2.35e+139) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.2e+26) {
tmp = U * U;
} else if (l <= 2.35e+139) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-2.2d+26)) then
tmp = u * u
else if (l <= 2.35d+139) then
tmp = u
else
tmp = u * u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.2e+26) {
tmp = U * U;
} else if (l <= 2.35e+139) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -2.2e+26: tmp = U * U elif l <= 2.35e+139: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -2.2e+26) tmp = Float64(U * U); elseif (l <= 2.35e+139) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -2.2e+26) tmp = U * U; elseif (l <= 2.35e+139) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -2.2e+26], N[(U * U), $MachinePrecision], If[LessEqual[l, 2.35e+139], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.2 \cdot 10^{+26}:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 2.35 \cdot 10^{+139}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -2.20000000000000007e26 or 2.35e139 < l Initial program 100.0%
Applied egg-rr2.8%
Applied egg-rr15.1%
if -2.20000000000000007e26 < l < 2.35e139Initial program 76.1%
Applied egg-rr40.6%
Taylor expanded in J around 0 59.2%
Final simplification41.6%
(FPCore (J l K U) :precision binary64 (+ U (* J (* l 2.0))))
double code(double J, double l, double K, double U) {
return U + (J * (l * 2.0));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (l * 2.0d0))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (l * 2.0));
}
def code(J, l, K, U): return U + (J * (l * 2.0))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(l * 2.0))) end
function tmp = code(J, l, K, U) tmp = U + (J * (l * 2.0)); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(\ell \cdot 2\right)
\end{array}
Initial program 85.6%
Taylor expanded in K around 0 72.4%
Taylor expanded in l around 0 52.0%
Final simplification52.0%
(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 85.6%
Applied egg-rr25.5%
Taylor expanded in J around 0 36.4%
Final simplification36.4%
herbie shell --seed 2023264
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))