
(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 12 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 -0.05) (not (<= t_1 0.0)))
(+ U (* t_0 (* J t_1)))
(+ U (* t_0 (* J (* 2.0 l)))))))
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.0)) {
tmp = U + (t_0 * (J * t_1));
} else {
tmp = U + (t_0 * (J * (2.0 * l)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(l) - exp(-l)
if ((t_1 <= (-0.05d0)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = u + (t_0 * (j * t_1))
else
tmp = u + (t_0 * (j * (2.0d0 * l)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_1 <= -0.05) || !(t_1 <= 0.0)) {
tmp = U + (t_0 * (J * t_1));
} else {
tmp = U + (t_0 * (J * (2.0 * l)));
}
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.0): tmp = U + (t_0 * (J * t_1)) else: tmp = U + (t_0 * (J * (2.0 * l))) 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.0)) tmp = Float64(U + Float64(t_0 * Float64(J * t_1))); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(2.0 * l)))); 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.0))) tmp = U + (t_0 * (J * t_1)); else tmp = U + (t_0 * (J * (2.0 * l))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -0.05], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(U + N[(t$95$0 * N[(J * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(2.0 * l), $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\right):\\
\;\;\;\;U + t_0 \cdot \left(J \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -0.050000000000000003 or 0.0 < (-.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))) < 0.0Initial program 74.1%
Taylor expanded in l around 0 100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.908)
(+
(*
t_0
(*
J
(+
(* 0.3333333333333333 (pow l 3.0))
(+
(* 0.0003968253968253968 (pow l 7.0))
(+ (* 0.016666666666666666 (pow l 5.0)) (* 2.0 l))))))
U)
(+ U (* J (* 2.0 (sinh l)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.908) {
tmp = (t_0 * (J * ((0.3333333333333333 * pow(l, 3.0)) + ((0.0003968253968253968 * pow(l, 7.0)) + ((0.016666666666666666 * pow(l, 5.0)) + (2.0 * l)))))) + U;
} else {
tmp = U + (J * (2.0 * sinh(l)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.908d0) then
tmp = (t_0 * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + ((0.0003968253968253968d0 * (l ** 7.0d0)) + ((0.016666666666666666d0 * (l ** 5.0d0)) + (2.0d0 * l)))))) + u
else
tmp = u + (j * (2.0d0 * sinh(l)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= 0.908) {
tmp = (t_0 * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + ((0.0003968253968253968 * Math.pow(l, 7.0)) + ((0.016666666666666666 * Math.pow(l, 5.0)) + (2.0 * l)))))) + U;
} else {
tmp = U + (J * (2.0 * Math.sinh(l)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.908: tmp = (t_0 * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + ((0.0003968253968253968 * math.pow(l, 7.0)) + ((0.016666666666666666 * math.pow(l, 5.0)) + (2.0 * l)))))) + U else: tmp = U + (J * (2.0 * math.sinh(l))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.908) tmp = Float64(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(2.0 * l)))))) + U); else tmp = Float64(U + Float64(J * Float64(2.0 * sinh(l)))); 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.908) tmp = (t_0 * (J * ((0.3333333333333333 * (l ^ 3.0)) + ((0.0003968253968253968 * (l ^ 7.0)) + ((0.016666666666666666 * (l ^ 5.0)) + (2.0 * l)))))) + U; else tmp = U + (J * (2.0 * sinh(l))); 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.908], N[(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[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(J * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t_0 \leq 0.908:\\
\;\;\;\;t_0 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \left(0.0003968253968253968 \cdot {\ell}^{7} + \left(0.016666666666666666 \cdot {\ell}^{5} + 2 \cdot \ell\right)\right)\right)\right) + U\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \sinh \ell\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < 0.908000000000000029Initial program 88.8%
Taylor expanded in l around 0 96.6%
if 0.908000000000000029 < (cos.f64 (/.f64 K 2)) Initial program 86.2%
Taylor expanded in K around 0 86.2%
pow186.2%
*-commutative86.2%
sinh-undef100.0%
Applied egg-rr100.0%
unpow1100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.908)
(+ U (* t_0 (* J (* l (+ 2.0 (* 0.3333333333333333 (* l l)))))))
(+ U (* J (* 2.0 (sinh l)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.908) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + (J * (2.0 * sinh(l)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.908d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l * l))))))
else
tmp = u + (j * (2.0d0 * sinh(l)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= 0.908) {
tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l))))));
} else {
tmp = U + (J * (2.0 * Math.sinh(l)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.908: tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))) else: tmp = U + (J * (2.0 * math.sinh(l))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.908) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * Float64(l * l))))))); else tmp = Float64(U + Float64(J * Float64(2.0 * sinh(l)))); 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.908) tmp = U + (t_0 * (J * (l * (2.0 + (0.3333333333333333 * (l * l)))))); else tmp = U + (J * (2.0 * sinh(l))); 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.908], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t_0 \leq 0.908:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \sinh \ell\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < 0.908000000000000029Initial program 88.8%
Taylor expanded in l around 0 96.6%
Taylor expanded in l around 0 90.5%
associate-*r*90.5%
associate-*r*90.5%
distribute-rgt-out90.5%
*-commutative90.5%
*-commutative90.5%
cube-mult90.5%
associate-*l*90.5%
distribute-lft-out90.5%
Simplified90.5%
if 0.908000000000000029 < (cos.f64 (/.f64 K 2)) Initial program 86.2%
Taylor expanded in K around 0 86.2%
pow186.2%
*-commutative86.2%
sinh-undef100.0%
Applied egg-rr100.0%
unpow1100.0%
Simplified100.0%
Final simplification95.9%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.005) (+ U (* J (* (* 2.0 l) (cos (* K 0.5))))) (+ U (* J (* 2.0 (sinh l))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.005) {
tmp = U + (J * ((2.0 * l) * cos((K * 0.5))));
} else {
tmp = U + (J * (2.0 * sinh(l)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= (-0.005d0)) then
tmp = u + (j * ((2.0d0 * l) * cos((k * 0.5d0))))
else
tmp = u + (j * (2.0d0 * sinh(l)))
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.005) {
tmp = U + (J * ((2.0 * l) * Math.cos((K * 0.5))));
} else {
tmp = U + (J * (2.0 * Math.sinh(l)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.005: tmp = U + (J * ((2.0 * l) * math.cos((K * 0.5)))) else: tmp = U + (J * (2.0 * math.sinh(l))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.005) tmp = Float64(U + Float64(J * Float64(Float64(2.0 * l) * cos(Float64(K * 0.5))))); else tmp = Float64(U + Float64(J * Float64(2.0 * sinh(l)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.005) tmp = U + (J * ((2.0 * l) * cos((K * 0.5)))); else tmp = U + (J * (2.0 * sinh(l))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.005], N[(U + N[(J * N[(N[(2.0 * l), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.005:\\
\;\;\;\;U + J \cdot \left(\left(2 \cdot \ell\right) \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \sinh \ell\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.0050000000000000001Initial program 93.4%
Taylor expanded in l around 0 98.8%
Taylor expanded in J around 0 98.7%
Simplified98.7%
Taylor expanded in l around 0 56.4%
*-commutative56.4%
Simplified56.4%
if -0.0050000000000000001 < (cos.f64 (/.f64 K 2)) Initial program 85.0%
Taylor expanded in K around 0 85.0%
pow185.0%
*-commutative85.0%
sinh-undef96.6%
Applied egg-rr96.6%
unpow196.6%
Simplified96.6%
Final simplification85.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.005)
(+ U (* t_0 (* J (* 2.0 l))))
(+ U (* J (* 2.0 (sinh l)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= -0.005) {
tmp = U + (t_0 * (J * (2.0 * l)));
} else {
tmp = U + (J * (2.0 * sinh(l)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= (-0.005d0)) then
tmp = u + (t_0 * (j * (2.0d0 * l)))
else
tmp = u + (j * (2.0d0 * sinh(l)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double tmp;
if (t_0 <= -0.005) {
tmp = U + (t_0 * (J * (2.0 * l)));
} else {
tmp = U + (J * (2.0 * Math.sinh(l)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= -0.005: tmp = U + (t_0 * (J * (2.0 * l))) else: tmp = U + (J * (2.0 * math.sinh(l))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= -0.005) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(2.0 * l)))); else tmp = Float64(U + Float64(J * Float64(2.0 * sinh(l)))); 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.005) tmp = U + (t_0 * (J * (2.0 * l))); else tmp = U + (J * (2.0 * sinh(l))); 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.005], N[(U + N[(t$95$0 * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t_0 \leq -0.005:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \sinh \ell\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.0050000000000000001Initial program 93.4%
Taylor expanded in l around 0 56.5%
if -0.0050000000000000001 < (cos.f64 (/.f64 K 2)) Initial program 85.0%
Taylor expanded in K around 0 85.0%
pow185.0%
*-commutative85.0%
sinh-undef96.6%
Applied egg-rr96.6%
unpow196.6%
Simplified96.6%
Final simplification85.3%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.005) (+ U (* J (* l (+ 2.0 (* (* K K) -0.25))))) (+ U (* J (* 2.0 (sinh l))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.005) {
tmp = U + (J * (l * (2.0 + ((K * K) * -0.25))));
} else {
tmp = U + (J * (2.0 * sinh(l)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= (-0.005d0)) then
tmp = u + (j * (l * (2.0d0 + ((k * k) * (-0.25d0)))))
else
tmp = u + (j * (2.0d0 * sinh(l)))
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.005) {
tmp = U + (J * (l * (2.0 + ((K * K) * -0.25))));
} else {
tmp = U + (J * (2.0 * Math.sinh(l)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.005: tmp = U + (J * (l * (2.0 + ((K * K) * -0.25)))) else: tmp = U + (J * (2.0 * math.sinh(l))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.005) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(K * K) * -0.25))))); else tmp = Float64(U + Float64(J * Float64(2.0 * sinh(l)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.005) tmp = U + (J * (l * (2.0 + ((K * K) * -0.25)))); else tmp = U + (J * (2.0 * sinh(l))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.005], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.005:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \sinh \ell\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K 2)) < -0.0050000000000000001Initial program 93.4%
Taylor expanded in l around 0 98.8%
Taylor expanded in J around 0 98.7%
Simplified98.7%
Taylor expanded in l around 0 56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in K around 0 54.6%
associate-*r*54.6%
distribute-rgt-out54.6%
*-commutative54.6%
unpow254.6%
Simplified54.6%
if -0.0050000000000000001 < (cos.f64 (/.f64 K 2)) Initial program 85.0%
Taylor expanded in K around 0 85.0%
pow185.0%
*-commutative85.0%
sinh-undef96.6%
Applied egg-rr96.6%
unpow196.6%
Simplified96.6%
Final simplification84.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (* l (+ 2.0 (* (* K K) -0.25))))))
(t_1 (* J (* 2.0 l))))
(if (<= l -2e+187)
t_0
(if (<= l -9.5e+20)
(/ (- (* t_1 t_1) (* U U)) (- U))
(if (<= l 440.0)
(+ U t_1)
(if (<= l 1.2e+97) (/ (* 4.0 (* (* l l) (* J J))) (- t_1 U)) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * (2.0 + ((K * K) * -0.25))));
double t_1 = J * (2.0 * l);
double tmp;
if (l <= -2e+187) {
tmp = t_0;
} else if (l <= -9.5e+20) {
tmp = ((t_1 * t_1) - (U * U)) / -U;
} else if (l <= 440.0) {
tmp = U + t_1;
} else if (l <= 1.2e+97) {
tmp = (4.0 * ((l * l) * (J * J))) / (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 * (l * (2.0d0 + ((k * k) * (-0.25d0)))))
t_1 = j * (2.0d0 * l)
if (l <= (-2d+187)) then
tmp = t_0
else if (l <= (-9.5d+20)) then
tmp = ((t_1 * t_1) - (u * u)) / -u
else if (l <= 440.0d0) then
tmp = u + t_1
else if (l <= 1.2d+97) then
tmp = (4.0d0 * ((l * l) * (j * j))) / (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 * (l * (2.0 + ((K * K) * -0.25))));
double t_1 = J * (2.0 * l);
double tmp;
if (l <= -2e+187) {
tmp = t_0;
} else if (l <= -9.5e+20) {
tmp = ((t_1 * t_1) - (U * U)) / -U;
} else if (l <= 440.0) {
tmp = U + t_1;
} else if (l <= 1.2e+97) {
tmp = (4.0 * ((l * l) * (J * J))) / (t_1 - U);
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (J * (l * (2.0 + ((K * K) * -0.25)))) t_1 = J * (2.0 * l) tmp = 0 if l <= -2e+187: tmp = t_0 elif l <= -9.5e+20: tmp = ((t_1 * t_1) - (U * U)) / -U elif l <= 440.0: tmp = U + t_1 elif l <= 1.2e+97: tmp = (4.0 * ((l * l) * (J * J))) / (t_1 - U) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(K * K) * -0.25))))) t_1 = Float64(J * Float64(2.0 * l)) tmp = 0.0 if (l <= -2e+187) tmp = t_0; elseif (l <= -9.5e+20) tmp = Float64(Float64(Float64(t_1 * t_1) - Float64(U * U)) / Float64(-U)); elseif (l <= 440.0) tmp = Float64(U + t_1); elseif (l <= 1.2e+97) tmp = Float64(Float64(4.0 * Float64(Float64(l * l) * Float64(J * J))) / Float64(t_1 - U)); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (J * (l * (2.0 + ((K * K) * -0.25)))); t_1 = J * (2.0 * l); tmp = 0.0; if (l <= -2e+187) tmp = t_0; elseif (l <= -9.5e+20) tmp = ((t_1 * t_1) - (U * U)) / -U; elseif (l <= 440.0) tmp = U + t_1; elseif (l <= 1.2e+97) tmp = (4.0 * ((l * l) * (J * J))) / (t_1 - U); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(l * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e+187], t$95$0, If[LessEqual[l, -9.5e+20], N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(U * U), $MachinePrecision]), $MachinePrecision] / (-U)), $MachinePrecision], If[LessEqual[l, 440.0], N[(U + t$95$1), $MachinePrecision], If[LessEqual[l, 1.2e+97], N[(N[(4.0 * N[(N[(l * l), $MachinePrecision] * N[(J * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 - U), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left(\ell \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\right)\\
t_1 := J \cdot \left(2 \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{+187}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -9.5 \cdot 10^{+20}:\\
\;\;\;\;\frac{t_1 \cdot t_1 - U \cdot U}{-U}\\
\mathbf{elif}\;\ell \leq 440:\\
\;\;\;\;U + t_1\\
\mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+97}:\\
\;\;\;\;\frac{4 \cdot \left(\left(\ell \cdot \ell\right) \cdot \left(J \cdot J\right)\right)}{t_1 - U}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if l < -1.99999999999999981e187 or 1.2e97 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in J around 0 100.0%
Simplified100.0%
Taylor expanded in l around 0 33.9%
*-commutative33.9%
Simplified33.9%
Taylor expanded in K around 0 55.9%
associate-*r*55.9%
distribute-rgt-out55.9%
*-commutative55.9%
unpow255.9%
Simplified55.9%
if -1.99999999999999981e187 < l < -9.5e20Initial program 100.0%
Taylor expanded in K around 0 68.3%
Taylor expanded in l around 0 8.3%
flip-+28.2%
*-commutative28.2%
*-commutative28.2%
*-commutative28.2%
*-commutative28.2%
*-commutative28.2%
*-commutative28.2%
Applied egg-rr28.2%
Taylor expanded in J around 0 37.3%
neg-mul-137.3%
Simplified37.3%
if -9.5e20 < l < 440Initial program 75.5%
Taylor expanded in K around 0 75.5%
Taylor expanded in l around 0 88.0%
if 440 < l < 1.2e97Initial program 100.0%
Taylor expanded in K around 0 85.7%
Taylor expanded in l around 0 3.3%
flip-+15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
Applied egg-rr15.6%
Taylor expanded in J around inf 30.1%
unpow230.1%
unpow230.1%
Simplified30.1%
Final simplification67.4%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* 2.0 l)))
(t_1 (+ U (* J (* l (+ 2.0 (* (* K K) -0.25)))))))
(if (<= l -3.8e+58)
t_1
(if (<= l 520.0)
(+ U t_0)
(if (<= l 3.7e+96) (/ (* 4.0 (* (* l l) (* J J))) (- t_0 U)) t_1)))))
double code(double J, double l, double K, double U) {
double t_0 = J * (2.0 * l);
double t_1 = U + (J * (l * (2.0 + ((K * K) * -0.25))));
double tmp;
if (l <= -3.8e+58) {
tmp = t_1;
} else if (l <= 520.0) {
tmp = U + t_0;
} else if (l <= 3.7e+96) {
tmp = (4.0 * ((l * l) * (J * J))) / (t_0 - U);
} 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 = j * (2.0d0 * l)
t_1 = u + (j * (l * (2.0d0 + ((k * k) * (-0.25d0)))))
if (l <= (-3.8d+58)) then
tmp = t_1
else if (l <= 520.0d0) then
tmp = u + t_0
else if (l <= 3.7d+96) then
tmp = (4.0d0 * ((l * l) * (j * j))) / (t_0 - u)
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 * (2.0 * l);
double t_1 = U + (J * (l * (2.0 + ((K * K) * -0.25))));
double tmp;
if (l <= -3.8e+58) {
tmp = t_1;
} else if (l <= 520.0) {
tmp = U + t_0;
} else if (l <= 3.7e+96) {
tmp = (4.0 * ((l * l) * (J * J))) / (t_0 - U);
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (2.0 * l) t_1 = U + (J * (l * (2.0 + ((K * K) * -0.25)))) tmp = 0 if l <= -3.8e+58: tmp = t_1 elif l <= 520.0: tmp = U + t_0 elif l <= 3.7e+96: tmp = (4.0 * ((l * l) * (J * J))) / (t_0 - U) else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(2.0 * l)) t_1 = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(K * K) * -0.25))))) tmp = 0.0 if (l <= -3.8e+58) tmp = t_1; elseif (l <= 520.0) tmp = Float64(U + t_0); elseif (l <= 3.7e+96) tmp = Float64(Float64(4.0 * Float64(Float64(l * l) * Float64(J * J))) / Float64(t_0 - U)); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (2.0 * l); t_1 = U + (J * (l * (2.0 + ((K * K) * -0.25)))); tmp = 0.0; if (l <= -3.8e+58) tmp = t_1; elseif (l <= 520.0) tmp = U + t_0; elseif (l <= 3.7e+96) tmp = (4.0 * ((l * l) * (J * J))) / (t_0 - U); else tmp = t_1; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(J * N[(l * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.8e+58], t$95$1, If[LessEqual[l, 520.0], N[(U + t$95$0), $MachinePrecision], If[LessEqual[l, 3.7e+96], N[(N[(4.0 * N[(N[(l * l), $MachinePrecision] * N[(J * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - U), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(2 \cdot \ell\right)\\
t_1 := U + J \cdot \left(\ell \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\right)\\
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 520:\\
\;\;\;\;U + t_0\\
\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+96}:\\
\;\;\;\;\frac{4 \cdot \left(\left(\ell \cdot \ell\right) \cdot \left(J \cdot J\right)\right)}{t_0 - U}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -3.7999999999999999e58 or 3.69999999999999991e96 < l Initial program 100.0%
Taylor expanded in l around 0 100.0%
Taylor expanded in J around 0 100.0%
Simplified100.0%
Taylor expanded in l around 0 26.6%
*-commutative26.6%
Simplified26.6%
Taylor expanded in K around 0 47.4%
associate-*r*47.4%
distribute-rgt-out47.4%
*-commutative47.4%
unpow247.4%
Simplified47.4%
if -3.7999999999999999e58 < l < 520Initial program 76.7%
Taylor expanded in K around 0 76.7%
Taylor expanded in l around 0 83.7%
if 520 < l < 3.69999999999999991e96Initial program 100.0%
Taylor expanded in K around 0 85.7%
Taylor expanded in l around 0 3.3%
flip-+15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
*-commutative15.6%
Applied egg-rr15.6%
Taylor expanded in J around inf 30.1%
unpow230.1%
unpow230.1%
Simplified30.1%
Final simplification65.7%
(FPCore (J l K U) :precision binary64 (if (or (<= l -4.7e+58) (not (<= l 6.2e+34))) (+ U (* J (* l (+ 2.0 (* (* K K) -0.25))))) (+ U (* J (* 2.0 l)))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -4.7e+58) || !(l <= 6.2e+34)) {
tmp = U + (J * (l * (2.0 + ((K * K) * -0.25))));
} else {
tmp = U + (J * (2.0 * l));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-4.7d+58)) .or. (.not. (l <= 6.2d+34))) then
tmp = u + (j * (l * (2.0d0 + ((k * k) * (-0.25d0)))))
else
tmp = u + (j * (2.0d0 * l))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -4.7e+58) || !(l <= 6.2e+34)) {
tmp = U + (J * (l * (2.0 + ((K * K) * -0.25))));
} else {
tmp = U + (J * (2.0 * l));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -4.7e+58) or not (l <= 6.2e+34): tmp = U + (J * (l * (2.0 + ((K * K) * -0.25)))) else: tmp = U + (J * (2.0 * l)) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -4.7e+58) || !(l <= 6.2e+34)) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(K * K) * -0.25))))); else tmp = Float64(U + Float64(J * Float64(2.0 * l))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -4.7e+58) || ~((l <= 6.2e+34))) tmp = U + (J * (l * (2.0 + ((K * K) * -0.25)))); else tmp = U + (J * (2.0 * l)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -4.7e+58], N[Not[LessEqual[l, 6.2e+34]], $MachinePrecision]], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.7 \cdot 10^{+58} \lor \neg \left(\ell \leq 6.2 \cdot 10^{+34}\right):\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
\end{array}
\end{array}
if l < -4.69999999999999972e58 or 6.19999999999999955e34 < l Initial program 100.0%
Taylor expanded in l around 0 98.2%
Taylor expanded in J around 0 98.2%
Simplified98.2%
Taylor expanded in l around 0 24.0%
*-commutative24.0%
Simplified24.0%
Taylor expanded in K around 0 43.4%
associate-*r*43.4%
distribute-rgt-out43.4%
*-commutative43.4%
unpow243.4%
Simplified43.4%
if -4.69999999999999972e58 < l < 6.19999999999999955e34Initial program 78.1%
Taylor expanded in K around 0 77.4%
Taylor expanded in l around 0 78.9%
Final simplification63.9%
(FPCore (J l K U) :precision binary64 (if (or (<= l -0.049) (not (<= l 420.0))) (* l (* 2.0 J)) U))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.049) || !(l <= 420.0)) {
tmp = l * (2.0 * 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 ((l <= (-0.049d0)) .or. (.not. (l <= 420.0d0))) then
tmp = l * (2.0d0 * 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 ((l <= -0.049) || !(l <= 420.0)) {
tmp = l * (2.0 * J);
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -0.049) or not (l <= 420.0): tmp = l * (2.0 * J) else: tmp = U return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -0.049) || !(l <= 420.0)) tmp = Float64(l * Float64(2.0 * J)); else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -0.049) || ~((l <= 420.0))) tmp = l * (2.0 * J); else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -0.049], N[Not[LessEqual[l, 420.0]], $MachinePrecision]], N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision], U]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.049 \lor \neg \left(\ell \leq 420\right):\\
\;\;\;\;\ell \cdot \left(2 \cdot J\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
if l < -0.049000000000000002 or 420 < l Initial program 100.0%
Taylor expanded in K around 0 69.7%
Taylor expanded in l around 0 15.5%
Taylor expanded in l around inf 15.2%
associate-*r*15.2%
*-commutative15.2%
associate-*l*15.2%
Simplified15.2%
if -0.049000000000000002 < l < 420Initial program 74.5%
Applied egg-rr51.4%
Taylor expanded in J around 0 74.5%
Final simplification44.6%
(FPCore (J l K U) :precision binary64 (+ U (* J (* 2.0 l))))
double code(double J, double l, double K, double U) {
return U + (J * (2.0 * l));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (j * (2.0d0 * l))
end function
public static double code(double J, double l, double K, double U) {
return U + (J * (2.0 * l));
}
def code(J, l, K, U): return U + (J * (2.0 * l))
function code(J, l, K, U) return Float64(U + Float64(J * Float64(2.0 * l))) end
function tmp = code(J, l, K, U) tmp = U + (J * (2.0 * l)); end
code[J_, l_, K_, U_] := N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + J \cdot \left(2 \cdot \ell\right)
\end{array}
Initial program 87.3%
Taylor expanded in K around 0 72.1%
Taylor expanded in l around 0 53.0%
Final simplification53.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 87.3%
Applied egg-rr27.3%
Taylor expanded in J around 0 38.3%
Final simplification38.3%
herbie shell --seed 2023214
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))