
(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 19 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 (fma (* (* 2.0 (sinh l)) (cos (* K 0.5))) J U))
double code(double J, double l, double K, double U) {
return fma(((2.0 * sinh(l)) * cos((K * 0.5))), J, U);
}
function code(J, l, K, U) return fma(Float64(Float64(2.0 * sinh(l)) * cos(Float64(K * 0.5))), J, U) end
code[J_, l_, K_, U_] := N[(N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot 0.5\right), J, U\right)
\end{array}
Initial program 87.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval99.9
Applied egg-rr99.9%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.8)
(+
U
(*
t_0
(*
J
(*
l
(fma
(* l l)
(fma
l
(* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
0.3333333333333333)
2.0)))))
(fma (* 2.0 (sinh l)) J U))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.8) {
tmp = U + (t_0 * (J * (l * fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0))));
} else {
tmp = fma((2.0 * sinh(l)), J, U);
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.8) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0))))); else tmp = fma(Float64(2.0 * sinh(l)), J, U); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.8], N[(U + N[(t$95$0 * N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.8:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.80000000000000004Initial program 85.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6496.2
Simplified96.2%
if 0.80000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 88.2%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.5%
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.5
Applied egg-rr99.5%
Final simplification98.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.8)
(+
U
(*
t_0
(*
J
(*
l
(fma
(* l l)
(fma l (* l 0.016666666666666666) 0.3333333333333333)
2.0)))))
(fma (* 2.0 (sinh l)) J U))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.8) {
tmp = U + (t_0 * (J * (l * fma((l * l), fma(l, (l * 0.016666666666666666), 0.3333333333333333), 2.0))));
} else {
tmp = fma((2.0 * sinh(l)), J, U);
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.8) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(Float64(l * l), fma(l, Float64(l * 0.016666666666666666), 0.3333333333333333), 2.0))))); else tmp = fma(Float64(2.0 * sinh(l)), J, U); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.8], N[(U + N[(t$95$0 * N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.8:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot 0.016666666666666666, 0.3333333333333333\right), 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.80000000000000004Initial program 85.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6492.6
Simplified92.6%
if 0.80000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 88.2%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.5%
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.5
Applied egg-rr99.5%
Final simplification96.7%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.8)
(+ U (* t_0 (* J (* l (fma 0.3333333333333333 (* l l) 2.0)))))
(fma (* 2.0 (sinh l)) J U))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double tmp;
if (t_0 <= 0.8) {
tmp = U + (t_0 * (J * (l * fma(0.3333333333333333, (l * l), 2.0))));
} else {
tmp = fma((2.0 * sinh(l)), J, U);
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) tmp = 0.0 if (t_0 <= 0.8) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0))))); else tmp = fma(Float64(2.0 * sinh(l)), J, U); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.8], N[(U + N[(t$95$0 * N[(J * N[(l * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.8:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.80000000000000004Initial program 85.3%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6488.7
Simplified88.7%
if 0.80000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 88.2%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.5%
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6499.5
Applied egg-rr99.5%
Final simplification95.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* 2.0 (sinh l))))
(if (<= l -1.2e+93)
(fma
(*
l
(fma (* l l) (fma (* l l) 0.016666666666666666 0.3333333333333333) 2.0))
J
U)
(if (<= l -1.6e-7)
(fma (* t_0 (fma -0.125 (* K K) 1.0)) J U)
(if (<= l 0.000125)
(fma (cos (* K 0.5)) (* J (* 2.0 l)) U)
(fma t_0 J U))))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * sinh(l);
double tmp;
if (l <= -1.2e+93) {
tmp = fma((l * fma((l * l), fma((l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U);
} else if (l <= -1.6e-7) {
tmp = fma((t_0 * fma(-0.125, (K * K), 1.0)), J, U);
} else if (l <= 0.000125) {
tmp = fma(cos((K * 0.5)), (J * (2.0 * l)), U);
} else {
tmp = fma(t_0, J, U);
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(2.0 * sinh(l)) tmp = 0.0 if (l <= -1.2e+93) tmp = fma(Float64(l * fma(Float64(l * l), fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U); elseif (l <= -1.6e-7) tmp = fma(Float64(t_0 * fma(-0.125, Float64(K * K), 1.0)), J, U); elseif (l <= 0.000125) tmp = fma(cos(Float64(K * 0.5)), Float64(J * Float64(2.0 * l)), U); else tmp = fma(t_0, J, U); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.2e+93], N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, -1.6e-7], N[(N[(t$95$0 * N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, 0.000125], N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(t$95$0 * J + U), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \sinh \ell\\
\mathbf{if}\;\ell \leq -1.2 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right)\\
\mathbf{elif}\;\ell \leq -1.6 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(t\_0 \cdot \mathsf{fma}\left(-0.125, K \cdot K, 1\right), J, U\right)\\
\mathbf{elif}\;\ell \leq 0.000125:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, J, U\right)\\
\end{array}
\end{array}
if l < -1.20000000000000005e93Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified86.0%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6486.0
Simplified86.0%
if -1.20000000000000005e93 < l < -1.6e-7Initial program 98.9%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval99.9
Applied egg-rr99.9%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6480.6
Simplified80.6%
if -1.6e-7 < l < 1.25e-4Initial program 72.4%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6499.9
Simplified99.9%
if 1.25e-4 < l Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified76.2%
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6476.2
Applied egg-rr76.2%
Final simplification89.4%
(FPCore (J l K U) :precision binary64 (if (<= K 15.6) (fma (* 2.0 (sinh l)) J U) (fma l (* (cos (* K 0.5)) (* J (fma 0.3333333333333333 (* l l) 2.0))) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (K <= 15.6) {
tmp = fma((2.0 * sinh(l)), J, U);
} else {
tmp = fma(l, (cos((K * 0.5)) * (J * fma(0.3333333333333333, (l * l), 2.0))), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (K <= 15.6) tmp = fma(Float64(2.0 * sinh(l)), J, U); else tmp = fma(l, Float64(cos(Float64(K * 0.5)) * Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0))), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[K, 15.6], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;K \leq 15.6:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, \cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right), U\right)\\
\end{array}
\end{array}
if K < 15.5999999999999996Initial program 87.8%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified87.4%
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6487.4
Applied egg-rr87.4%
if 15.5999999999999996 < K Initial program 84.2%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified86.0%
Final simplification87.1%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (fma (* 2.0 (sinh l)) J U)))
(if (<= l -1.6e-7)
t_0
(if (<= l 0.00056) (fma (cos (* K 0.5)) (* J (* 2.0 l)) U) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = fma((2.0 * sinh(l)), J, U);
double tmp;
if (l <= -1.6e-7) {
tmp = t_0;
} else if (l <= 0.00056) {
tmp = fma(cos((K * 0.5)), (J * (2.0 * l)), U);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = fma(Float64(2.0 * sinh(l)), J, U) tmp = 0.0 if (l <= -1.6e-7) tmp = t_0; elseif (l <= 0.00056) tmp = fma(cos(Float64(K * 0.5)), Float64(J * Float64(2.0 * l)), U); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]}, If[LessEqual[l, -1.6e-7], t$95$0, If[LessEqual[l, 0.00056], N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 0.00056:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.6e-7 or 5.5999999999999995e-4 < l Initial program 99.8%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified76.1%
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6476.1
Applied egg-rr76.1%
if -1.6e-7 < l < 5.5999999999999995e-4Initial program 72.4%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6499.9
Simplified99.9%
Final simplification87.2%
(FPCore (J l K U) :precision binary64 (fma (* 2.0 (sinh l)) J U))
double code(double J, double l, double K, double U) {
return fma((2.0 * sinh(l)), J, U);
}
function code(J, l, K, U) return fma(Float64(2.0 * sinh(l)), J, U) end
code[J_, l_, K_, U_] := N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)
\end{array}
Initial program 87.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval99.9
Applied egg-rr99.9%
Taylor expanded in K around 0
Simplified81.6%
*-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6481.6
Applied egg-rr81.6%
Final simplification81.6%
(FPCore (J l K U)
:precision binary64
(fma
(*
l
(fma
(* l l)
(fma
l
(* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
0.3333333333333333)
2.0))
J
U))
double code(double J, double l, double K, double U) {
return fma((l * fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0)), J, U);
}
function code(J, l, K, U) return fma(Float64(l * fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0)), J, U) end
code[J_, l_, K_, U_] := N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), J, U\right)
\end{array}
Initial program 87.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval99.9
Applied egg-rr99.9%
Taylor expanded in K around 0
Simplified81.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6477.4
Simplified77.4%
(FPCore (J l K U)
:precision binary64
(if (<= l -8e+61)
(* J (* 0.3333333333333333 (* l (* l l))))
(if (<= l -2.1e+17)
(fma (* l (fma -0.25 (* K K) 2.0)) J U)
(fma l (fma (* l l) (* J 0.3333333333333333) (* 2.0 J)) U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -8e+61) {
tmp = J * (0.3333333333333333 * (l * (l * l)));
} else if (l <= -2.1e+17) {
tmp = fma((l * fma(-0.25, (K * K), 2.0)), J, U);
} else {
tmp = fma(l, fma((l * l), (J * 0.3333333333333333), (2.0 * J)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -8e+61) tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l)))); elseif (l <= -2.1e+17) tmp = fma(Float64(l * fma(-0.25, Float64(K * K), 2.0)), J, U); else tmp = fma(l, fma(Float64(l * l), Float64(J * 0.3333333333333333), Float64(2.0 * J)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -8e+61], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.1e+17], N[(N[(l * N[(-0.25 * N[(K * K), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(l * N[(N[(l * l), $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision] + N[(2.0 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8 \cdot 10^{+61}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -2.1 \cdot 10^{+17}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell \cdot \ell, J \cdot 0.3333333333333333, 2 \cdot J\right), U\right)\\
\end{array}
\end{array}
if l < -7.9999999999999996e61Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified74.1%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6464.0
Simplified64.0%
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-*.f6473.1
Simplified73.1%
if -7.9999999999999996e61 < l < -2.1e17Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in l around 0
*-lowering-*.f6415.3
Simplified15.3%
Taylor expanded in K around 0
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6448.9
Simplified48.9%
if -2.1e17 < l Initial program 82.3%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified88.2%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6474.1
Simplified74.1%
distribute-rgt-inN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.1
Applied egg-rr74.1%
Final simplification72.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* 0.3333333333333333 (* l (* l l))))))
(if (<= l -2.6e+29)
t_0
(if (<= l -3.7e+16)
(* (* l J) (* (* K K) -0.25))
(if (<= l 2600000.0) (fma 2.0 (* l J) U) 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 <= -2.6e+29) {
tmp = t_0;
} else if (l <= -3.7e+16) {
tmp = (l * J) * ((K * K) * -0.25);
} else if (l <= 2600000.0) {
tmp = fma(2.0, (l * J), U);
} 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 <= -2.6e+29) tmp = t_0; elseif (l <= -3.7e+16) tmp = Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25)); elseif (l <= 2600000.0) tmp = fma(2.0, Float64(l * J), U); else tmp = t_0; end return 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, -2.6e+29], t$95$0, If[LessEqual[l, -3.7e+16], N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2600000.0], N[(2.0 * N[(l * J), $MachinePrecision] + U), $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 -2.6 \cdot 10^{+29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\
\;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{elif}\;\ell \leq 2600000:\\
\;\;\;\;\mathsf{fma}\left(2, \ell \cdot J, U\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -2.6e29 or 2.6e6 < l Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified70.3%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6454.7
Simplified54.7%
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-*.f6459.3
Simplified59.3%
if -2.6e29 < l < -3.7e16Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified22.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
Taylor expanded in l around 0
Simplified100.0%
Taylor expanded in K around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
if -3.7e16 < l < 2.6e6Initial program 73.7%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified96.1%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6484.8
Simplified84.8%
Taylor expanded in l around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6484.7
Simplified84.7%
Final simplification72.6%
(FPCore (J l K U)
:precision binary64
(if (<= l -1.28e+67)
(* J (* 0.3333333333333333 (* l (* l l))))
(if (<= l -3.7e+16)
(fma (* l (fma -0.25 (* K K) 2.0)) J U)
(fma (fma l (* l 0.3333333333333333) 2.0) (* l J) U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.28e+67) {
tmp = J * (0.3333333333333333 * (l * (l * l)));
} else if (l <= -3.7e+16) {
tmp = fma((l * fma(-0.25, (K * K), 2.0)), J, U);
} else {
tmp = fma(fma(l, (l * 0.3333333333333333), 2.0), (l * J), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -1.28e+67) tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l)))); elseif (l <= -3.7e+16) tmp = fma(Float64(l * fma(-0.25, Float64(K * K), 2.0)), J, U); else tmp = fma(fma(l, Float64(l * 0.3333333333333333), 2.0), Float64(l * J), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.28e+67], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.7e+16], N[(N[(l * N[(-0.25 * N[(K * K), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.28 \cdot 10^{+67}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), \ell \cdot J, U\right)\\
\end{array}
\end{array}
if l < -1.28e67Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified74.1%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6464.0
Simplified64.0%
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-*.f6473.1
Simplified73.1%
if -1.28e67 < l < -3.7e16Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in l around 0
*-lowering-*.f6415.3
Simplified15.3%
Taylor expanded in K around 0
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6448.9
Simplified48.9%
if -3.7e16 < l Initial program 82.3%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified88.2%
Taylor expanded in K around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.1
Simplified74.1%
Final simplification72.2%
(FPCore (J l K U)
:precision binary64
(if (<= l -7.2e+64)
(* J (* 0.3333333333333333 (* l (* l l))))
(if (<= l -3.8e+16)
(fma (* l (fma -0.25 (* K K) 2.0)) J U)
(fma l (* J (fma l (* l 0.3333333333333333) 2.0)) U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -7.2e+64) {
tmp = J * (0.3333333333333333 * (l * (l * l)));
} else if (l <= -3.8e+16) {
tmp = fma((l * fma(-0.25, (K * K), 2.0)), J, U);
} else {
tmp = fma(l, (J * fma(l, (l * 0.3333333333333333), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -7.2e+64) tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l)))); elseif (l <= -3.8e+16) tmp = fma(Float64(l * fma(-0.25, Float64(K * K), 2.0)), J, U); else tmp = fma(l, Float64(J * fma(l, Float64(l * 0.3333333333333333), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -7.2e+64], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.8e+16], N[(N[(l * N[(-0.25 * N[(K * K), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(l * N[(J * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.2 \cdot 10^{+64}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -3.8 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\
\end{array}
\end{array}
if l < -7.20000000000000027e64Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified74.1%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6464.0
Simplified64.0%
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-*.f6473.1
Simplified73.1%
if -7.20000000000000027e64 < l < -3.8e16Initial program 100.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
Taylor expanded in l around 0
*-lowering-*.f6415.3
Simplified15.3%
Taylor expanded in K around 0
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6448.9
Simplified48.9%
if -3.8e16 < l Initial program 82.3%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified88.2%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6474.1
Simplified74.1%
(FPCore (J l K U)
:precision binary64
(if (<= l -2e+29)
(* J (* 0.3333333333333333 (* l (* l l))))
(if (<= l -5.2e+16)
(* (* l J) (* (* K K) -0.25))
(fma l (* J (fma l (* l 0.3333333333333333) 2.0)) U))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2e+29) {
tmp = J * (0.3333333333333333 * (l * (l * l)));
} else if (l <= -5.2e+16) {
tmp = (l * J) * ((K * K) * -0.25);
} else {
tmp = fma(l, (J * fma(l, (l * 0.3333333333333333), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -2e+29) tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l)))); elseif (l <= -5.2e+16) tmp = Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25)); else tmp = fma(l, Float64(J * fma(l, Float64(l * 0.3333333333333333), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -2e+29], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5.2e+16], N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], N[(l * N[(J * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{+29}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -5.2 \cdot 10^{+16}:\\
\;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\
\end{array}
\end{array}
if l < -1.99999999999999983e29Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified68.4%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6457.0
Simplified57.0%
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-*.f6464.4
Simplified64.4%
if -1.99999999999999983e29 < l < -5.2e16Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified22.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
Taylor expanded in l around 0
Simplified100.0%
Taylor expanded in K around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
if -5.2e16 < l Initial program 82.3%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified88.2%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6474.1
Simplified74.1%
Final simplification72.2%
(FPCore (J l K U) :precision binary64 (fma (* l (fma (* l l) (fma (* l l) 0.016666666666666666 0.3333333333333333) 2.0)) J U))
double code(double J, double l, double K, double U) {
return fma((l * fma((l * l), fma((l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U);
}
function code(J, l, K, U) return fma(Float64(l * fma(Float64(l * l), fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U) end
code[J_, l_, K_, U_] := N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right)
\end{array}
Initial program 87.0%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f64N/A
cos-lowering-cos.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval99.9
Applied egg-rr99.9%
Taylor expanded in K around 0
Simplified81.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6475.2
Simplified75.2%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* 0.3333333333333333 (* l (* l l)))))) (if (<= l -9e+28) t_0 (if (<= l 470000000.0) (fma 2.0 (* l J) U) 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 <= -9e+28) {
tmp = t_0;
} else if (l <= 470000000.0) {
tmp = fma(2.0, (l * J), U);
} 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 <= -9e+28) tmp = t_0; elseif (l <= 470000000.0) tmp = fma(2.0, Float64(l * J), U); else tmp = t_0; end return 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, -9e+28], t$95$0, If[LessEqual[l, 470000000.0], N[(2.0 * N[(l * J), $MachinePrecision] + U), $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 -9 \cdot 10^{+28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 470000000:\\
\;\;\;\;\mathsf{fma}\left(2, \ell \cdot J, U\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -8.9999999999999994e28 or 4.7e8 < l Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified70.3%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6454.7
Simplified54.7%
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-*.f6459.3
Simplified59.3%
if -8.9999999999999994e28 < l < 4.7e8Initial program 74.7%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified93.3%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6481.6
Simplified81.6%
Taylor expanded in l around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6481.5
Simplified81.5%
Final simplification70.7%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* 2.0 (* l J)))) (if (<= l -1.6e-7) t_0 (if (<= l 6.2e-42) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = 2.0 * (l * J);
double tmp;
if (l <= -1.6e-7) {
tmp = t_0;
} else if (l <= 6.2e-42) {
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 * (l * j)
if (l <= (-1.6d-7)) then
tmp = t_0
else if (l <= 6.2d-42) 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 * (l * J);
double tmp;
if (l <= -1.6e-7) {
tmp = t_0;
} else if (l <= 6.2e-42) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = 2.0 * (l * J) tmp = 0 if l <= -1.6e-7: tmp = t_0 elif l <= 6.2e-42: tmp = U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(2.0 * Float64(l * J)) tmp = 0.0 if (l <= -1.6e-7) tmp = t_0; elseif (l <= 6.2e-42) tmp = U; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = 2.0 * (l * J); tmp = 0.0; if (l <= -1.6e-7) tmp = t_0; elseif (l <= 6.2e-42) tmp = U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[(l * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.6e-7], t$95$0, If[LessEqual[l, 6.2e-42], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\ell \cdot J\right)\\
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{-42}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.6e-7 or 6.2000000000000005e-42 < l Initial program 96.6%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified67.9%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6451.7
Simplified51.7%
Taylor expanded in l around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6420.9
Simplified20.9%
Taylor expanded in J around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6419.7
Simplified19.7%
if -1.6e-7 < l < 6.2000000000000005e-42Initial program 75.0%
Taylor expanded in J around 0
Simplified75.0%
(FPCore (J l K U) :precision binary64 (fma 2.0 (* l J) U))
double code(double J, double l, double K, double U) {
return fma(2.0, (l * J), U);
}
function code(J, l, K, U) return fma(2.0, Float64(l * J), U) end
code[J_, l_, K_, U_] := N[(2.0 * N[(l * J), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(2, \ell \cdot J, U\right)
\end{array}
Initial program 87.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Simplified82.0%
Taylor expanded in K around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6468.5
Simplified68.5%
Taylor expanded in l around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6451.2
Simplified51.2%
Final simplification51.2%
(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.0%
Taylor expanded in J around 0
Simplified35.0%
herbie shell --seed 2024197
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))