
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e-10)))
(+ (* (* t_1 J) t_0) U)
(+ U (* t_0 (* J (* 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 <= -((double) INFINITY)) || !(t_1 <= 2e-10)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (J * (l * 2.0)));
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e-10)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (J * (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 <= -math.inf) or not (t_1 <= 2e-10): tmp = ((t_1 * J) * t_0) + U else: tmp = U + (t_0 * (J * (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 <= Float64(-Inf)) || !(t_1 <= 2e-10)) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = Float64(U + Float64(t_0 * Float64(J * 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 <= -Inf) || ~((t_1 <= 2e-10))) tmp = ((t_1 * J) * t_0) + U; else tmp = U + (t_0 * (J * (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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e-10]], $MachinePrecision]], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{-10}\right):\\
\;\;\;\;\left(t\_1 \cdot J\right) \cdot t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 2.00000000000000007e-10 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 2.00000000000000007e-10Initial program 71.3%
Taylor expanded in l around 0 99.9%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.48)
(+ U (* 2.0 (* J (+ l (* -0.125 (* l (pow K 2.0)))))))
(if (<= t_0 -0.01)
(+ U (* 2.0 (* J (* l (cos (* K 0.5))))))
(+ U (+ (* 0.3333333333333333 (* J (pow l 3.0))) (* 2.0 (* l J))))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.48) {
tmp = U + (2.0 * (J * (l + (-0.125 * (l * pow(K, 2.0))))));
} else if (t_0 <= -0.01) {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
} else {
tmp = U + ((0.3333333333333333 * (J * pow(l, 3.0))) + (2.0 * (l * J)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= (-0.48d0)) then
tmp = u + (2.0d0 * (j * (l + ((-0.125d0) * (l * (k ** 2.0d0))))))
else if (t_0 <= (-0.01d0)) then
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
else
tmp = u + ((0.3333333333333333d0 * (j * (l ** 3.0d0))) + (2.0d0 * (l * j)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= -0.48) {
tmp = U + (2.0 * (J * (l + (-0.125 * (l * Math.pow(K, 2.0))))));
} else if (t_0 <= -0.01) {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
} else {
tmp = U + ((0.3333333333333333 * (J * Math.pow(l, 3.0))) + (2.0 * (l * J)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.48: tmp = U + (2.0 * (J * (l + (-0.125 * (l * math.pow(K, 2.0)))))) elif t_0 <= -0.01: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) else: tmp = U + ((0.3333333333333333 * (J * math.pow(l, 3.0))) + (2.0 * (l * J))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.48) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l + Float64(-0.125 * Float64(l * (K ^ 2.0))))))); elseif (t_0 <= -0.01) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); else tmp = Float64(U + Float64(Float64(0.3333333333333333 * Float64(J * (l ^ 3.0))) + Float64(2.0 * Float64(l * J)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); tmp = 0.0; if (t_0 <= -0.48) tmp = U + (2.0 * (J * (l + (-0.125 * (l * (K ^ 2.0)))))); elseif (t_0 <= -0.01) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); else tmp = U + ((0.3333333333333333 * (J * (l ^ 3.0))) + (2.0 * (l * J))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.48], N[(U + N[(2.0 * N[(J * N[(l + N[(-0.125 * N[(l * N[Power[K, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.01], N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(0.3333333333333333 * N[(J * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -0.48:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell + -0.125 \cdot \left(\ell \cdot {K}^{2}\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq -0.01:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(0.3333333333333333 \cdot \left(J \cdot {\ell}^{3}\right) + 2 \cdot \left(\ell \cdot J\right)\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.47999999999999998Initial program 90.2%
Taylor expanded in l around 0 37.8%
Taylor expanded in K around 0 64.5%
if -0.47999999999999998 < (cos.f64 (/.f64 K 2)) < -0.0100000000000000002Initial program 89.8%
Taylor expanded in l around 0 74.9%
if -0.0100000000000000002 < (cos.f64 (/.f64 K 2)) Initial program 85.8%
Taylor expanded in l around 0 87.8%
+-commutative87.8%
associate-*r*87.8%
associate-*r*87.8%
associate-*r*87.8%
associate-*r*87.8%
distribute-rgt-out87.8%
associate-*r*87.8%
*-commutative87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in K around 0 83.8%
Final simplification79.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (* J 0.3333333333333333) (* (pow l 3.0) (cos (* K 0.5))))))
(t_1 (* (- (exp l) (exp (- l))) J)))
(if (<= l -5.7e+102)
t_0
(if (<= l -122.0)
t_1
(if (<= l 58000000000.0)
(+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))
(if (<= l 1.25e+102) (+ t_1 U) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + ((J * 0.3333333333333333) * (pow(l, 3.0) * cos((K * 0.5))));
double t_1 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -5.7e+102) {
tmp = t_0;
} else if (l <= -122.0) {
tmp = t_1;
} else if (l <= 58000000000.0) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else if (l <= 1.25e+102) {
tmp = t_1 + 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) :: t_1
real(8) :: tmp
t_0 = u + ((j * 0.3333333333333333d0) * ((l ** 3.0d0) * cos((k * 0.5d0))))
t_1 = (exp(l) - exp(-l)) * j
if (l <= (-5.7d+102)) then
tmp = t_0
else if (l <= (-122.0d0)) then
tmp = t_1
else if (l <= 58000000000.0d0) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
else if (l <= 1.25d+102) then
tmp = t_1 + 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 + ((J * 0.3333333333333333) * (Math.pow(l, 3.0) * Math.cos((K * 0.5))));
double t_1 = (Math.exp(l) - Math.exp(-l)) * J;
double tmp;
if (l <= -5.7e+102) {
tmp = t_0;
} else if (l <= -122.0) {
tmp = t_1;
} else if (l <= 58000000000.0) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else if (l <= 1.25e+102) {
tmp = t_1 + U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + ((J * 0.3333333333333333) * (math.pow(l, 3.0) * math.cos((K * 0.5)))) t_1 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -5.7e+102: tmp = t_0 elif l <= -122.0: tmp = t_1 elif l <= 58000000000.0: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) elif l <= 1.25e+102: tmp = t_1 + U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(Float64(J * 0.3333333333333333) * Float64((l ^ 3.0) * cos(Float64(K * 0.5))))) t_1 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -5.7e+102) tmp = t_0; elseif (l <= -122.0) tmp = t_1; elseif (l <= 58000000000.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); elseif (l <= 1.25e+102) tmp = Float64(t_1 + U); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + ((J * 0.3333333333333333) * ((l ^ 3.0) * cos((K * 0.5)))); t_1 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -5.7e+102) tmp = t_0; elseif (l <= -122.0) tmp = t_1; elseif (l <= 58000000000.0) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); elseif (l <= 1.25e+102) tmp = t_1 + U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[(N[Power[l, 3.0], $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -5.7e+102], t$95$0, If[LessEqual[l, -122.0], t$95$1, If[LessEqual[l, 58000000000.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.25e+102], N[(t$95$1 + U), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \left(J \cdot 0.3333333333333333\right) \cdot \left({\ell}^{3} \cdot \cos \left(K \cdot 0.5\right)\right)\\
t_1 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -122:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 58000000000:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 1.25 \cdot 10^{+102}:\\
\;\;\;\;t\_1 + U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -5.6999999999999999e102 or 1.25e102 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
associate-*r*100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
if -5.6999999999999999e102 < l < -122Initial program 100.0%
Taylor expanded in K around 0 81.8%
Taylor expanded in J around inf 81.8%
if -122 < l < 5.8e10Initial program 71.7%
Taylor expanded in l around 0 99.1%
if 5.8e10 < l < 1.25e102Initial program 100.0%
Taylor expanded in K around 0 72.7%
Final simplification95.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (- (exp l) (exp (- l))) J)))
(if (<= l -122.0)
t_0
(if (<= l 58000000000.0)
(+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))
(+ t_0 U)))))
double code(double J, double l, double K, double U) {
double t_0 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -122.0) {
tmp = t_0;
} else if (l <= 58000000000.0) {
tmp = U + (cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = t_0 + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = (exp(l) - exp(-l)) * j
if (l <= (-122.0d0)) then
tmp = t_0
else if (l <= 58000000000.0d0) then
tmp = u + (cos((k / 2.0d0)) * (j * (l * 2.0d0)))
else
tmp = t_0 + u
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 <= -122.0) {
tmp = t_0;
} else if (l <= 58000000000.0) {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
} else {
tmp = t_0 + U;
}
return tmp;
}
def code(J, l, K, U): t_0 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -122.0: tmp = t_0 elif l <= 58000000000.0: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) else: tmp = t_0 + U return tmp
function code(J, l, K, U) t_0 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -122.0) tmp = t_0; elseif (l <= 58000000000.0) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); else tmp = Float64(t_0 + U); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -122.0) tmp = t_0; elseif (l <= 58000000000.0) tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); else tmp = t_0 + U; 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, -122.0], t$95$0, If[LessEqual[l, 58000000000.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + U), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -122:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 58000000000:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + U\\
\end{array}
\end{array}
if l < -122Initial program 100.0%
Taylor expanded in K around 0 71.9%
Taylor expanded in J around inf 71.9%
if -122 < l < 5.8e10Initial program 71.7%
Taylor expanded in l around 0 99.1%
if 5.8e10 < l Initial program 100.0%
Taylor expanded in K around 0 68.5%
Final simplification83.6%
(FPCore (J l K U) :precision binary64 (if (or (<= l -122.0) (not (<= l 58000000000.0))) (* (- (exp l) (exp (- l))) J) (+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -122.0) || !(l <= 58000000000.0)) {
tmp = (exp(l) - exp(-l)) * J;
} else {
tmp = U + (cos((K / 2.0)) * (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 <= (-122.0d0)) .or. (.not. (l <= 58000000000.0d0))) then
tmp = (exp(l) - exp(-l)) * j
else
tmp = u + (cos((k / 2.0d0)) * (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 <= -122.0) || !(l <= 58000000000.0)) {
tmp = (Math.exp(l) - Math.exp(-l)) * J;
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -122.0) or not (l <= 58000000000.0): tmp = (math.exp(l) - math.exp(-l)) * J else: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -122.0) || !(l <= 58000000000.0)) tmp = Float64(Float64(exp(l) - exp(Float64(-l))) * J); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -122.0) || ~((l <= 58000000000.0))) tmp = (exp(l) - exp(-l)) * J; else tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -122.0], N[Not[LessEqual[l, 58000000000.0]], $MachinePrecision]], N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -122 \lor \neg \left(\ell \leq 58000000000\right):\\
\;\;\;\;\left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -122 or 5.8e10 < l Initial program 100.0%
Taylor expanded in K around 0 70.1%
Taylor expanded in J around inf 70.1%
if -122 < l < 5.8e10Initial program 71.7%
Taylor expanded in l around 0 99.1%
Final simplification83.6%
(FPCore (J l K U)
:precision binary64
(if (or (<= l -2.4e+284)
(not (or (<= l -3e+20) (and (not (<= l 1.3e+69)) (<= l 1.55e+179)))))
(+ U (* l (* J 2.0)))
(pow U -4.0)))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.4e+284) || !((l <= -3e+20) || (!(l <= 1.3e+69) && (l <= 1.55e+179)))) {
tmp = U + (l * (J * 2.0));
} else {
tmp = pow(U, -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-2.4d+284)) .or. (.not. (l <= (-3d+20)) .or. (.not. (l <= 1.3d+69)) .and. (l <= 1.55d+179))) then
tmp = u + (l * (j * 2.0d0))
else
tmp = u ** (-4.0d0)
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.4e+284) || !((l <= -3e+20) || (!(l <= 1.3e+69) && (l <= 1.55e+179)))) {
tmp = U + (l * (J * 2.0));
} else {
tmp = Math.pow(U, -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -2.4e+284) or not ((l <= -3e+20) or (not (l <= 1.3e+69) and (l <= 1.55e+179))): tmp = U + (l * (J * 2.0)) else: tmp = math.pow(U, -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -2.4e+284) || !((l <= -3e+20) || (!(l <= 1.3e+69) && (l <= 1.55e+179)))) tmp = Float64(U + Float64(l * Float64(J * 2.0))); else tmp = U ^ -4.0; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -2.4e+284) || ~(((l <= -3e+20) || (~((l <= 1.3e+69)) && (l <= 1.55e+179))))) tmp = U + (l * (J * 2.0)); else tmp = U ^ -4.0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -2.4e+284], N[Not[Or[LessEqual[l, -3e+20], And[N[Not[LessEqual[l, 1.3e+69]], $MachinePrecision], LessEqual[l, 1.55e+179]]]], $MachinePrecision]], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[U, -4.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.4 \cdot 10^{+284} \lor \neg \left(\ell \leq -3 \cdot 10^{+20} \lor \neg \left(\ell \leq 1.3 \cdot 10^{+69}\right) \land \ell \leq 1.55 \cdot 10^{+179}\right):\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;{U}^{-4}\\
\end{array}
\end{array}
if l < -2.4000000000000001e284 or -3e20 < l < 1.3000000000000001e69 or 1.55e179 < l Initial program 80.9%
Taylor expanded in l around 0 77.7%
Taylor expanded in K around 0 67.6%
associate-*r*67.6%
*-commutative67.6%
*-commutative67.6%
Simplified67.6%
if -2.4000000000000001e284 < l < -3e20 or 1.3000000000000001e69 < l < 1.55e179Initial program 100.0%
Applied egg-rr33.4%
Final simplification56.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* l (* J 2.0)))))
(if (<= l -1e+283)
t_0
(if (<= l -3e+20)
(pow U -4.0)
(if (<= l 1.2e+71)
(fma l (* J 2.0) U)
(if (<= l 7e+178) (pow U -4.0) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (l * (J * 2.0));
double tmp;
if (l <= -1e+283) {
tmp = t_0;
} else if (l <= -3e+20) {
tmp = pow(U, -4.0);
} else if (l <= 1.2e+71) {
tmp = fma(l, (J * 2.0), U);
} else if (l <= 7e+178) {
tmp = pow(U, -4.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(U + Float64(l * Float64(J * 2.0))) tmp = 0.0 if (l <= -1e+283) tmp = t_0; elseif (l <= -3e+20) tmp = U ^ -4.0; elseif (l <= 1.2e+71) tmp = fma(l, Float64(J * 2.0), U); elseif (l <= 7e+178) tmp = U ^ -4.0; else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e+283], t$95$0, If[LessEqual[l, -3e+20], N[Power[U, -4.0], $MachinePrecision], If[LessEqual[l, 1.2e+71], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 7e+178], N[Power[U, -4.0], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{+283}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -3 \cdot 10^{+20}:\\
\;\;\;\;{U}^{-4}\\
\mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+178}:\\
\;\;\;\;{U}^{-4}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -9.99999999999999955e282 or 7.00000000000000001e178 < l Initial program 100.0%
Taylor expanded in l around 0 44.3%
Taylor expanded in K around 0 36.4%
associate-*r*36.4%
*-commutative36.4%
*-commutative36.4%
Simplified36.4%
if -9.99999999999999955e282 < l < -3e20 or 1.1999999999999999e71 < l < 7.00000000000000001e178Initial program 100.0%
Applied egg-rr33.4%
if -3e20 < l < 1.1999999999999999e71Initial program 75.1%
Taylor expanded in l around 0 87.8%
Taylor expanded in K around 0 77.1%
+-commutative77.1%
associate-*r*77.1%
*-commutative77.1%
*-commutative77.1%
fma-define77.1%
Simplified77.1%
Final simplification56.9%
(FPCore (J l K U) :precision binary64 (if (or (<= l -18000.0) (not (<= l 2.2e+78))) (+ U (* (* J 0.3333333333333333) (pow l 3.0))) (+ U (* 2.0 (* J (* l (cos (* K 0.5))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -18000.0) || !(l <= 2.2e+78)) {
tmp = U + ((J * 0.3333333333333333) * pow(l, 3.0));
} else {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
}
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 <= (-18000.0d0)) .or. (.not. (l <= 2.2d+78))) then
tmp = u + ((j * 0.3333333333333333d0) * (l ** 3.0d0))
else
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -18000.0) || !(l <= 2.2e+78)) {
tmp = U + ((J * 0.3333333333333333) * Math.pow(l, 3.0));
} else {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -18000.0) or not (l <= 2.2e+78): tmp = U + ((J * 0.3333333333333333) * math.pow(l, 3.0)) else: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -18000.0) || !(l <= 2.2e+78)) tmp = Float64(U + Float64(Float64(J * 0.3333333333333333) * (l ^ 3.0))); else tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -18000.0) || ~((l <= 2.2e+78))) tmp = U + ((J * 0.3333333333333333) * (l ^ 3.0)); else tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -18000.0], N[Not[LessEqual[l, 2.2e+78]], $MachinePrecision]], N[(U + N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -18000 \lor \neg \left(\ell \leq 2.2 \cdot 10^{+78}\right):\\
\;\;\;\;U + \left(J \cdot 0.3333333333333333\right) \cdot {\ell}^{3}\\
\mathbf{else}:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\end{array}
\end{array}
if l < -18000 or 2.20000000000000014e78 < l Initial program 100.0%
Taylor expanded in l around 0 84.5%
+-commutative84.5%
associate-*r*84.5%
associate-*r*84.5%
associate-*r*84.5%
associate-*r*84.5%
distribute-rgt-out84.5%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in l around inf 84.5%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in K around 0 58.7%
if -18000 < l < 2.20000000000000014e78Initial program 74.5%
Taylor expanded in l around 0 89.7%
Final simplification74.7%
(FPCore (J l K U) :precision binary64 (if (or (<= l -120000.0) (not (<= l 2.25e+78))) (+ U (* (* J 0.3333333333333333) (pow l 3.0))) (+ U (* (cos (/ K 2.0)) (* J (* l 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -120000.0) || !(l <= 2.25e+78)) {
tmp = U + ((J * 0.3333333333333333) * pow(l, 3.0));
} else {
tmp = U + (cos((K / 2.0)) * (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 <= (-120000.0d0)) .or. (.not. (l <= 2.25d+78))) then
tmp = u + ((j * 0.3333333333333333d0) * (l ** 3.0d0))
else
tmp = u + (cos((k / 2.0d0)) * (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 <= -120000.0) || !(l <= 2.25e+78)) {
tmp = U + ((J * 0.3333333333333333) * Math.pow(l, 3.0));
} else {
tmp = U + (Math.cos((K / 2.0)) * (J * (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -120000.0) or not (l <= 2.25e+78): tmp = U + ((J * 0.3333333333333333) * math.pow(l, 3.0)) else: tmp = U + (math.cos((K / 2.0)) * (J * (l * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -120000.0) || !(l <= 2.25e+78)) tmp = Float64(U + Float64(Float64(J * 0.3333333333333333) * (l ^ 3.0))); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -120000.0) || ~((l <= 2.25e+78))) tmp = U + ((J * 0.3333333333333333) * (l ^ 3.0)); else tmp = U + (cos((K / 2.0)) * (J * (l * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -120000.0], N[Not[LessEqual[l, 2.25e+78]], $MachinePrecision]], N[(U + N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -120000 \lor \neg \left(\ell \leq 2.25 \cdot 10^{+78}\right):\\
\;\;\;\;U + \left(J \cdot 0.3333333333333333\right) \cdot {\ell}^{3}\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -1.2e5 or 2.25e78 < l Initial program 100.0%
Taylor expanded in l around 0 84.5%
+-commutative84.5%
associate-*r*84.5%
associate-*r*84.5%
associate-*r*84.5%
associate-*r*84.5%
distribute-rgt-out84.5%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in l around inf 84.5%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in K around 0 58.7%
if -1.2e5 < l < 2.25e78Initial program 74.5%
Taylor expanded in l around 0 89.7%
Final simplification74.7%
(FPCore (J l K U) :precision binary64 (if (or (<= l -2.5) (not (<= l 0.00017))) (+ U (* (* J 0.3333333333333333) (pow l 3.0))) (fma l (* J 2.0) U)))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.5) || !(l <= 0.00017)) {
tmp = U + ((J * 0.3333333333333333) * pow(l, 3.0));
} else {
tmp = fma(l, (J * 2.0), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if ((l <= -2.5) || !(l <= 0.00017)) tmp = Float64(U + Float64(Float64(J * 0.3333333333333333) * (l ^ 3.0))); else tmp = fma(l, Float64(J * 2.0), U); end return tmp end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -2.5], N[Not[LessEqual[l, 0.00017]], $MachinePrecision]], N[(U + N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(J * 2.0), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.5 \lor \neg \left(\ell \leq 0.00017\right):\\
\;\;\;\;U + \left(J \cdot 0.3333333333333333\right) \cdot {\ell}^{3}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot 2, U\right)\\
\end{array}
\end{array}
if l < -2.5 or 1.7e-4 < l Initial program 100.0%
Taylor expanded in l around 0 76.6%
+-commutative76.6%
associate-*r*76.6%
associate-*r*76.6%
associate-*r*76.6%
associate-*r*76.6%
distribute-rgt-out76.6%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in l around inf 76.6%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in K around 0 53.4%
if -2.5 < l < 1.7e-4Initial program 71.3%
Taylor expanded in l around 0 99.9%
Taylor expanded in K around 0 87.6%
+-commutative87.6%
associate-*r*87.6%
*-commutative87.6%
*-commutative87.6%
fma-define87.6%
Simplified87.6%
Final simplification69.0%
(FPCore (J l K U) :precision binary64 (if (or (<= l -230000.0) (not (<= l 780.0))) (* U U) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -230000.0) || !(l <= 780.0)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-230000.0d0)) .or. (.not. (l <= 780.0d0))) then
tmp = u * u
else
tmp = u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -230000.0) || !(l <= 780.0)) {
tmp = U * U;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -230000.0) or not (l <= 780.0): tmp = U * U else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -230000.0) || !(l <= 780.0)) tmp = Float64(U * U); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -230000.0) || ~((l <= 780.0))) tmp = U * U; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -230000.0], N[Not[LessEqual[l, 780.0]], $MachinePrecision]], N[(U * U), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -230000 \lor \neg \left(\ell \leq 780\right):\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -2.3e5 or 780 < l Initial program 100.0%
Applied egg-rr16.8%
if -2.3e5 < l < 780Initial program 71.7%
Taylor expanded in J around 0 70.2%
Final simplification41.7%
(FPCore (J l K U) :precision binary64 (+ U (* l (* J 2.0))))
double code(double J, double l, double K, double U) {
return U + (l * (J * 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 + (l * (j * 2.0d0))
end function
public static double code(double J, double l, double K, double U) {
return U + (l * (J * 2.0));
}
def code(J, l, K, U): return U + (l * (J * 2.0))
function code(J, l, K, U) return Float64(U + Float64(l * Float64(J * 2.0))) end
function tmp = code(J, l, K, U) tmp = U + (l * (J * 2.0)); end
code[J_, l_, K_, U_] := N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \ell \cdot \left(J \cdot 2\right)
\end{array}
Initial program 86.9%
Taylor expanded in l around 0 60.0%
Taylor expanded in K around 0 50.5%
associate-*r*50.5%
*-commutative50.5%
*-commutative50.5%
Simplified50.5%
Final simplification50.5%
(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 86.9%
Applied egg-rr2.7%
*-inverses2.7%
Simplified2.7%
Final simplification2.7%
(FPCore (J l K U) :precision binary64 U)
double code(double J, double l, double K, double U) {
return U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u
end function
public static double code(double J, double l, double K, double U) {
return U;
}
def code(J, l, K, U): return U
function code(J, l, K, U) return U end
function tmp = code(J, l, K, U) tmp = U; end
code[J_, l_, K_, U_] := U
\begin{array}{l}
\\
U
\end{array}
Initial program 86.9%
Taylor expanded in J around 0 34.0%
Final simplification34.0%
herbie shell --seed 2024046
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))