
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 -2e+58) (not (<= t_1 0.0005)))
(+ (* t_0 (* t_1 J)) U)
(+
U
(*
t_0
(*
J
(+
(* 0.3333333333333333 (pow l 3.0))
(+
(* 0.0003968253968253968 (pow l 7.0))
(+ (* 0.016666666666666666 (pow l 5.0)) (* l 2.0))))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = exp(l) - exp(-l);
double tmp;
if ((t_1 <= -2e+58) || !(t_1 <= 0.0005)) {
tmp = (t_0 * (t_1 * J)) + U;
} else {
tmp = U + (t_0 * (J * ((0.3333333333333333 * pow(l, 3.0)) + ((0.0003968253968253968 * pow(l, 7.0)) + ((0.016666666666666666 * pow(l, 5.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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(l) - exp(-l)
if ((t_1 <= (-2d+58)) .or. (.not. (t_1 <= 0.0005d0))) then
tmp = (t_0 * (t_1 * j)) + u
else
tmp = u + (t_0 * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + ((0.0003968253968253968d0 * (l ** 7.0d0)) + ((0.016666666666666666d0 * (l ** 5.0d0)) + (l * 2.0d0))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_1 <= -2e+58) || !(t_1 <= 0.0005)) {
tmp = (t_0 * (t_1 * J)) + U;
} else {
tmp = U + (t_0 * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + ((0.0003968253968253968 * Math.pow(l, 7.0)) + ((0.016666666666666666 * Math.pow(l, 5.0)) + (l * 2.0))))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = math.exp(l) - math.exp(-l) tmp = 0 if (t_1 <= -2e+58) or not (t_1 <= 0.0005): tmp = (t_0 * (t_1 * J)) + U else: tmp = U + (t_0 * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + ((0.0003968253968253968 * math.pow(l, 7.0)) + ((0.016666666666666666 * math.pow(l, 5.0)) + (l * 2.0)))))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_1 <= -2e+58) || !(t_1 <= 0.0005)) tmp = Float64(Float64(t_0 * Float64(t_1 * J)) + U); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(Float64(0.0003968253968253968 * (l ^ 7.0)) + Float64(Float64(0.016666666666666666 * (l ^ 5.0)) + Float64(l * 2.0))))))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(l) - exp(-l); tmp = 0.0; if ((t_1 <= -2e+58) || ~((t_1 <= 0.0005))) tmp = (t_0 * (t_1 * J)) + U; else tmp = U + (t_0 * (J * ((0.3333333333333333 * (l ^ 3.0)) + ((0.0003968253968253968 * (l ^ 7.0)) + ((0.016666666666666666 * (l ^ 5.0)) + (l * 2.0)))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+58], N[Not[LessEqual[t$95$1, 0.0005]], $MachinePrecision]], N[(N[(t$95$0 * N[(t$95$1 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.0003968253968253968 * N[Power[l, 7.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.016666666666666666 * N[Power[l, 5.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+58} \lor \neg \left(t_1 \leq 0.0005\right):\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot J\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \left(0.0003968253968253968 \cdot {\ell}^{7} + \left(0.016666666666666666 \cdot {\ell}^{5} + \ell \cdot 2\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -1.99999999999999989e58 or 5.0000000000000001e-4 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -1.99999999999999989e58 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-4Initial program 70.8%
Taylor expanded in l around 0 99.9%
Final simplification99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 -0.05) (not (<= t_1 0.0005)))
(+ (* t_0 (* t_1 J)) U)
(+ U (* t_0 (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = exp(l) - exp(-l);
double tmp;
if ((t_1 <= -0.05) || !(t_1 <= 0.0005)) {
tmp = (t_0 * (t_1 * J)) + U;
} else {
tmp = U + (t_0 * (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(l) - exp(-l)
if ((t_1 <= (-0.05d0)) .or. (.not. (t_1 <= 0.0005d0))) then
tmp = (t_0 * (t_1 * j)) + u
else
tmp = u + (t_0 * (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 t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_1 <= -0.05) || !(t_1 <= 0.0005)) {
tmp = (t_0 * (t_1 * J)) + U;
} else {
tmp = U + (t_0 * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = math.exp(l) - math.exp(-l) tmp = 0 if (t_1 <= -0.05) or not (t_1 <= 0.0005): tmp = (t_0 * (t_1 * J)) + U else: tmp = U + (t_0 * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_1 <= -0.05) || !(t_1 <= 0.0005)) tmp = Float64(Float64(t_0 * Float64(t_1 * J)) + U); else tmp = Float64(U + Float64(t_0 * 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) t_0 = cos((K / 2.0)); t_1 = exp(l) - exp(-l); tmp = 0.0; if ((t_1 <= -0.05) || ~((t_1 <= 0.0005))) tmp = (t_0 * (t_1 * J)) + U; else tmp = U + (t_0 * (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -0.05], N[Not[LessEqual[t$95$1, 0.0005]], $MachinePrecision]], N[(N[(t$95$0 * N[(t$95$1 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * 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}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_1 \leq -0.05 \lor \neg \left(t_1 \leq 0.0005\right):\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot J\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -0.050000000000000003 or 5.0000000000000001e-4 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -0.050000000000000003 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.0000000000000001e-4Initial program 70.6%
Taylor expanded in l around 0 99.9%
Final simplification99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.75)
(+ U (* 2.0 (* l (* J (cos (* K 0.5))))))
(if (<= t_0 -0.15)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))
(+ U (* J (* l (fma 0.3333333333333333 (* l l) 2.0))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.75) {
tmp = U + (2.0 * (l * (J * cos((K * 0.5)))));
} else if (t_0 <= -0.15) {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
} else {
tmp = U + (J * (l * fma(0.3333333333333333, (l * l), 2.0)));
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.75) tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J * cos(Float64(K * 0.5)))))); elseif (t_0 <= -0.15) tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); else tmp = Float64(U + Float64(J * Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0)))); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.75], N[(U + N[(2.0 * N[(l * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.15], 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 * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t_0 \leq -0.75:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{elif}\;t_0 \leq -0.15:\\
\;\;\;\;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 \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.75Initial program 90.0%
Taylor expanded in l around 0 73.5%
*-commutative73.5%
associate-*l*73.6%
*-commutative73.6%
Simplified73.6%
if -0.75 < (cos.f64 (/.f64 K 2)) < -0.149999999999999994Initial program 93.5%
Taylor expanded in l around 0 48.9%
Taylor expanded in K around 0 61.5%
+-commutative61.5%
associate-*r*61.5%
distribute-rgt-out74.9%
*-commutative74.9%
unpow274.9%
Simplified74.9%
if -0.149999999999999994 < (cos.f64 (/.f64 K 2)) Initial program 82.8%
Taylor expanded in K around 0 80.9%
Taylor expanded in l around 0 81.2%
associate-*r*81.2%
associate-*r*81.2%
distribute-rgt-out81.2%
unpow381.2%
associate-*r*81.2%
distribute-rgt-out81.2%
+-commutative81.2%
fma-def81.2%
Simplified81.2%
Final simplification79.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ U (* t_0 (* (pow l 7.0) (* J 0.0003968253968253968))))))
(if (<= l -1.25e+96)
t_1
(if (<= l -62.0)
(* (- (exp l) (exp (- l))) J)
(if (<= l 5.6)
(+
U
(* t_0 (+ (* 2.0 (* l J)) (* 0.3333333333333333 (* J (pow l 3.0))))))
t_1)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = U + (t_0 * (pow(l, 7.0) * (J * 0.0003968253968253968)));
double tmp;
if (l <= -1.25e+96) {
tmp = t_1;
} else if (l <= -62.0) {
tmp = (exp(l) - exp(-l)) * J;
} else if (l <= 5.6) {
tmp = U + (t_0 * ((2.0 * (l * J)) + (0.3333333333333333 * (J * pow(l, 3.0)))));
} 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) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = u + (t_0 * ((l ** 7.0d0) * (j * 0.0003968253968253968d0)))
if (l <= (-1.25d+96)) then
tmp = t_1
else if (l <= (-62.0d0)) then
tmp = (exp(l) - exp(-l)) * j
else if (l <= 5.6d0) then
tmp = u + (t_0 * ((2.0d0 * (l * j)) + (0.3333333333333333d0 * (j * (l ** 3.0d0)))))
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 = Math.cos((K / 2.0));
double t_1 = U + (t_0 * (Math.pow(l, 7.0) * (J * 0.0003968253968253968)));
double tmp;
if (l <= -1.25e+96) {
tmp = t_1;
} else if (l <= -62.0) {
tmp = (Math.exp(l) - Math.exp(-l)) * J;
} else if (l <= 5.6) {
tmp = U + (t_0 * ((2.0 * (l * J)) + (0.3333333333333333 * (J * Math.pow(l, 3.0)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = U + (t_0 * (math.pow(l, 7.0) * (J * 0.0003968253968253968))) tmp = 0 if l <= -1.25e+96: tmp = t_1 elif l <= -62.0: tmp = (math.exp(l) - math.exp(-l)) * J elif l <= 5.6: tmp = U + (t_0 * ((2.0 * (l * J)) + (0.3333333333333333 * (J * math.pow(l, 3.0))))) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(U + Float64(t_0 * Float64((l ^ 7.0) * Float64(J * 0.0003968253968253968)))) tmp = 0.0 if (l <= -1.25e+96) tmp = t_1; elseif (l <= -62.0) tmp = Float64(Float64(exp(l) - exp(Float64(-l))) * J); elseif (l <= 5.6) tmp = Float64(U + Float64(t_0 * Float64(Float64(2.0 * Float64(l * J)) + Float64(0.3333333333333333 * Float64(J * (l ^ 3.0)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = U + (t_0 * ((l ^ 7.0) * (J * 0.0003968253968253968))); tmp = 0.0; if (l <= -1.25e+96) tmp = t_1; elseif (l <= -62.0) tmp = (exp(l) - exp(-l)) * J; elseif (l <= 5.6) tmp = U + (t_0 * ((2.0 * (l * J)) + (0.3333333333333333 * (J * (l ^ 3.0))))); else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(t$95$0 * N[(N[Power[l, 7.0], $MachinePrecision] * N[(J * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.25e+96], t$95$1, If[LessEqual[l, -62.0], N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision], If[LessEqual[l, 5.6], N[(U + N[(t$95$0 * N[(N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision] + N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := U + t_0 \cdot \left({\ell}^{7} \cdot \left(J \cdot 0.0003968253968253968\right)\right)\\
\mathbf{if}\;\ell \leq -1.25 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -62:\\
\;\;\;\;\left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{elif}\;\ell \leq 5.6:\\
\;\;\;\;U + t_0 \cdot \left(2 \cdot \left(\ell \cdot J\right) + 0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -1.2500000000000001e96 or 5.5999999999999996 < l Initial program 100.0%
Taylor expanded in l around 0 95.7%
Taylor expanded in l around inf 95.7%
associate-*r*95.7%
*-commutative95.7%
associate-*l*95.7%
Simplified95.7%
if -1.2500000000000001e96 < l < -62Initial program 99.9%
Taylor expanded in K around 0 93.7%
Taylor expanded in J around inf 93.7%
if -62 < l < 5.5999999999999996Initial program 70.8%
Taylor expanded in l around 0 99.6%
Final simplification97.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ U (* t_0 (* (pow l 7.0) (* J 0.0003968253968253968))))))
(if (<= l -1.5e+96)
t_1
(if (<= l -105.0)
(* (- (exp l) (exp (- l))) J)
(if (<= l 5.6)
(+ U (* t_0 (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))))
t_1)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = U + (t_0 * (pow(l, 7.0) * (J * 0.0003968253968253968)));
double tmp;
if (l <= -1.5e+96) {
tmp = t_1;
} else if (l <= -105.0) {
tmp = (exp(l) - exp(-l)) * J;
} else if (l <= 5.6) {
tmp = U + (t_0 * (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0))));
} 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) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = u + (t_0 * ((l ** 7.0d0) * (j * 0.0003968253968253968d0)))
if (l <= (-1.5d+96)) then
tmp = t_1
else if (l <= (-105.0d0)) then
tmp = (exp(l) - exp(-l)) * j
else if (l <= 5.6d0) then
tmp = u + (t_0 * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))))
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 = Math.cos((K / 2.0));
double t_1 = U + (t_0 * (Math.pow(l, 7.0) * (J * 0.0003968253968253968)));
double tmp;
if (l <= -1.5e+96) {
tmp = t_1;
} else if (l <= -105.0) {
tmp = (Math.exp(l) - Math.exp(-l)) * J;
} else if (l <= 5.6) {
tmp = U + (t_0 * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))));
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = U + (t_0 * (math.pow(l, 7.0) * (J * 0.0003968253968253968))) tmp = 0 if l <= -1.5e+96: tmp = t_1 elif l <= -105.0: tmp = (math.exp(l) - math.exp(-l)) * J elif l <= 5.6: tmp = U + (t_0 * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)))) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(U + Float64(t_0 * Float64((l ^ 7.0) * Float64(J * 0.0003968253968253968)))) tmp = 0.0 if (l <= -1.5e+96) tmp = t_1; elseif (l <= -105.0) tmp = Float64(Float64(exp(l) - exp(Float64(-l))) * J); elseif (l <= 5.6) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))))); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = U + (t_0 * ((l ^ 7.0) * (J * 0.0003968253968253968))); tmp = 0.0; if (l <= -1.5e+96) tmp = t_1; elseif (l <= -105.0) tmp = (exp(l) - exp(-l)) * J; elseif (l <= 5.6) tmp = U + (t_0 * (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)))); else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(t$95$0 * N[(N[Power[l, 7.0], $MachinePrecision] * N[(J * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.5e+96], t$95$1, If[LessEqual[l, -105.0], N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision], If[LessEqual[l, 5.6], N[(U + N[(t$95$0 * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := U + t_0 \cdot \left({\ell}^{7} \cdot \left(J \cdot 0.0003968253968253968\right)\right)\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -105:\\
\;\;\;\;\left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{elif}\;\ell \leq 5.6:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -1.5e96 or 5.5999999999999996 < l Initial program 100.0%
Taylor expanded in l around 0 95.7%
Taylor expanded in l around inf 95.7%
associate-*r*95.7%
*-commutative95.7%
associate-*l*95.7%
Simplified95.7%
if -1.5e96 < l < -105Initial program 99.9%
Taylor expanded in K around 0 93.7%
Taylor expanded in J around inf 93.7%
if -105 < l < 5.5999999999999996Initial program 70.8%
Taylor expanded in l around 0 99.6%
Final simplification97.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ U (* t_0 (* (pow l 7.0) (* J 0.0003968253968253968))))))
(if (<= l -1.25e+96)
t_1
(if (<= l -118.0)
(* (- (exp l) (exp (- l))) J)
(if (<= l 4.0) (+ U (* t_0 (* J (* l 2.0)))) t_1)))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = U + (t_0 * (pow(l, 7.0) * (J * 0.0003968253968253968)));
double tmp;
if (l <= -1.25e+96) {
tmp = t_1;
} else if (l <= -118.0) {
tmp = (exp(l) - exp(-l)) * J;
} else if (l <= 4.0) {
tmp = U + (t_0 * (J * (l * 2.0)));
} 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) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = u + (t_0 * ((l ** 7.0d0) * (j * 0.0003968253968253968d0)))
if (l <= (-1.25d+96)) then
tmp = t_1
else if (l <= (-118.0d0)) then
tmp = (exp(l) - exp(-l)) * j
else if (l <= 4.0d0) then
tmp = u + (t_0 * (j * (l * 2.0d0)))
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 = Math.cos((K / 2.0));
double t_1 = U + (t_0 * (Math.pow(l, 7.0) * (J * 0.0003968253968253968)));
double tmp;
if (l <= -1.25e+96) {
tmp = t_1;
} else if (l <= -118.0) {
tmp = (Math.exp(l) - Math.exp(-l)) * J;
} else if (l <= 4.0) {
tmp = U + (t_0 * (J * (l * 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = U + (t_0 * (math.pow(l, 7.0) * (J * 0.0003968253968253968))) tmp = 0 if l <= -1.25e+96: tmp = t_1 elif l <= -118.0: tmp = (math.exp(l) - math.exp(-l)) * J elif l <= 4.0: tmp = U + (t_0 * (J * (l * 2.0))) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(U + Float64(t_0 * Float64((l ^ 7.0) * Float64(J * 0.0003968253968253968)))) tmp = 0.0 if (l <= -1.25e+96) tmp = t_1; elseif (l <= -118.0) tmp = Float64(Float64(exp(l) - exp(Float64(-l))) * J); elseif (l <= 4.0) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * 2.0)))); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = U + (t_0 * ((l ^ 7.0) * (J * 0.0003968253968253968))); tmp = 0.0; if (l <= -1.25e+96) tmp = t_1; elseif (l <= -118.0) tmp = (exp(l) - exp(-l)) * J; elseif (l <= 4.0) tmp = U + (t_0 * (J * (l * 2.0))); else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(t$95$0 * N[(N[Power[l, 7.0], $MachinePrecision] * N[(J * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.25e+96], t$95$1, If[LessEqual[l, -118.0], N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision], If[LessEqual[l, 4.0], N[(U + N[(t$95$0 * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := U + t_0 \cdot \left({\ell}^{7} \cdot \left(J \cdot 0.0003968253968253968\right)\right)\\
\mathbf{if}\;\ell \leq -1.25 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -118:\\
\;\;\;\;\left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{elif}\;\ell \leq 4:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -1.2500000000000001e96 or 4 < l Initial program 100.0%
Taylor expanded in l around 0 95.7%
Taylor expanded in l around inf 95.7%
associate-*r*95.7%
*-commutative95.7%
associate-*l*95.7%
Simplified95.7%
if -1.2500000000000001e96 < l < -118Initial program 99.9%
Taylor expanded in K around 0 93.7%
Taylor expanded in J around inf 93.7%
if -118 < l < 4Initial program 70.8%
Taylor expanded in l around 0 99.1%
Final simplification97.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (- (exp l) (exp (- l))) J)))
(if (<= l -130.0)
t_0
(if (<= l 1.65e-9)
(+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))
(if (<= l 2.65e+221)
(+ U t_0)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25)))))))))
double code(double J, double l, double K, double U) {
double t_0 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -130.0) {
tmp = t_0;
} else if (l <= 1.65e-9) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else if (l <= 2.65e+221) {
tmp = U + t_0;
} else {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
}
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 <= (-130.0d0)) then
tmp = t_0
else if (l <= 1.65d-9) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
else if (l <= 2.65d+221) then
tmp = u + t_0
else
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
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 <= -130.0) {
tmp = t_0;
} else if (l <= 1.65e-9) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else if (l <= 2.65e+221) {
tmp = U + t_0;
} else {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
}
return tmp;
}
def code(J, l, K, U): t_0 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -130.0: tmp = t_0 elif l <= 1.65e-9: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) elif l <= 2.65e+221: tmp = U + t_0 else: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -130.0) tmp = t_0; elseif (l <= 1.65e-9) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); elseif (l <= 2.65e+221) tmp = Float64(U + t_0); else tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -130.0) tmp = t_0; elseif (l <= 1.65e-9) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); elseif (l <= 2.65e+221) tmp = U + t_0; else tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); 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, -130.0], t$95$0, If[LessEqual[l, 1.65e-9], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.65e+221], N[(U + t$95$0), $MachinePrecision], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -130:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 2.65 \cdot 10^{+221}:\\
\;\;\;\;U + t_0\\
\mathbf{else}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if l < -130Initial program 100.0%
Taylor expanded in K around 0 75.7%
Taylor expanded in J around inf 75.7%
if -130 < l < 1.65000000000000009e-9Initial program 70.5%
Taylor expanded in l around 0 99.4%
if 1.65000000000000009e-9 < l < 2.6499999999999998e221Initial program 99.6%
Taylor expanded in K around 0 76.9%
if 2.6499999999999998e221 < l Initial program 100.0%
Taylor expanded in l around 0 46.0%
Taylor expanded in K around 0 44.5%
+-commutative44.5%
associate-*r*44.5%
distribute-rgt-out88.2%
*-commutative88.2%
unpow288.2%
Simplified88.2%
Final simplification88.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (- (exp l) (exp (- l))) J)))
(if (<= l -17.0)
t_0
(if (<= l 0.000245)
(+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))
(if (<= l 2.65e+221)
t_0
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25)))))))))
double code(double J, double l, double K, double U) {
double t_0 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -17.0) {
tmp = t_0;
} else if (l <= 0.000245) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else if (l <= 2.65e+221) {
tmp = t_0;
} else {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
}
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 <= (-17.0d0)) then
tmp = t_0
else if (l <= 0.000245d0) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
else if (l <= 2.65d+221) then
tmp = t_0
else
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
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 <= -17.0) {
tmp = t_0;
} else if (l <= 0.000245) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else if (l <= 2.65e+221) {
tmp = t_0;
} else {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
}
return tmp;
}
def code(J, l, K, U): t_0 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -17.0: tmp = t_0 elif l <= 0.000245: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) elif l <= 2.65e+221: tmp = t_0 else: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) return tmp
function code(J, l, K, U) t_0 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -17.0) tmp = t_0; elseif (l <= 0.000245) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); elseif (l <= 2.65e+221) tmp = t_0; else tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -17.0) tmp = t_0; elseif (l <= 0.000245) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); elseif (l <= 2.65e+221) tmp = t_0; else tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); 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, -17.0], t$95$0, If[LessEqual[l, 0.000245], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.65e+221], t$95$0, N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -17:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 0.000245:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 2.65 \cdot 10^{+221}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if l < -17 or 2.4499999999999999e-4 < l < 2.6499999999999998e221Initial program 99.8%
Taylor expanded in K around 0 75.9%
Taylor expanded in J around inf 75.9%
if -17 < l < 2.4499999999999999e-4Initial program 70.7%
Taylor expanded in l around 0 99.4%
if 2.6499999999999998e221 < l Initial program 100.0%
Taylor expanded in l around 0 46.0%
Taylor expanded in K around 0 44.5%
+-commutative44.5%
associate-*r*44.5%
distribute-rgt-out88.2%
*-commutative88.2%
unpow288.2%
Simplified88.2%
Final simplification88.8%
(FPCore (J l K U)
:precision binary64
(if (<= l -2.8e+118)
(* 0.3333333333333333 (* J (pow l 3.0)))
(if (<= l 1.5e+36)
(+ U (* 2.0 (* l (* J (cos (* K 0.5))))))
(if (<= l 1.3e+153)
(* U U)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.8e+118) {
tmp = 0.3333333333333333 * (J * pow(l, 3.0));
} else if (l <= 1.5e+36) {
tmp = U + (2.0 * (l * (J * cos((K * 0.5)))));
} else if (l <= 1.3e+153) {
tmp = U * U;
} else {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
}
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.8d+118)) then
tmp = 0.3333333333333333d0 * (j * (l ** 3.0d0))
else if (l <= 1.5d+36) then
tmp = u + (2.0d0 * (l * (j * cos((k * 0.5d0)))))
else if (l <= 1.3d+153) then
tmp = u * u
else
tmp = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.8e+118) {
tmp = 0.3333333333333333 * (J * Math.pow(l, 3.0));
} else if (l <= 1.5e+36) {
tmp = U + (2.0 * (l * (J * Math.cos((K * 0.5)))));
} else if (l <= 1.3e+153) {
tmp = U * U;
} else {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -2.8e+118: tmp = 0.3333333333333333 * (J * math.pow(l, 3.0)) elif l <= 1.5e+36: tmp = U + (2.0 * (l * (J * math.cos((K * 0.5))))) elif l <= 1.3e+153: tmp = U * U else: tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -2.8e+118) tmp = Float64(0.3333333333333333 * Float64(J * (l ^ 3.0))); elseif (l <= 1.5e+36) tmp = Float64(U + Float64(2.0 * Float64(l * Float64(J * cos(Float64(K * 0.5)))))); elseif (l <= 1.3e+153) tmp = Float64(U * U); else tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -2.8e+118) tmp = 0.3333333333333333 * (J * (l ^ 3.0)); elseif (l <= 1.5e+36) tmp = U + (2.0 * (l * (J * cos((K * 0.5))))); elseif (l <= 1.3e+153) tmp = U * U; else tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -2.8e+118], N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.5e+36], N[(U + N[(2.0 * N[(l * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.3e+153], N[(U * U), $MachinePrecision], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.8 \cdot 10^{+118}:\\
\;\;\;\;0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\mathbf{elif}\;\ell \leq 1.5 \cdot 10^{+36}:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+153}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if l < -2.79999999999999986e118Initial program 100.0%
Taylor expanded in K around 0 71.4%
Taylor expanded in l around 0 71.4%
Taylor expanded in l around inf 71.4%
if -2.79999999999999986e118 < l < 1.5e36Initial program 75.9%
Taylor expanded in l around 0 86.3%
*-commutative86.3%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
if 1.5e36 < l < 1.2999999999999999e153Initial program 100.0%
Applied egg-rr51.7%
if 1.2999999999999999e153 < l Initial program 100.0%
Taylor expanded in l around 0 40.9%
Taylor expanded in K around 0 35.4%
+-commutative35.4%
associate-*r*35.4%
distribute-rgt-out73.9%
*-commutative73.9%
unpow273.9%
Simplified73.9%
Final simplification79.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= l -520.0)
t_0
(if (<= l 1.4e+36)
(fma (* l 2.0) J U)
(if (<= l 2.1e+152) (* U U) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -520.0) {
tmp = t_0;
} else if (l <= 1.4e+36) {
tmp = fma((l * 2.0), J, U);
} else if (l <= 2.1e+152) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) tmp = 0.0 if (l <= -520.0) tmp = t_0; elseif (l <= 1.4e+36) tmp = fma(Float64(l * 2.0), J, U); elseif (l <= 2.1e+152) tmp = Float64(U * U); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -520.0], t$95$0, If[LessEqual[l, 1.4e+36], N[(N[(l * 2.0), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, 2.1e+152], N[(U * U), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{if}\;\ell \leq -520:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+36}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot 2, J, U\right)\\
\mathbf{elif}\;\ell \leq 2.1 \cdot 10^{+152}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -520 or 2.1000000000000002e152 < l Initial program 100.0%
Taylor expanded in l around 0 35.6%
Taylor expanded in K around 0 20.2%
+-commutative20.2%
associate-*r*20.2%
distribute-rgt-out48.6%
*-commutative48.6%
unpow248.6%
Simplified48.6%
if -520 < l < 1.4e36Initial program 72.5%
Taylor expanded in l around 0 95.2%
Taylor expanded in K around 0 86.1%
associate-*r*86.1%
fma-def86.1%
*-commutative86.1%
Simplified86.1%
if 1.4e36 < l < 2.1000000000000002e152Initial program 100.0%
Applied egg-rr51.7%
Final simplification69.5%
(FPCore (J l K U)
:precision binary64
(if (<= l -9.8e+39)
(* 0.3333333333333333 (* J (pow l 3.0)))
(if (<= l 2.1e+36)
(fma (* l 2.0) J U)
(if (<= l 2.6e+152)
(* U U)
(+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -9.8e+39) {
tmp = 0.3333333333333333 * (J * pow(l, 3.0));
} else if (l <= 2.1e+36) {
tmp = fma((l * 2.0), J, U);
} else if (l <= 2.6e+152) {
tmp = U * U;
} else {
tmp = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -9.8e+39) tmp = Float64(0.3333333333333333 * Float64(J * (l ^ 3.0))); elseif (l <= 2.1e+36) tmp = fma(Float64(l * 2.0), J, U); elseif (l <= 2.6e+152) tmp = Float64(U * U); else tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -9.8e+39], N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.1e+36], N[(N[(l * 2.0), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, 2.6e+152], N[(U * U), $MachinePrecision], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9.8 \cdot 10^{+39}:\\
\;\;\;\;0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right)\\
\mathbf{elif}\;\ell \leq 2.1 \cdot 10^{+36}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot 2, J, U\right)\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+152}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if l < -9.79999999999999974e39Initial program 100.0%
Taylor expanded in K around 0 75.0%
Taylor expanded in l around 0 61.6%
Taylor expanded in l around inf 61.6%
if -9.79999999999999974e39 < l < 2.10000000000000004e36Initial program 73.4%
Taylor expanded in l around 0 92.2%
Taylor expanded in K around 0 83.4%
associate-*r*83.4%
fma-def83.4%
*-commutative83.4%
Simplified83.4%
if 2.10000000000000004e36 < l < 2.6000000000000001e152Initial program 100.0%
Applied egg-rr51.7%
if 2.6000000000000001e152 < l Initial program 100.0%
Taylor expanded in l around 0 40.9%
Taylor expanded in K around 0 35.4%
+-commutative35.4%
associate-*r*35.4%
distribute-rgt-out73.9%
*-commutative73.9%
unpow273.9%
Simplified73.9%
Final simplification74.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* (* l J) (+ 2.0 (* (* K K) -0.25))))))
(if (<= l -350.0)
t_0
(if (<= l 2.1e+36)
(+ U (* 2.0 (* l J)))
(if (<= l 2.05e+152) (* U U) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -350.0) {
tmp = t_0;
} else if (l <= 2.1e+36) {
tmp = U + (2.0 * (l * J));
} else if (l <= 2.05e+152) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = u + ((l * j) * (2.0d0 + ((k * k) * (-0.25d0))))
if (l <= (-350.0d0)) then
tmp = t_0
else if (l <= 2.1d+36) then
tmp = u + (2.0d0 * (l * j))
else if (l <= 2.05d+152) then
tmp = u * u
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25)));
double tmp;
if (l <= -350.0) {
tmp = t_0;
} else if (l <= 2.1e+36) {
tmp = U + (2.0 * (l * J));
} else if (l <= 2.05e+152) {
tmp = U * U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25))) tmp = 0 if l <= -350.0: tmp = t_0 elif l <= 2.1e+36: tmp = U + (2.0 * (l * J)) elif l <= 2.05e+152: tmp = U * U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(K * K) * -0.25)))) tmp = 0.0 if (l <= -350.0) tmp = t_0; elseif (l <= 2.1e+36) tmp = Float64(U + Float64(2.0 * Float64(l * J))); elseif (l <= 2.05e+152) tmp = Float64(U * U); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + ((l * J) * (2.0 + ((K * K) * -0.25))); tmp = 0.0; if (l <= -350.0) tmp = t_0; elseif (l <= 2.1e+36) tmp = U + (2.0 * (l * J)); elseif (l <= 2.05e+152) tmp = U * U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -350.0], t$95$0, If[LessEqual[l, 2.1e+36], N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.05e+152], N[(U * U), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(\ell \cdot J\right) \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{if}\;\ell \leq -350:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 2.1 \cdot 10^{+36}:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{elif}\;\ell \leq 2.05 \cdot 10^{+152}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -350 or 2.0499999999999999e152 < l Initial program 100.0%
Taylor expanded in l around 0 35.6%
Taylor expanded in K around 0 20.2%
+-commutative20.2%
associate-*r*20.2%
distribute-rgt-out48.6%
*-commutative48.6%
unpow248.6%
Simplified48.6%
if -350 < l < 2.10000000000000004e36Initial program 72.5%
Taylor expanded in l around 0 95.2%
Taylor expanded in K around 0 86.1%
if 2.10000000000000004e36 < l < 2.0499999999999999e152Initial program 100.0%
Applied egg-rr51.7%
Final simplification69.5%
(FPCore (J l K U) :precision binary64 (if (or (<= J -1.9e+76) (not (<= J 6.9e+165))) (* 2.0 (* l J)) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((J <= -1.9e+76) || !(J <= 6.9e+165)) {
tmp = 2.0 * (l * J);
} 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 ((j <= (-1.9d+76)) .or. (.not. (j <= 6.9d+165))) then
tmp = 2.0d0 * (l * j)
else
tmp = u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((J <= -1.9e+76) || !(J <= 6.9e+165)) {
tmp = 2.0 * (l * J);
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (J <= -1.9e+76) or not (J <= 6.9e+165): tmp = 2.0 * (l * J) else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((J <= -1.9e+76) || !(J <= 6.9e+165)) tmp = Float64(2.0 * Float64(l * J)); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((J <= -1.9e+76) || ~((J <= 6.9e+165))) tmp = 2.0 * (l * J); else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[J, -1.9e+76], N[Not[LessEqual[J, 6.9e+165]], $MachinePrecision]], N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;J \leq -1.9 \cdot 10^{+76} \lor \neg \left(J \leq 6.9 \cdot 10^{+165}\right):\\
\;\;\;\;2 \cdot \left(\ell \cdot J\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if J < -1.90000000000000012e76 or 6.90000000000000006e165 < J Initial program 64.0%
Taylor expanded in l around 0 94.7%
Taylor expanded in K around 0 78.0%
Taylor expanded in l around inf 56.8%
if -1.90000000000000012e76 < J < 6.90000000000000006e165Initial program 94.3%
Taylor expanded in J around 0 43.4%
Final simplification47.6%
(FPCore (J l K U) :precision binary64 (if (<= l 1.4e+36) (+ U (* 2.0 (* l J))) (* U U)))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 1.4e+36) {
tmp = U + (2.0 * (l * J));
} 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.4d+36) then
tmp = u + (2.0d0 * (l * j))
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.4e+36) {
tmp = U + (2.0 * (l * J));
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 1.4e+36: tmp = U + (2.0 * (l * J)) else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 1.4e+36) tmp = Float64(U + Float64(2.0 * Float64(l * J))); else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 1.4e+36) tmp = U + (2.0 * (l * J)); else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 1.4e+36], N[(U + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.4 \cdot 10^{+36}:\\
\;\;\;\;U + 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < 1.4e36Initial program 81.5%
Taylor expanded in l around 0 74.9%
Taylor expanded in K around 0 65.8%
if 1.4e36 < l Initial program 100.0%
Applied egg-rr32.1%
Final simplification59.7%
(FPCore (J l K U) :precision binary64 (if (<= l -130.0) (* U U) (if (<= l 0.000245) U (* U U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -130.0) {
tmp = U * U;
} else if (l <= 0.000245) {
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 <= (-130.0d0)) then
tmp = u * u
else if (l <= 0.000245d0) 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 <= -130.0) {
tmp = U * U;
} else if (l <= 0.000245) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -130.0: tmp = U * U elif l <= 0.000245: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -130.0) tmp = Float64(U * U); elseif (l <= 0.000245) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -130.0) tmp = U * U; elseif (l <= 0.000245) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -130.0], N[(U * U), $MachinePrecision], If[LessEqual[l, 0.000245], U, N[(U * U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -130:\\
\;\;\;\;U \cdot U\\
\mathbf{elif}\;\ell \leq 0.000245:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < -130 or 2.4499999999999999e-4 < l Initial program 99.9%
Applied egg-rr22.5%
if -130 < l < 2.4499999999999999e-4Initial program 70.7%
Taylor expanded in J around 0 69.7%
Final simplification46.8%
(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-rr3.0%
*-inverses3.0%
Simplified3.0%
Final simplification3.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 84.8%
Taylor expanded in J around 0 37.1%
Final simplification37.1%
herbie shell --seed 2023215
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))