
(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 (+ (* (* (* J (sinh l)) 2.0) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return (((J * sinh(l)) * 2.0) * 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 * sinh(l)) * 2.0d0) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return (((J * Math.sinh(l)) * 2.0) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return (((J * math.sinh(l)) * 2.0) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(Float64(J * sinh(l)) * 2.0) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = (((J * sinh(l)) * 2.0) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(J \cdot \sinh \ell\right) \cdot 2\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Initial program 88.1%
*-commutativeN/A
sinh-undefN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.872)
(+
U
(*
t_0
(*
J
(*
l
(+
2.0
(*
(* l l)
(+
0.3333333333333333
(*
l
(*
l
(+
0.016666666666666666
(* (* l l) 0.0003968253968253968)))))))))))
(+ (* (* J (sinh l)) 2.0) U))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.872) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
} else {
tmp = ((J * sinh(l)) * 2.0) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.872d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0))))))))))
else
tmp = ((j * sinh(l)) * 2.0d0) + u
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.872) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
} else {
tmp = ((J * Math.sinh(l)) * 2.0) + U;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.872: tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))))) else: tmp = ((J * math.sinh(l)) * 2.0) + U return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.872) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968))))))))))); else tmp = Float64(Float64(Float64(J * sinh(l)) * 2.0) + U); 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.872) tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968)))))))))); else tmp = ((J * sinh(l)) * 2.0) + U; 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.872], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.872:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(J \cdot \sinh \ell\right) \cdot 2 + U\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.871999999999999997Initial program 85.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.9%
Simplified95.9%
if 0.871999999999999997 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.9%
*-commutativeN/A
sinh-undefN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.0%
Final simplification97.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.872)
(+
U
(*
t_0
(*
J
(*
l
(+
2.0
(*
(* l l)
(+ 0.3333333333333333 (* l (* l 0.016666666666666666)))))))))
(+ (* (* J (sinh l)) 2.0) U))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.872) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))));
} else {
tmp = ((J * sinh(l)) * 2.0) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.872d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * 0.016666666666666666d0))))))))
else
tmp = ((j * sinh(l)) * 2.0d0) + u
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.872) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))));
} else {
tmp = ((J * Math.sinh(l)) * 2.0) + U;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.872: tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666)))))))) else: tmp = ((J * math.sinh(l)) * 2.0) + U return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.872) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * 0.016666666666666666))))))))); else tmp = Float64(Float64(Float64(J * sinh(l)) * 2.0) + U); 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.872) tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666)))))))); else tmp = ((J * sinh(l)) * 2.0) + U; 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.872], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.872:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot 0.016666666666666666\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(J \cdot \sinh \ell\right) \cdot 2 + U\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.871999999999999997Initial program 85.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6495.0%
Simplified95.0%
if 0.871999999999999997 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.9%
*-commutativeN/A
sinh-undefN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.0%
Final simplification97.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.872)
(+ U (* t_0 (* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))))
(+ (* (* J (sinh l)) 2.0) U))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.872) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = ((J * sinh(l)) * 2.0) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: tmp
t_0 = cos((k / 2.0d0))
if (t_0 <= 0.872d0) then
tmp = u + (t_0 * (j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))))
else
tmp = ((j * sinh(l)) * 2.0d0) + u
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.872) {
tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = ((J * Math.sinh(l)) * 2.0) + U;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) tmp = 0 if t_0 <= 0.872: tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333))))) else: tmp = ((J * math.sinh(l)) * 2.0) + U return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.872) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))))); else tmp = Float64(Float64(Float64(J * sinh(l)) * 2.0) + U); 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.872) tmp = U + (t_0 * (J * (l * (2.0 + ((l * l) * 0.3333333333333333))))); else tmp = ((J * sinh(l)) * 2.0) + U; 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.872], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.872:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(J \cdot \sinh \ell\right) \cdot 2 + U\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.871999999999999997Initial program 85.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.5%
Simplified92.5%
if 0.871999999999999997 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.9%
*-commutativeN/A
sinh-undefN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.0%
Final simplification96.0%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.872) (+ U (* l (* (cos (* K 0.5)) (* J (+ 2.0 (* (* l l) 0.3333333333333333)))))) (+ (* (* J (sinh l)) 2.0) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.872) {
tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = ((J * sinh(l)) * 2.0) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= 0.872d0) then
tmp = u + (l * (cos((k * 0.5d0)) * (j * (2.0d0 + ((l * l) * 0.3333333333333333d0)))))
else
tmp = ((j * sinh(l)) * 2.0d0) + u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= 0.872) {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
} else {
tmp = ((J * Math.sinh(l)) * 2.0) + U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= 0.872: tmp = U + (l * (math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333))))) else: tmp = ((J * math.sinh(l)) * 2.0) + U return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.872) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))))); else tmp = Float64(Float64(Float64(J * sinh(l)) * 2.0) + U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= 0.872) tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333))))); else tmp = ((J * sinh(l)) * 2.0) + U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.872], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.872:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(J \cdot \sinh \ell\right) \cdot 2 + U\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.871999999999999997Initial program 85.8%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified86.9%
if 0.871999999999999997 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.9%
*-commutativeN/A
sinh-undefN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.0%
Final simplification93.4%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.05)
(+
U
(*
(* l (* l (* l (* J (* (* l l) 0.016666666666666666)))))
(+ 1.0 (* -0.125 (* K K)))))
(+ (* (* J (sinh l)) 2.0) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.05) {
tmp = U + ((l * (l * (l * (J * ((l * l) * 0.016666666666666666))))) * (1.0 + (-0.125 * (K * K))));
} else {
tmp = ((J * sinh(l)) * 2.0) + U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= (-0.05d0)) then
tmp = u + ((l * (l * (l * (j * ((l * l) * 0.016666666666666666d0))))) * (1.0d0 + ((-0.125d0) * (k * k))))
else
tmp = ((j * sinh(l)) * 2.0d0) + u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= -0.05) {
tmp = U + ((l * (l * (l * (J * ((l * l) * 0.016666666666666666))))) * (1.0 + (-0.125 * (K * K))));
} else {
tmp = ((J * Math.sinh(l)) * 2.0) + U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.05: tmp = U + ((l * (l * (l * (J * ((l * l) * 0.016666666666666666))))) * (1.0 + (-0.125 * (K * K)))) else: tmp = ((J * math.sinh(l)) * 2.0) + U return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.05) tmp = Float64(U + Float64(Float64(l * Float64(l * Float64(l * Float64(J * Float64(Float64(l * l) * 0.016666666666666666))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))); else tmp = Float64(Float64(Float64(J * sinh(l)) * 2.0) + U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.05) tmp = U + ((l * (l * (l * (J * ((l * l) * 0.016666666666666666))))) * (1.0 + (-0.125 * (K * K)))); else tmp = ((J * sinh(l)) * 2.0) + U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.05], N[(U + N[(N[(l * N[(l * N[(l * N[(J * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.05:\\
\;\;\;\;U + \left(\ell \cdot \left(\ell \cdot \left(\ell \cdot \left(J \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(J \cdot \sinh \ell\right) \cdot 2 + U\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.050000000000000003Initial program 88.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6493.1%
Simplified93.1%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.6%
Simplified61.6%
Taylor expanded in l around inf
associate-*r*N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.7%
Simplified67.7%
if -0.050000000000000003 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 87.9%
*-commutativeN/A
sinh-undefN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified95.3%
Final simplification87.8%
(FPCore (J l K U)
:precision binary64
(if (<= K 7e+163)
(+
U
(*
J
(*
(+
1.0
(*
l
(*
l
(+
0.16666666666666666
(*
(* l l)
(+ 0.008333333333333333 (* (* l l) 0.0001984126984126984)))))))
(* l 2.0))))
(if (<= K 4.3e+213)
(+ U (* l (* (+ 1.0 (* -0.125 (* K K))) (* J 2.0))))
(* U (+ 1.0 (/ (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))) U))))))
double code(double J, double l, double K, double U) {
double tmp;
if (K <= 7e+163) {
tmp = U + (J * ((1.0 + (l * (l * (0.16666666666666666 + ((l * l) * (0.008333333333333333 + ((l * l) * 0.0001984126984126984))))))) * (l * 2.0)));
} else if (K <= 4.3e+213) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / 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 (k <= 7d+163) then
tmp = u + (j * ((1.0d0 + (l * (l * (0.16666666666666666d0 + ((l * l) * (0.008333333333333333d0 + ((l * l) * 0.0001984126984126984d0))))))) * (l * 2.0d0)))
else if (k <= 4.3d+213) then
tmp = u + (l * ((1.0d0 + ((-0.125d0) * (k * k))) * (j * 2.0d0)))
else
tmp = u * (1.0d0 + ((j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0))))) / u))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (K <= 7e+163) {
tmp = U + (J * ((1.0 + (l * (l * (0.16666666666666666 + ((l * l) * (0.008333333333333333 + ((l * l) * 0.0001984126984126984))))))) * (l * 2.0)));
} else if (K <= 4.3e+213) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if K <= 7e+163: tmp = U + (J * ((1.0 + (l * (l * (0.16666666666666666 + ((l * l) * (0.008333333333333333 + ((l * l) * 0.0001984126984126984))))))) * (l * 2.0))) elif K <= 4.3e+213: tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0))) else: tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)) return tmp
function code(J, l, K, U) tmp = 0.0 if (K <= 7e+163) tmp = Float64(U + Float64(J * Float64(Float64(1.0 + Float64(l * Float64(l * Float64(0.16666666666666666 + Float64(Float64(l * l) * Float64(0.008333333333333333 + Float64(Float64(l * l) * 0.0001984126984126984))))))) * Float64(l * 2.0)))); elseif (K <= 4.3e+213) tmp = Float64(U + Float64(l * Float64(Float64(1.0 + Float64(-0.125 * Float64(K * K))) * Float64(J * 2.0)))); else tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))) / U))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (K <= 7e+163) tmp = U + (J * ((1.0 + (l * (l * (0.16666666666666666 + ((l * l) * (0.008333333333333333 + ((l * l) * 0.0001984126984126984))))))) * (l * 2.0))); elseif (K <= 4.3e+213) tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0))); else tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[K, 7e+163], N[(U + N[(J * N[(N[(1.0 + N[(l * N[(l * N[(0.16666666666666666 + N[(N[(l * l), $MachinePrecision] * N[(0.008333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[K, 4.3e+213], N[(U + N[(l * N[(N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(1.0 + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;K \leq 7 \cdot 10^{+163}:\\
\;\;\;\;U + J \cdot \left(\left(1 + \ell \cdot \left(\ell \cdot \left(0.16666666666666666 + \left(\ell \cdot \ell\right) \cdot \left(0.008333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.0001984126984126984\right)\right)\right)\right) \cdot \left(\ell \cdot 2\right)\right)\\
\mathbf{elif}\;K \leq 4.3 \cdot 10^{+213}:\\
\;\;\;\;U + \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)}{U}\right)\\
\end{array}
\end{array}
if K < 7.0000000000000005e163Initial program 89.0%
*-commutativeN/A
sinh-undefN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64100.0%
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified83.7%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6480.3%
Simplified80.3%
*-rgt-identityN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr80.3%
if 7.0000000000000005e163 < K < 4.29999999999999995e213Initial program 86.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified72.6%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.1%
Simplified72.1%
Taylor expanded in l around 0
*-lowering-*.f6472.1%
Simplified72.1%
if 4.29999999999999995e213 < K Initial program 77.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified88.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6462.3%
Simplified62.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.9%
Simplified67.9%
Final simplification79.0%
(FPCore (J l K U)
:precision binary64
(if (<= K 2.45e+163)
(+
U
(*
J
(*
l
(+
2.0
(* (* l l) (+ 0.3333333333333333 (* l (* l 0.016666666666666666))))))))
(if (<= K 1.85e+213)
(+ U (* l (* (+ 1.0 (* -0.125 (* K K))) (* J 2.0))))
(* U (+ 1.0 (/ (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))) U))))))
double code(double J, double l, double K, double U) {
double tmp;
if (K <= 2.45e+163) {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666)))))));
} else if (K <= 1.85e+213) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / 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 (k <= 2.45d+163) then
tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * 0.016666666666666666d0)))))))
else if (k <= 1.85d+213) then
tmp = u + (l * ((1.0d0 + ((-0.125d0) * (k * k))) * (j * 2.0d0)))
else
tmp = u * (1.0d0 + ((j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0))))) / u))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (K <= 2.45e+163) {
tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666)))))));
} else if (K <= 1.85e+213) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if K <= 2.45e+163: tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))) elif K <= 1.85e+213: tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0))) else: tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)) return tmp
function code(J, l, K, U) tmp = 0.0 if (K <= 2.45e+163) tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * 0.016666666666666666)))))))); elseif (K <= 1.85e+213) tmp = Float64(U + Float64(l * Float64(Float64(1.0 + Float64(-0.125 * Float64(K * K))) * Float64(J * 2.0)))); else tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))) / U))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (K <= 2.45e+163) tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * 0.016666666666666666))))))); elseif (K <= 1.85e+213) tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0))); else tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[K, 2.45e+163], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[K, 1.85e+213], N[(U + N[(l * N[(N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(1.0 + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;K \leq 2.45 \cdot 10^{+163}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot 0.016666666666666666\right)\right)\right)\right)\\
\mathbf{elif}\;K \leq 1.85 \cdot 10^{+213}:\\
\;\;\;\;U + \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)}{U}\right)\\
\end{array}
\end{array}
if K < 2.45e163Initial program 89.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.6%
Simplified90.6%
Taylor expanded in K around 0
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.9%
Simplified76.9%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.1%
Applied egg-rr78.1%
if 2.45e163 < K < 1.84999999999999996e213Initial program 86.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified72.6%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.1%
Simplified72.1%
Taylor expanded in l around 0
*-lowering-*.f6472.1%
Simplified72.1%
if 1.84999999999999996e213 < K Initial program 77.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified88.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6462.3%
Simplified62.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.9%
Simplified67.9%
Final simplification77.1%
(FPCore (J l K U)
:precision binary64
(if (<= K 7e+163)
(+
U
(*
l
(*
J
(+
2.0
(* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))
(if (<= K 4.6e+212)
(+ U (* l (* (+ 1.0 (* -0.125 (* K K))) (* J 2.0))))
(* U (+ 1.0 (/ (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))) U))))))
double code(double J, double l, double K, double U) {
double tmp;
if (K <= 7e+163) {
tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else if (K <= 4.6e+212) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / 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 (k <= 7d+163) then
tmp = u + (l * (j * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
else if (k <= 4.6d+212) then
tmp = u + (l * ((1.0d0 + ((-0.125d0) * (k * k))) * (j * 2.0d0)))
else
tmp = u * (1.0d0 + ((j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0))))) / u))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (K <= 7e+163) {
tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
} else if (K <= 4.6e+212) {
tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0)));
} else {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if K <= 7e+163: tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))) elif K <= 4.6e+212: tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0))) else: tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)) return tmp
function code(J, l, K, U) tmp = 0.0 if (K <= 7e+163) tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))))); elseif (K <= 4.6e+212) tmp = Float64(U + Float64(l * Float64(Float64(1.0 + Float64(-0.125 * Float64(K * K))) * Float64(J * 2.0)))); else tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))) / U))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (K <= 7e+163) tmp = U + (l * (J * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))); elseif (K <= 4.6e+212) tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (J * 2.0))); else tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[K, 7e+163], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[K, 4.6e+212], N[(U + N[(l * N[(N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U * N[(1.0 + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;K \leq 7 \cdot 10^{+163}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
\mathbf{elif}\;K \leq 4.6 \cdot 10^{+212}:\\
\;\;\;\;U + \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)}{U}\right)\\
\end{array}
\end{array}
if K < 7.0000000000000005e163Initial program 89.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.6%
Simplified90.6%
Taylor expanded in K around 0
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.9%
Simplified76.9%
if 7.0000000000000005e163 < K < 4.5999999999999997e212Initial program 86.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified72.6%
Taylor expanded in K around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.1%
Simplified72.1%
Taylor expanded in l around 0
*-lowering-*.f6472.1%
Simplified72.1%
if 4.5999999999999997e212 < K Initial program 77.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified88.7%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6462.3%
Simplified62.3%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.9%
Simplified67.9%
Final simplification76.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* J (* l (* 0.016666666666666666 (* l (* l (* l l)))))))))
(if (<= l -1.1e+25)
t_0
(if (<= l 0.95)
(+ U (* l (* J (+ 2.0 (* l (* l 0.3333333333333333))))))
t_0))))
double code(double J, double l, double K, double U) {
double t_0 = U + (J * (l * (0.016666666666666666 * (l * (l * (l * l))))));
double tmp;
if (l <= -1.1e+25) {
tmp = t_0;
} else if (l <= 0.95) {
tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
} 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 + (j * (l * (0.016666666666666666d0 * (l * (l * (l * l))))))
if (l <= (-1.1d+25)) then
tmp = t_0
else if (l <= 0.95d0) then
tmp = u + (l * (j * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
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 * (0.016666666666666666 * (l * (l * (l * l))))));
double tmp;
if (l <= -1.1e+25) {
tmp = t_0;
} else if (l <= 0.95) {
tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (J * (l * (0.016666666666666666 * (l * (l * (l * l)))))) tmp = 0 if l <= -1.1e+25: tmp = t_0 elif l <= 0.95: tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(J * Float64(l * Float64(0.016666666666666666 * Float64(l * Float64(l * Float64(l * l))))))) tmp = 0.0 if (l <= -1.1e+25) tmp = t_0; elseif (l <= 0.95) tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (J * (l * (0.016666666666666666 * (l * (l * (l * l)))))); tmp = 0.0; if (l <= -1.1e+25) tmp = t_0; elseif (l <= 0.95) tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))); 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[(0.016666666666666666 * N[(l * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.1e+25], t$95$0, If[LessEqual[l, 0.95], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + J \cdot \left(\ell \cdot \left(0.016666666666666666 \cdot \left(\ell \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\right)\\
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{+25}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 0.95:\\
\;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.1e25 or 0.94999999999999996 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6482.8%
Simplified82.8%
Taylor expanded in K around 0
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.5%
Simplified60.5%
Taylor expanded in l around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.5%
Simplified60.5%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr62.8%
if -1.1e25 < l < 0.94999999999999996Initial program 76.3%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified97.4%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.5%
Simplified83.5%
Final simplification73.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (+ U (* l (* J (* l (* 0.016666666666666666 (* l (* l l)))))))))
(if (<= l -1.1e+25)
t_0
(if (<= l 0.95)
(+ U (* l (* J (+ 2.0 (* l (* l 0.3333333333333333))))))
t_0))))
double code(double J, double l, double K, double U) {
double t_0 = U + (l * (J * (l * (0.016666666666666666 * (l * (l * l))))));
double tmp;
if (l <= -1.1e+25) {
tmp = t_0;
} else if (l <= 0.95) {
tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
} 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 * (l * (0.016666666666666666d0 * (l * (l * l))))))
if (l <= (-1.1d+25)) then
tmp = t_0
else if (l <= 0.95d0) then
tmp = u + (l * (j * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
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 * (l * (0.016666666666666666 * (l * (l * l))))));
double tmp;
if (l <= -1.1e+25) {
tmp = t_0;
} else if (l <= 0.95) {
tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (l * (J * (l * (0.016666666666666666 * (l * (l * l)))))) tmp = 0 if l <= -1.1e+25: tmp = t_0 elif l <= 0.95: tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(l * Float64(J * Float64(l * Float64(0.016666666666666666 * Float64(l * Float64(l * l))))))) tmp = 0.0 if (l <= -1.1e+25) tmp = t_0; elseif (l <= 0.95) tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (l * (J * (l * (0.016666666666666666 * (l * (l * l)))))); tmp = 0.0; if (l <= -1.1e+25) tmp = t_0; elseif (l <= 0.95) tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(l * N[(J * N[(l * N[(0.016666666666666666 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.1e+25], t$95$0, If[LessEqual[l, 0.95], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \ell \cdot \left(J \cdot \left(\ell \cdot \left(0.016666666666666666 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\right)\\
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{+25}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 0.95:\\
\;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.1e25 or 0.94999999999999996 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6482.8%
Simplified82.8%
Taylor expanded in K around 0
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.5%
Simplified60.5%
Taylor expanded in l around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.5%
Simplified60.5%
if -1.1e25 < l < 0.94999999999999996Initial program 76.3%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified97.4%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.5%
Simplified83.5%
Final simplification72.1%
(FPCore (J l K U) :precision binary64 (if (<= l 3.6e+36) (* U (+ 1.0 (/ (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))) U))) (+ U (* J (* l (* 0.016666666666666666 (* l (* l (* l l)))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 3.6e+36) {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U));
} else {
tmp = U + (J * (l * (0.016666666666666666 * (l * (l * (l * 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 <= 3.6d+36) then
tmp = u * (1.0d0 + ((j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0))))) / u))
else
tmp = u + (j * (l * (0.016666666666666666d0 * (l * (l * (l * l))))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 3.6e+36) {
tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U));
} else {
tmp = U + (J * (l * (0.016666666666666666 * (l * (l * (l * l))))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 3.6e+36: tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)) else: tmp = U + (J * (l * (0.016666666666666666 * (l * (l * (l * l)))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 3.6e+36) tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))) / U))); else tmp = Float64(U + Float64(J * Float64(l * Float64(0.016666666666666666 * Float64(l * Float64(l * Float64(l * l))))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 3.6e+36) tmp = U * (1.0 + ((J * (l * (2.0 + (l * (l * 0.3333333333333333))))) / U)); else tmp = U + (J * (l * (0.016666666666666666 * (l * (l * (l * l)))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 3.6e+36], N[(U * N[(1.0 + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(0.016666666666666666 * N[(l * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.6 \cdot 10^{+36}:\\
\;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)}{U}\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(0.016666666666666666 \cdot \left(\ell \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if l < 3.5999999999999997e36Initial program 84.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified89.2%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.0%
Simplified73.0%
Taylor expanded in U around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.2%
Simplified75.2%
if 3.5999999999999997e36 < l Initial program 100.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6481.6%
Simplified81.6%
Taylor expanded in K around 0
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.3%
Simplified60.3%
Taylor expanded in l around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.3%
Simplified60.3%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr63.6%
Final simplification72.6%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* 0.3333333333333333 (* l (* l l)))))) (if (<= l -3.8e+28) t_0 (if (<= l 190000000.0) (+ U (* l (* J 2.0))) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (0.3333333333333333 * (l * (l * l)));
double tmp;
if (l <= -3.8e+28) {
tmp = t_0;
} else if (l <= 190000000.0) {
tmp = U + (l * (J * 2.0));
} 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 = j * (0.3333333333333333d0 * (l * (l * l)))
if (l <= (-3.8d+28)) then
tmp = t_0
else if (l <= 190000000.0d0) then
tmp = u + (l * (j * 2.0d0))
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 = J * (0.3333333333333333 * (l * (l * l)));
double tmp;
if (l <= -3.8e+28) {
tmp = t_0;
} else if (l <= 190000000.0) {
tmp = U + (l * (J * 2.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (0.3333333333333333 * (l * (l * l))) tmp = 0 if l <= -3.8e+28: tmp = t_0 elif l <= 190000000.0: tmp = U + (l * (J * 2.0)) else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l)))) tmp = 0.0 if (l <= -3.8e+28) tmp = t_0; elseif (l <= 190000000.0) tmp = Float64(U + Float64(l * Float64(J * 2.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (0.3333333333333333 * (l * (l * l))); tmp = 0.0; if (l <= -3.8e+28) tmp = t_0; elseif (l <= 190000000.0) tmp = U + (l * (J * 2.0)); else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.8e+28], t$95$0, If[LessEqual[l, 190000000.0], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{+28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 190000000:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -3.7999999999999999e28 or 1.9e8 < l Initial program 100.0%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified71.2%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.9%
Simplified51.9%
Taylor expanded in l around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
unpow3N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.1%
Simplified54.1%
if -3.7999999999999999e28 < l < 1.9e8Initial program 76.5%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified97.5%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.6%
Simplified83.6%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6483.4%
Simplified83.4%
Final simplification69.0%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* 2.0 (* J l)))) (if (<= l -2.8e-11) t_0 (if (<= l 1.5e+18) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (J * l);
double tmp;
if (l <= -2.8e-11) {
tmp = t_0;
} else if (l <= 1.5e+18) {
tmp = 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 = 2.0d0 * (j * l)
if (l <= (-2.8d-11)) then
tmp = t_0
else if (l <= 1.5d+18) then
tmp = 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 = 2.0 * (J * l);
double tmp;
if (l <= -2.8e-11) {
tmp = t_0;
} else if (l <= 1.5e+18) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = 2.0 * (J * l) tmp = 0 if l <= -2.8e-11: tmp = t_0 elif l <= 1.5e+18: tmp = U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(2.0 * Float64(J * l)) tmp = 0.0 if (l <= -2.8e-11) tmp = t_0; elseif (l <= 1.5e+18) tmp = U; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 2.0 * (J * l); tmp = 0.0; if (l <= -2.8e-11) tmp = t_0; elseif (l <= 1.5e+18) tmp = U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[(J * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.8e-11], t$95$0, If[LessEqual[l, 1.5e+18], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(J \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -2.8 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.5 \cdot 10^{+18}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -2.8e-11 or 1.5e18 < l Initial program 99.6%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified70.4%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.5%
Simplified51.5%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6420.6%
Simplified20.6%
Taylor expanded in l around inf
*-lowering-*.f64N/A
*-lowering-*.f6420.4%
Simplified20.4%
if -2.8e-11 < l < 1.5e18Initial program 76.3%
Taylor expanded in J around 0
Simplified74.1%
(FPCore (J l K U) :precision binary64 (+ U (* l (* J (+ 2.0 (* l (* l 0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
return U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
}
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 + (l * (l * 0.3333333333333333d0)))))
end function
public static double code(double J, double l, double K, double U) {
return U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
}
def code(J, l, K, U): return U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))))
function code(J, l, K, U) return Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))) end
function tmp = code(J, l, K, U) tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333))))); end
code[J_, l_, K_, U_] := N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)
\end{array}
Initial program 88.1%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified84.6%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6468.0%
Simplified68.0%
Final simplification68.0%
(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 88.1%
Taylor expanded in l around 0
distribute-rgt-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
fma-undefineN/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
Simplified84.6%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6468.0%
Simplified68.0%
Taylor expanded in l around 0
*-commutativeN/A
*-lowering-*.f6452.4%
Simplified52.4%
Final simplification52.4%
(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 88.1%
Taylor expanded in J around 0
Simplified37.9%
herbie shell --seed 2024163
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))