
(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 23 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 (* (* J (cos (* K 0.5))) (sinh l)) 2.0 U))
double code(double J, double l, double K, double U) {
return fma(((J * cos((K * 0.5))) * sinh(l)), 2.0, U);
}
function code(J, l, K, U) return fma(Float64(Float64(J * cos(Float64(K * 0.5))) * sinh(l)), 2.0, U) end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(J \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \sinh \ell, 2, U\right)
\end{array}
Initial program 87.8%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (<= t_0 (- INFINITY))
(fma (* J (sinh l)) 2.0 U)
(if (<= t_0 5e-11)
(fma (cos (* K 0.5)) (* J (* l 2.0)) U)
(fma (* (sinh l) (fma (* K K) (* J -0.125) J)) 2.0 U)))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma((J * sinh(l)), 2.0, U);
} else if (t_0 <= 5e-11) {
tmp = fma(cos((K * 0.5)), (J * (l * 2.0)), U);
} else {
tmp = fma((sinh(l) * fma((K * K), (J * -0.125), J)), 2.0, U);
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = fma(Float64(J * sinh(l)), 2.0, U); elseif (t_0 <= 5e-11) tmp = fma(cos(Float64(K * 0.5)), Float64(J * Float64(l * 2.0)), U); else tmp = fma(Float64(sinh(l) * fma(Float64(K * K), Float64(J * -0.125), J)), 2.0, U); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision], If[LessEqual[t$95$0, 5e-11], N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(N[Sinh[l], $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * N[(J * -0.125), $MachinePrecision] + J), $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(J \cdot \sinh \ell, 2, U\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(\ell \cdot 2\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\sinh \ell \cdot \mathsf{fma}\left(K \cdot K, J \cdot -0.125, J\right), 2, U\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0Initial program 100.0%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified79.4%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 5.00000000000000018e-11Initial program 74.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Simplified99.9%
if 5.00000000000000018e-11 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.4
Simplified79.4%
Final simplification89.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.97)
(+
U
(*
t_0
(*
J
(*
l
(fma
(* l l)
(fma
l
(* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
0.3333333333333333)
2.0)))))
(fma (* 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.97) {
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((J * 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.97) 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(J * sinh(l)), 2.0, 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.97], 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[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.97:\\
\;\;\;\;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(J \cdot \sinh \ell, 2, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.96999999999999997Initial program 83.5%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.9
Simplified96.9%
if 0.96999999999999997 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.9%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.5%
Final simplification98.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.97)
(+
U
(*
t_0
(*
J
(*
l
(fma
(* l l)
(fma (* l l) 0.016666666666666666 0.3333333333333333)
2.0)))))
(fma (* 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.97) {
tmp = U + (t_0 * (J * (l * fma((l * l), fma((l * l), 0.016666666666666666, 0.3333333333333333), 2.0))));
} else {
tmp = fma((J * 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.97) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(Float64(l * l), fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333), 2.0))))); else tmp = fma(Float64(J * sinh(l)), 2.0, 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.97], N[(U + N[(t$95$0 * N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.97:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J \cdot \sinh \ell, 2, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.96999999999999997Initial program 83.5%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6493.1
Simplified93.1%
if 0.96999999999999997 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.9%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified99.5%
Final simplification96.4%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.04)
(fma
U
(/ (* (* l (* J (fma 0.3333333333333333 (* l l) 2.0))) (cos (* K 0.5))) U)
U)
(fma (* J (sinh l)) 2.0 U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = fma(U, (((l * (J * fma(0.3333333333333333, (l * l), 2.0))) * cos((K * 0.5))) / U), U);
} else {
tmp = fma((J * sinh(l)), 2.0, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = fma(U, Float64(Float64(Float64(l * Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0))) * cos(Float64(K * 0.5))) / U), U); else tmp = fma(Float64(J * sinh(l)), 2.0, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U * N[(N[(N[(l * N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision] + U), $MachinePrecision], N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;\mathsf{fma}\left(U, \frac{\left(\ell \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right)\right) \cdot \cos \left(K \cdot 0.5\right)}{U}, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J \cdot \sinh \ell, 2, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 84.2%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified88.5%
Taylor expanded in U around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified92.7%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified95.2%
Final simplification94.6%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 -0.04)
(+ U (* t_0 (* J (* l (fma 0.3333333333333333 (* l l) 2.0)))))
(fma (* 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.04) {
tmp = U + (t_0 * (J * (l * fma(0.3333333333333333, (l * l), 2.0))));
} else {
tmp = fma((J * 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.04) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0))))); else tmp = fma(Float64(J * sinh(l)), 2.0, 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.04], 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[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -0.04:\\
\;\;\;\;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(J \cdot \sinh \ell, 2, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 84.2%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.3
Simplified91.3%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified95.2%
Final simplification94.2%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.04) (fma l (* (* J (fma 0.3333333333333333 (* l l) 2.0)) (cos (* K 0.5))) U) (fma (* J (sinh l)) 2.0 U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = fma(l, ((J * fma(0.3333333333333333, (l * l), 2.0)) * cos((K * 0.5))), U);
} else {
tmp = fma((J * sinh(l)), 2.0, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = fma(l, Float64(Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0)) * cos(Float64(K * 0.5))), U); else tmp = fma(Float64(J * sinh(l)), 2.0, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(l * N[(N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;\mathsf{fma}\left(\ell, \left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right) \cdot \cos \left(K \cdot 0.5\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J \cdot \sinh \ell, 2, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial 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
lower-fma.f64N/A
Simplified88.5%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified95.2%
Final simplification93.5%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.04)
(fma
U
(*
(* (* l (fma l (* l 0.3333333333333333) 2.0)) (* J (* K K)))
(/ -0.125 U))
U)
(fma (* J (sinh l)) 2.0 U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = fma(U, (((l * fma(l, (l * 0.3333333333333333), 2.0)) * (J * (K * K))) * (-0.125 / U)), U);
} else {
tmp = fma((J * sinh(l)), 2.0, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = fma(U, Float64(Float64(Float64(l * fma(l, Float64(l * 0.3333333333333333), 2.0)) * Float64(J * Float64(K * K))) * Float64(-0.125 / U)), U); else tmp = fma(Float64(J * sinh(l)), 2.0, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U * N[(N[(N[(l * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(J * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / U), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;\mathsf{fma}\left(U, \left(\left(\ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)\right) \cdot \left(J \cdot \left(K \cdot K\right)\right)\right) \cdot \frac{-0.125}{U}, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J \cdot \sinh \ell, 2, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 84.2%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified88.5%
Taylor expanded in U around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified92.7%
Taylor expanded in K around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
distribute-lft-outN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Simplified26.6%
Taylor expanded in K around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
Simplified60.9%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified95.2%
Final simplification86.2%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.04)
(fma
U
(*
(* (* l (fma l (* l 0.3333333333333333) 2.0)) (* J (* K K)))
(/ -0.125 U))
U)
(+
U
(*
(fma
(* l l)
(fma
l
(* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
0.3333333333333333)
2.0)
(* J l)))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = fma(U, (((l * fma(l, (l * 0.3333333333333333), 2.0)) * (J * (K * K))) * (-0.125 / U)), U);
} else {
tmp = U + (fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0) * (J * l));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = fma(U, Float64(Float64(Float64(l * fma(l, Float64(l * 0.3333333333333333), 2.0)) * Float64(J * Float64(K * K))) * Float64(-0.125 / U)), U); else tmp = Float64(U + Float64(fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0) * Float64(J * l))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U * N[(N[(N[(l * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(J * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / U), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(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] * N[(J * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;\mathsf{fma}\left(U, \left(\left(\ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)\right) \cdot \left(J \cdot \left(K \cdot K\right)\right)\right) \cdot \frac{-0.125}{U}, U\right)\\
\mathbf{else}:\\
\;\;\;\;U + \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) \cdot \left(J \cdot \ell\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 84.2%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified88.5%
Taylor expanded in U around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified92.7%
Taylor expanded in K around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
distribute-lft-outN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Simplified26.6%
Taylor expanded in K around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
Simplified60.9%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6494.5
Simplified94.5%
Taylor expanded in K around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.7
Simplified89.7%
Final simplification82.2%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.04)
(+
U
(*
l
(* (* J (fma 0.3333333333333333 (* l l) 2.0)) (fma K (* K -0.125) 1.0))))
(+
U
(*
(fma
(* l l)
(fma
l
(* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
0.3333333333333333)
2.0)
(* J l)))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = U + (l * ((J * fma(0.3333333333333333, (l * l), 2.0)) * fma(K, (K * -0.125), 1.0)));
} else {
tmp = U + (fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0) * (J * l));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = Float64(U + Float64(l * Float64(Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0)) * fma(K, Float64(K * -0.125), 1.0)))); else tmp = Float64(U + Float64(fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0) * Float64(J * l))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U + N[(l * N[(N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(K * N[(K * -0.125), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(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] * N[(J * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;U + \ell \cdot \left(\left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right) \cdot \mathsf{fma}\left(K, K \cdot -0.125, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + \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) \cdot \left(J \cdot \ell\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 84.2%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified88.5%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6459.5
Simplified59.5%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6494.5
Simplified94.5%
Taylor expanded in K around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.7
Simplified89.7%
Final simplification81.8%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.04)
(+
U
(*
l
(* (* J (fma 0.3333333333333333 (* l l) 2.0)) (fma K (* K -0.125) 1.0))))
(fma
J
(*
l
(fma
(* l l)
(fma
l
(* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
0.3333333333333333)
2.0))
U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = U + (l * ((J * fma(0.3333333333333333, (l * l), 2.0)) * fma(K, (K * -0.125), 1.0)));
} else {
tmp = fma(J, (l * fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = Float64(U + Float64(l * Float64(Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0)) * fma(K, Float64(K * -0.125), 1.0)))); else tmp = fma(J, Float64(l * fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U + N[(l * N[(N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(K * N[(K * -0.125), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;U + \ell \cdot \left(\left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right) \cdot \mathsf{fma}\left(K, K \cdot -0.125, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \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), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 84.2%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified88.5%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6459.5
Simplified59.5%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6494.5
Simplified94.5%
Taylor expanded in K around 0
+-commutativeN/A
lower-fma.f64N/A
Simplified89.7%
Final simplification81.8%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.04)
(+
U
(*
l
(* (* J (fma 0.3333333333333333 (* l l) 2.0)) (fma K (* K -0.125) 1.0))))
(fma
(* l (fma (* l l) (* (* l l) (* (* l l) 0.0003968253968253968)) 2.0))
J
U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.04) {
tmp = U + (l * ((J * fma(0.3333333333333333, (l * l), 2.0)) * fma(K, (K * -0.125), 1.0)));
} else {
tmp = fma((l * fma((l * l), ((l * l) * ((l * l) * 0.0003968253968253968)), 2.0)), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.04) tmp = Float64(U + Float64(l * Float64(Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0)) * fma(K, Float64(K * -0.125), 1.0)))); else tmp = fma(Float64(l * fma(Float64(l * l), Float64(Float64(l * l) * Float64(Float64(l * l) * 0.0003968253968253968)), 2.0)), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U + N[(l * N[(N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(K * N[(K * -0.125), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;U + \ell \cdot \left(\left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right) \cdot \mathsf{fma}\left(K, K \cdot -0.125, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \left(\ell \cdot \ell\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right), 2\right), J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008Initial program 84.2%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified88.5%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6459.5
Simplified59.5%
if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6494.5
Simplified94.5%
Taylor expanded in K around 0
+-commutativeN/A
lower-fma.f64N/A
Simplified89.7%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr89.7%
Taylor expanded in l around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6489.7
Simplified89.7%
Final simplification81.8%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.05)
(+
U
(*
l
(* (* J (fma 0.3333333333333333 (* l l) 2.0)) (fma K (* K -0.125) 1.0))))
(fma
J
(*
l
(fma l (* l (fma l (* l 0.016666666666666666) 0.3333333333333333)) 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 * ((J * fma(0.3333333333333333, (l * l), 2.0)) * fma(K, (K * -0.125), 1.0)));
} else {
tmp = fma(J, (l * fma(l, (l * fma(l, (l * 0.016666666666666666), 0.3333333333333333)), 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(l * Float64(Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0)) * fma(K, Float64(K * -0.125), 1.0)))); else tmp = fma(J, Float64(l * fma(l, Float64(l * fma(l, Float64(l * 0.016666666666666666), 0.3333333333333333)), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.05], N[(U + N[(l * N[(N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(K * N[(K * -0.125), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(J * N[(l * N[(l * N[(l * N[(l * N[(l * 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.05:\\
\;\;\;\;U + \ell \cdot \left(\left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right) \cdot \mathsf{fma}\left(K, K \cdot -0.125, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.016666666666666666, 0.3333333333333333\right), 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.050000000000000003Initial program 84.0%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified89.8%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6460.4
Simplified60.4%
if -0.050000000000000003 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6494.5
Simplified94.5%
Taylor expanded in K around 0
+-commutativeN/A
lower-fma.f64N/A
Simplified89.2%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.8
Simplified85.8%
Final simplification79.2%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.05)
(fma J (* l 2.0) (fma J (* (* K (* K l)) -0.25) U))
(fma
J
(*
l
(fma l (* l (fma l (* l 0.016666666666666666) 0.3333333333333333)) 2.0))
U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.05) {
tmp = fma(J, (l * 2.0), fma(J, ((K * (K * l)) * -0.25), U));
} else {
tmp = fma(J, (l * fma(l, (l * fma(l, (l * 0.016666666666666666), 0.3333333333333333)), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.05) tmp = fma(J, Float64(l * 2.0), fma(J, Float64(Float64(K * Float64(K * l)) * -0.25), U)); else tmp = fma(J, Float64(l * fma(l, Float64(l * fma(l, Float64(l * 0.016666666666666666), 0.3333333333333333)), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.05], N[(J * N[(l * 2.0), $MachinePrecision] + N[(J * N[(N[(K * N[(K * l), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision] + U), $MachinePrecision]), $MachinePrecision], N[(J * N[(l * N[(l * N[(l * N[(l * N[(l * 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, \mathsf{fma}\left(J, \left(K \cdot \left(K \cdot \ell\right)\right) \cdot -0.25, U\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.016666666666666666, 0.3333333333333333\right), 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.050000000000000003Initial program 84.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.1
Simplified55.1%
Taylor expanded in K around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Simplified51.8%
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.8
Applied egg-rr51.8%
if -0.050000000000000003 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6494.5
Simplified94.5%
Taylor expanded in K around 0
+-commutativeN/A
lower-fma.f64N/A
Simplified89.2%
Taylor expanded in l around 0
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.8
Simplified85.8%
Final simplification77.0%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.05) (fma J (* l 2.0) (fma J (* (* K (* K l)) -0.25) U)) (fma J (* l (fma 0.3333333333333333 (* l l) 2.0)) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.05) {
tmp = fma(J, (l * 2.0), fma(J, ((K * (K * l)) * -0.25), U));
} else {
tmp = fma(J, (l * fma(0.3333333333333333, (l * l), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.05) tmp = fma(J, Float64(l * 2.0), fma(J, Float64(Float64(K * Float64(K * l)) * -0.25), U)); else tmp = fma(J, Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.05], N[(J * N[(l * 2.0), $MachinePrecision] + N[(J * N[(N[(K * N[(K * l), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision] + U), $MachinePrecision]), $MachinePrecision], N[(J * N[(l * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, \mathsf{fma}\left(J, \left(K \cdot \left(K \cdot \ell\right)\right) \cdot -0.25, U\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.050000000000000003Initial program 84.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.1
Simplified55.1%
Taylor expanded in K around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Simplified51.8%
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.8
Applied egg-rr51.8%
if -0.050000000000000003 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified78.9%
Taylor expanded in K around 0
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.2
Simplified78.2%
Final simplification71.4%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.05) (fma J (fma l 2.0 (* l (* (* K K) -0.25))) U) (fma J (* l (fma 0.3333333333333333 (* l l) 2.0)) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.05) {
tmp = fma(J, fma(l, 2.0, (l * ((K * K) * -0.25))), U);
} else {
tmp = fma(J, (l * fma(0.3333333333333333, (l * l), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.05) tmp = fma(J, fma(l, 2.0, Float64(l * Float64(Float64(K * K) * -0.25))), U); else tmp = fma(J, Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.05], N[(J * N[(l * 2.0 + N[(l * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.05:\\
\;\;\;\;\mathsf{fma}\left(J, \mathsf{fma}\left(\ell, 2, \ell \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.050000000000000003Initial program 84.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.1
Simplified55.1%
Taylor expanded in K around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Simplified51.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lift-*.f64N/A
lower-fma.f6451.8
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6451.8
Applied egg-rr51.8%
if -0.050000000000000003 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.1%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified78.9%
Taylor expanded in K around 0
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.2
Simplified78.2%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (fma (* J (sinh l)) 2.0 U)))
(if (<= l -3.9)
t_0
(if (<= l 2.55e-23)
(fma (cos (* K 0.5)) (* J (* l 2.0)) U)
(if (<= l 7e+104)
t_0
(*
J
(*
(fma -0.125 (* K K) 1.0)
(* l (fma l (* l 0.3333333333333333) 2.0)))))))))
double code(double J, double l, double K, double U) {
double t_0 = fma((J * sinh(l)), 2.0, U);
double tmp;
if (l <= -3.9) {
tmp = t_0;
} else if (l <= 2.55e-23) {
tmp = fma(cos((K * 0.5)), (J * (l * 2.0)), U);
} else if (l <= 7e+104) {
tmp = t_0;
} else {
tmp = J * (fma(-0.125, (K * K), 1.0) * (l * fma(l, (l * 0.3333333333333333), 2.0)));
}
return tmp;
}
function code(J, l, K, U) t_0 = fma(Float64(J * sinh(l)), 2.0, U) tmp = 0.0 if (l <= -3.9) tmp = t_0; elseif (l <= 2.55e-23) tmp = fma(cos(Float64(K * 0.5)), Float64(J * Float64(l * 2.0)), U); elseif (l <= 7e+104) tmp = t_0; else tmp = Float64(J * Float64(fma(-0.125, Float64(K * K), 1.0) * Float64(l * fma(l, Float64(l * 0.3333333333333333), 2.0)))); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * 2.0 + U), $MachinePrecision]}, If[LessEqual[l, -3.9], t$95$0, If[LessEqual[l, 2.55e-23], N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[l, 7e+104], t$95$0, N[(J * N[(N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision] * N[(l * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(J \cdot \sinh \ell, 2, U\right)\\
\mathbf{if}\;\ell \leq -3.9:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 2.55 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(\ell \cdot 2\right), U\right)\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+104}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(\mathsf{fma}\left(-0.125, K \cdot K, 1\right) \cdot \left(\ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)\right)\right)\\
\end{array}
\end{array}
if l < -3.89999999999999991 or 2.55000000000000005e-23 < l < 7.0000000000000003e104Initial program 100.0%
lift-exp.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied egg-rr100.0%
Taylor expanded in K around 0
Simplified80.6%
if -3.89999999999999991 < l < 2.55000000000000005e-23Initial program 73.3%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Simplified99.9%
if 7.0000000000000003e104 < l Initial program 100.0%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified86.1%
Taylor expanded in U around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified90.7%
Taylor expanded in K around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
distribute-lft-outN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Simplified4.9%
Taylor expanded in U around 0
lower-*.f64N/A
associate-*r*N/A
distribute-lft1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6482.9
Simplified82.9%
Final simplification89.8%
(FPCore (J l K U)
:precision binary64
(if (<= l -4e+37)
(* J (fma l 2.0 (/ U J)))
(if (<= l 5.2e+34)
(fma J (* l 2.0) U)
(* l (* J (fma (* K K) -0.25 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -4e+37) {
tmp = J * fma(l, 2.0, (U / J));
} else if (l <= 5.2e+34) {
tmp = fma(J, (l * 2.0), U);
} else {
tmp = l * (J * fma((K * K), -0.25, 2.0));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -4e+37) tmp = Float64(J * fma(l, 2.0, Float64(U / J))); elseif (l <= 5.2e+34) tmp = fma(J, Float64(l * 2.0), U); else tmp = Float64(l * Float64(J * fma(Float64(K * K), -0.25, 2.0))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -4e+37], N[(J * N[(l * 2.0 + N[(U / J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.2e+34], N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision], N[(l * N[(J * N[(N[(K * K), $MachinePrecision] * -0.25 + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4 \cdot 10^{+37}:\\
\;\;\;\;J \cdot \mathsf{fma}\left(\ell, 2, \frac{U}{J}\right)\\
\mathbf{elif}\;\ell \leq 5.2 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, U\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(J \cdot \mathsf{fma}\left(K \cdot K, -0.25, 2\right)\right)\\
\end{array}
\end{array}
if l < -3.99999999999999982e37Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.1
Simplified25.1%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6423.2
Simplified23.2%
Taylor expanded in J around inf
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6436.5
Simplified36.5%
if -3.99999999999999982e37 < l < 5.19999999999999995e34Initial program 76.9%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6490.1
Simplified90.1%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6475.4
Simplified75.4%
if 5.19999999999999995e34 < l Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6427.9
Simplified27.9%
Taylor expanded in K around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Simplified40.1%
Taylor expanded in J around inf
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6440.4
Simplified40.4%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* l (* J (fma (* K K) -0.25 2.0))))) (if (<= l -950.0) t_0 (if (<= l 5.2e+34) (fma J (* l 2.0) U) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = l * (J * fma((K * K), -0.25, 2.0));
double tmp;
if (l <= -950.0) {
tmp = t_0;
} else if (l <= 5.2e+34) {
tmp = fma(J, (l * 2.0), U);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(l * Float64(J * fma(Float64(K * K), -0.25, 2.0))) tmp = 0.0 if (l <= -950.0) tmp = t_0; elseif (l <= 5.2e+34) tmp = fma(J, Float64(l * 2.0), U); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(l * N[(J * N[(N[(K * K), $MachinePrecision] * -0.25 + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -950.0], t$95$0, If[LessEqual[l, 5.2e+34], N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(J \cdot \mathsf{fma}\left(K \cdot K, -0.25, 2\right)\right)\\
\mathbf{if}\;\ell \leq -950:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 5.2 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot 2, U\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -950 or 5.19999999999999995e34 < l Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.7
Simplified25.7%
Taylor expanded in K around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Simplified32.9%
Taylor expanded in J around inf
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6434.8
Simplified34.8%
if -950 < l < 5.19999999999999995e34Initial program 76.1%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.7
Simplified92.7%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6477.7
Simplified77.7%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* l 2.0)))) (if (<= l -1.35e+38) t_0 (if (<= l 74.0) U t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (l * 2.0);
double tmp;
if (l <= -1.35e+38) {
tmp = t_0;
} else if (l <= 74.0) {
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 = j * (l * 2.0d0)
if (l <= (-1.35d+38)) then
tmp = t_0
else if (l <= 74.0d0) 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 = J * (l * 2.0);
double tmp;
if (l <= -1.35e+38) {
tmp = t_0;
} else if (l <= 74.0) {
tmp = U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (l * 2.0) tmp = 0 if l <= -1.35e+38: tmp = t_0 elif l <= 74.0: tmp = U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(l * 2.0)) tmp = 0.0 if (l <= -1.35e+38) tmp = t_0; elseif (l <= 74.0) tmp = U; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (l * 2.0); tmp = 0.0; if (l <= -1.35e+38) tmp = t_0; elseif (l <= 74.0) tmp = U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.35e+38], t$95$0, If[LessEqual[l, 74.0], U, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(\ell \cdot 2\right)\\
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{+38}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 74:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.34999999999999998e38 or 74 < l Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.2
Simplified25.2%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6423.7
Simplified23.7%
Taylor expanded in J around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.4
Simplified23.4%
if -1.34999999999999998e38 < l < 74Initial program 75.4%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6495.3
Simplified95.3%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6479.8
Simplified79.8%
Taylor expanded in U around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.0
Simplified79.0%
Taylor expanded in U around inf
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
Final simplification46.9%
(FPCore (J l K U) :precision binary64 (fma J (* l (fma 0.3333333333333333 (* l l) 2.0)) U))
double code(double J, double l, double K, double U) {
return fma(J, (l * fma(0.3333333333333333, (l * l), 2.0)), U);
}
function code(J, l, K, U) return fma(J, Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0)), U) end
code[J_, l_, K_, U_] := N[(J * N[(l * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right), U\right)
\end{array}
Initial program 87.8%
Taylor expanded in l around 0
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Simplified81.7%
Taylor expanded in K around 0
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6467.1
Simplified67.1%
(FPCore (J l K U) :precision binary64 (fma J (* l 2.0) U))
double code(double J, double l, double K, double U) {
return fma(J, (l * 2.0), U);
}
function code(J, l, K, U) return fma(J, Float64(l * 2.0), U) end
code[J_, l_, K_, U_] := N[(J * N[(l * 2.0), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(J, \ell \cdot 2, U\right)
\end{array}
Initial program 87.8%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.0
Simplified60.0%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6451.5
Simplified51.5%
(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.8%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.0
Simplified60.0%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6451.5
Simplified51.5%
Taylor expanded in U around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.5
Simplified58.5%
Taylor expanded in U around inf
mul-1-negN/A
lower-neg.f6436.4
Simplified36.4%
Final simplification36.4%
herbie shell --seed 2024208
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))