
(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 (* (* 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 89.7%
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%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.9)
(+
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.9) {
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.9) 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(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.9], 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[(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.9:\\
\;\;\;\;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(2 \cdot \sinh \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.900000000000000022Initial program 86.8%
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-*.f6495.2
Simplified95.2%
if 0.900000000000000022 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 92.2%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6492.2
Simplified92.2%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6498.5
Applied egg-rr98.5%
Final simplification97.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))))
(if (<= t_0 0.866)
(+ U (* t_0 (* J (* l (fma l (* l 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.866) {
tmp = U + (t_0 * (J * (l * fma(l, (l * 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.866) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(l, Float64(l * 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.866], N[(U + N[(t$95$0 * N[(J * N[(l * N[(l * N[(l * 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.866:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 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.865999999999999992Initial program 87.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6494.9
Simplified94.9%
if 0.865999999999999992 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.8%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6491.8
Simplified91.8%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6498.0
Applied egg-rr98.0%
Final simplification96.6%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.866) (fma l (* (fma l (* l 0.3333333333333333) 2.0) (* J (cos (* K 0.5)))) U) (fma (* 2.0 (sinh l)) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.866) {
tmp = fma(l, (fma(l, (l * 0.3333333333333333), 2.0) * (J * cos((K * 0.5)))), U);
} else {
tmp = fma((2.0 * sinh(l)), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.866) tmp = fma(l, Float64(fma(l, Float64(l * 0.3333333333333333), 2.0) * Float64(J * cos(Float64(K * 0.5)))), U); else tmp = fma(Float64(2.0 * sinh(l)), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.866], N[(l * N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.866:\\
\;\;\;\;\mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right), U\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.865999999999999992Initial program 87.1%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified90.7%
if 0.865999999999999992 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 91.8%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6491.8
Simplified91.8%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6498.0
Applied egg-rr98.0%
Final simplification94.8%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* 2.0 (sinh l))))
(if (<= (cos (/ K 2.0)) -0.02)
(fma (* t_0 (fma -0.125 (* K K) 1.0)) J 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 (cos((K / 2.0)) <= -0.02) {
tmp = fma((t_0 * fma(-0.125, (K * K), 1.0)), J, 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 (cos(Float64(K / 2.0)) <= -0.02) tmp = fma(Float64(t_0 * fma(-0.125, Float64(K * K), 1.0)), J, 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[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.02], N[(N[(t$95$0 * N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(t$95$0 * J + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \sinh \ell\\
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.02:\\
\;\;\;\;\mathsf{fma}\left(t\_0 \cdot \mathsf{fma}\left(-0.125, K \cdot K, 1\right), J, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0200000000000000004Initial program 89.6%
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-*.f6471.8
Simplified71.8%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.5
Simplified89.5%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6494.8
Applied egg-rr94.8%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.02)
(fma
(fma -0.125 (* K K) 1.0)
(*
(fma l (* l (fma (* l l) 0.016666666666666666 0.3333333333333333)) 2.0)
(* l J))
U)
(fma (* 2.0 (sinh l)) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.02) {
tmp = fma(fma(-0.125, (K * K), 1.0), (fma(l, (l * fma((l * l), 0.016666666666666666, 0.3333333333333333)), 2.0) * (l * J)), U);
} else {
tmp = fma((2.0 * sinh(l)), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.02) tmp = fma(fma(-0.125, Float64(K * K), 1.0), Float64(fma(l, Float64(l * fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333)), 2.0) * Float64(l * J)), U); else tmp = fma(Float64(2.0 * sinh(l)), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.02], N[(N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.02:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, K \cdot K, 1\right), \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right) \cdot \left(\ell \cdot J\right), U\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.0200000000000000004Initial program 89.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-*.f6493.9
Simplified93.9%
Taylor expanded in K around 0
+-commutativeN/A
Simplified67.8%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.5
Simplified89.5%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6494.8
Applied egg-rr94.8%
Final simplification88.1%
(FPCore (J l K U)
:precision binary64
(if (<= (/ K 2.0) 1e-71)
(fma (* 2.0 (sinh l)) J U)
(+
U
(*
(*
J
(*
l
(fma
(* l l)
(fma
(* l l)
(fma (* l l) 0.0003968253968253968 0.016666666666666666)
0.3333333333333333)
2.0)))
(cos (/ K 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 1e-71) {
tmp = fma((2.0 * sinh(l)), J, U);
} else {
tmp = U + ((J * (l * fma((l * l), fma((l * l), fma((l * l), 0.0003968253968253968, 0.016666666666666666), 0.3333333333333333), 2.0))) * cos((K / 2.0)));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (Float64(K / 2.0) <= 1e-71) tmp = fma(Float64(2.0 * sinh(l)), J, U); else tmp = Float64(U + Float64(Float64(J * Float64(l * fma(Float64(l * l), fma(Float64(l * l), fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666), 0.3333333333333333), 2.0))) * cos(Float64(K / 2.0)))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 1e-71], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(U + N[(N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{K}{2} \leq 10^{-71}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
\mathbf{else}:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 9.9999999999999992e-72Initial program 90.0%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6478.1
Simplified78.1%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6483.3
Applied egg-rr83.3%
if 9.9999999999999992e-72 < (/.f64 K #s(literal 2 binary64)) Initial program 89.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-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-*.f6497.5
Simplified97.5%
Final simplification87.8%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.02)
(fma
(fma -0.125 (* K K) 1.0)
(*
(fma l (* l (fma (* l l) 0.016666666666666666 0.3333333333333333)) 2.0)
(* l J))
U)
(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.02) {
tmp = fma(fma(-0.125, (K * K), 1.0), (fma(l, (l * fma((l * l), 0.016666666666666666, 0.3333333333333333)), 2.0) * (l * J)), U);
} 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.02) tmp = fma(fma(-0.125, Float64(K * K), 1.0), Float64(fma(l, Float64(l * fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333)), 2.0) * Float64(l * J)), U); else tmp = fma(J, Float64(l * fma(Float64(l * l), fma(Float64(l * 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.02], N[(N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $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.02:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, K \cdot K, 1\right), \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right) \cdot \left(\ell \cdot J\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, \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.0200000000000000004Initial program 89.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-*.f6493.9
Simplified93.9%
Taylor expanded in K around 0
+-commutativeN/A
Simplified67.8%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.5
Simplified89.5%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-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-*.f6489.8
Simplified89.8%
Final simplification84.4%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.02)
(fma
(fma -0.125 (* K K) 1.0)
(* (fma l (* l 0.3333333333333333) 2.0) (* l J))
U)
(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.02) {
tmp = fma(fma(-0.125, (K * K), 1.0), (fma(l, (l * 0.3333333333333333), 2.0) * (l * J)), U);
} 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.02) tmp = fma(fma(-0.125, Float64(K * K), 1.0), Float64(fma(l, Float64(l * 0.3333333333333333), 2.0) * Float64(l * J)), U); else tmp = fma(J, Float64(l * fma(Float64(l * l), fma(Float64(l * 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.02], N[(N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $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.02:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, K \cdot K, 1\right), \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right) \cdot \left(\ell \cdot J\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, \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.0200000000000000004Initial program 89.6%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified87.8%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified66.3%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.5
Simplified89.5%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-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-*.f6489.8
Simplified89.8%
Final simplification84.0%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.02)
(fma
(fma -0.125 (* K K) 1.0)
(* (fma l (* l 0.3333333333333333) 2.0) (* l J))
U)
(fma
J
(* l (fma (* l l) (* (* l l) (* (* l l) 0.0003968253968253968)) 2.0))
U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.02) {
tmp = fma(fma(-0.125, (K * K), 1.0), (fma(l, (l * 0.3333333333333333), 2.0) * (l * J)), U);
} else {
tmp = fma(J, (l * fma((l * l), ((l * l) * ((l * l) * 0.0003968253968253968)), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.02) tmp = fma(fma(-0.125, Float64(K * K), 1.0), Float64(fma(l, Float64(l * 0.3333333333333333), 2.0) * Float64(l * J)), U); else tmp = fma(J, Float64(l * fma(Float64(l * l), Float64(Float64(l * l) * Float64(Float64(l * l) * 0.0003968253968253968)), 2.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.02], N[(N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * 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] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.02:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, K \cdot K, 1\right), \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right) \cdot \left(\ell \cdot J\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \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), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0200000000000000004Initial program 89.6%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified87.8%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified66.3%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.5
Simplified89.5%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-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-*.f6489.8
Simplified89.8%
Taylor expanded in l around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.8
Simplified89.8%
Final simplification84.0%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) -0.02)
(fma
(fma -0.125 (* K K) 1.0)
(* (fma l (* l 0.3333333333333333) 2.0) (* l J))
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.02) {
tmp = fma(fma(-0.125, (K * K), 1.0), (fma(l, (l * 0.3333333333333333), 2.0) * (l * J)), 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.02) tmp = fma(fma(-0.125, Float64(K * K), 1.0), Float64(fma(l, Float64(l * 0.3333333333333333), 2.0) * Float64(l * J)), U); else tmp = fma(J, Float64(l * fma(l, Float64(l * fma(Float64(l * 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.02], N[(N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 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.02:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, K \cdot K, 1\right), \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right) \cdot \left(\ell \cdot J\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0200000000000000004Initial program 89.6%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified87.8%
Taylor expanded in K around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified66.3%
if -0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.5
Simplified89.5%
Taylor expanded in l around 0
*-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-*.f6488.3
Simplified88.3%
Final simplification82.9%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) 0.02)
(fma
J
(*
l
(fma l (fma l (fma l 0.041666666666666664 0.16666666666666666) 0.5) 1.0))
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.02) {
tmp = fma(J, (l * fma(l, fma(l, fma(l, 0.041666666666666664, 0.16666666666666666), 0.5), 1.0)), 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.02) tmp = fma(J, Float64(l * fma(l, fma(l, fma(l, 0.041666666666666664, 0.16666666666666666), 0.5), 1.0)), U); else tmp = fma(J, Float64(l * fma(l, Float64(l * fma(Float64(l * 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.02], N[(J * N[(l * N[(l * N[(l * N[(l * 0.041666666666666664 + 0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 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.02:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), 1\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.0200000000000000004Initial program 88.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6427.5
Simplified27.5%
Taylor expanded in l around 0
Simplified27.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6456.7
Simplified56.7%
if 0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 90.1%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.9
Simplified89.9%
Taylor expanded in l around 0
*-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-*.f6488.6
Simplified88.6%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) 0.015)
(fma
J
(*
l
(fma l (fma l (fma l 0.041666666666666664 0.16666666666666666) 0.5) 1.0))
U)
(fma (fma l (* l (* (* l l) 0.016666666666666666)) 2.0) (* l J) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.015) {
tmp = fma(J, (l * fma(l, fma(l, fma(l, 0.041666666666666664, 0.16666666666666666), 0.5), 1.0)), U);
} else {
tmp = fma(fma(l, (l * ((l * l) * 0.016666666666666666)), 2.0), (l * J), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.015) tmp = fma(J, Float64(l * fma(l, fma(l, fma(l, 0.041666666666666664, 0.16666666666666666), 0.5), 1.0)), U); else tmp = fma(fma(l, Float64(l * Float64(Float64(l * l) * 0.016666666666666666)), 2.0), Float64(l * J), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.015], N[(J * N[(l * N[(l * N[(l * N[(l * 0.041666666666666664 + 0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.015:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), 1\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right), 2\right), \ell \cdot J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.014999999999999999Initial program 88.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6427.5
Simplified27.5%
Taylor expanded in l around 0
Simplified27.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6456.7
Simplified56.7%
if 0.014999999999999999 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 90.1%
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-*.f6493.4
Simplified93.4%
Taylor expanded in K around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.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-*.f64N/A
*-lowering-*.f6487.6
Simplified87.6%
Taylor expanded in l around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6487.6
Simplified87.6%
Final simplification79.7%
(FPCore (J l K U)
:precision binary64
(if (<= (cos (/ K 2.0)) 0.015)
(fma
J
(*
l
(fma l (fma l (fma l 0.041666666666666664 0.16666666666666666) 0.5) 1.0))
U)
(fma J (* l (fma l (* l 0.3333333333333333) 2.0)) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.015) {
tmp = fma(J, (l * fma(l, fma(l, fma(l, 0.041666666666666664, 0.16666666666666666), 0.5), 1.0)), U);
} else {
tmp = fma(J, (l * fma(l, (l * 0.3333333333333333), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.015) tmp = fma(J, Float64(l * fma(l, fma(l, fma(l, 0.041666666666666664, 0.16666666666666666), 0.5), 1.0)), U); else tmp = fma(J, Float64(l * fma(l, Float64(l * 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.015], N[(J * N[(l * N[(l * N[(l * N[(l * 0.041666666666666664 + 0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(l * N[(l * 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.015:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), 1\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.014999999999999999Initial program 88.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6427.5
Simplified27.5%
Taylor expanded in l around 0
Simplified27.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6456.7
Simplified56.7%
if 0.014999999999999999 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 90.1%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.9
Simplified89.9%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6485.6
Simplified85.6%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.015) (fma J (* l (fma l 0.5 1.0)) U) (fma J (* l (fma l (* l 0.3333333333333333) 2.0)) U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.015) {
tmp = fma(J, (l * fma(l, 0.5, 1.0)), U);
} else {
tmp = fma(J, (l * fma(l, (l * 0.3333333333333333), 2.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.015) tmp = fma(J, Float64(l * fma(l, 0.5, 1.0)), U); else tmp = fma(J, Float64(l * fma(l, Float64(l * 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.015], N[(J * N[(l * N[(l * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(l * N[(l * 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.015:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, 0.5, 1\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.014999999999999999Initial program 88.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6427.5
Simplified27.5%
Taylor expanded in l around 0
Simplified27.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6453.7
Simplified53.7%
if 0.014999999999999999 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 90.1%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.9
Simplified89.9%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6485.6
Simplified85.6%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.015) (fma J (* l (fma l 0.5 1.0)) U) (fma (* l (* (* l l) 0.3333333333333333)) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.015) {
tmp = fma(J, (l * fma(l, 0.5, 1.0)), U);
} else {
tmp = fma((l * ((l * l) * 0.3333333333333333)), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.015) tmp = fma(J, Float64(l * fma(l, 0.5, 1.0)), U); else tmp = fma(Float64(l * Float64(Float64(l * l) * 0.3333333333333333)), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.015], N[(J * N[(l * N[(l * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.015:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, 0.5, 1\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right), J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.014999999999999999Initial program 88.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6427.5
Simplified27.5%
Taylor expanded in l around 0
Simplified27.8%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6453.7
Simplified53.7%
if 0.014999999999999999 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 90.1%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6489.9
Simplified89.9%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6495.1
Applied egg-rr95.1%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6485.6
Simplified85.6%
Taylor expanded in l around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6480.2
Simplified80.2%
Final simplification73.4%
(FPCore (J l K U) :precision binary64 (if (<= (/ K 2.0) 2.4e-168) (fma J (* 2.0 l) U) (fma J (* l (fma l 0.5 1.0)) U)))
double code(double J, double l, double K, double U) {
double tmp;
if ((K / 2.0) <= 2.4e-168) {
tmp = fma(J, (2.0 * l), U);
} else {
tmp = fma(J, (l * fma(l, 0.5, 1.0)), U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (Float64(K / 2.0) <= 2.4e-168) tmp = fma(J, Float64(2.0 * l), U); else tmp = fma(J, Float64(l * fma(l, 0.5, 1.0)), U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 2.4e-168], N[(J * N[(2.0 * l), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(l * N[(l * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{K}{2} \leq 2.4 \cdot 10^{-168}:\\
\;\;\;\;\mathsf{fma}\left(J, 2 \cdot \ell, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J, \ell \cdot \mathsf{fma}\left(\ell, 0.5, 1\right), U\right)\\
\end{array}
\end{array}
if (/.f64 K #s(literal 2 binary64)) < 2.3999999999999999e-168Initial program 90.5%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6477.3
Simplified77.3%
Taylor expanded in l around 0
*-lowering-*.f6452.2
Simplified52.2%
if 2.3999999999999999e-168 < (/.f64 K #s(literal 2 binary64)) Initial program 88.3%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6468.0
Simplified68.0%
Taylor expanded in l around 0
Simplified52.2%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6459.2
Simplified59.2%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* J (* l (fma 0.3333333333333333 (* l l) 2.0))))) (if (<= l -32000000000.0) t_0 (if (<= l 1.8e+20) (fma J (* 2.0 l) U) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = J * (l * fma(0.3333333333333333, (l * l), 2.0));
double tmp;
if (l <= -32000000000.0) {
tmp = t_0;
} else if (l <= 1.8e+20) {
tmp = fma(J, (2.0 * l), U);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(J * Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0))) tmp = 0.0 if (l <= -32000000000.0) tmp = t_0; elseif (l <= 1.8e+20) tmp = fma(J, Float64(2.0 * l), U); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(l * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -32000000000.0], t$95$0, If[LessEqual[l, 1.8e+20], N[(J * N[(2.0 * l), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(\ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right)\\
\mathbf{if}\;\ell \leq -32000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.8 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(J, 2 \cdot \ell, U\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -3.2e10 or 1.8e20 < l Initial program 100.0%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6470.9
Simplified70.9%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6470.9
Applied egg-rr70.9%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6461.1
Simplified61.1%
Taylor expanded in J around inf
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6461.2
Simplified61.2%
if -3.2e10 < l < 1.8e20Initial program 79.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6476.7
Simplified76.7%
Taylor expanded in l around 0
*-lowering-*.f6480.2
Simplified80.2%
Final simplification70.7%
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* 0.3333333333333333 (* l (* J (* l l)))))) (if (<= l -5500000000.0) t_0 (if (<= l 2.85e+20) (fma J (* 2.0 l) U) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = 0.3333333333333333 * (l * (J * (l * l)));
double tmp;
if (l <= -5500000000.0) {
tmp = t_0;
} else if (l <= 2.85e+20) {
tmp = fma(J, (2.0 * l), U);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64(0.3333333333333333 * Float64(l * Float64(J * Float64(l * l)))) tmp = 0.0 if (l <= -5500000000.0) tmp = t_0; elseif (l <= 2.85e+20) tmp = fma(J, Float64(2.0 * l), U); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(l * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5500000000.0], t$95$0, If[LessEqual[l, 2.85e+20], N[(J * N[(2.0 * l), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right)\\
\mathbf{if}\;\ell \leq -5500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 2.85 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(J, 2 \cdot \ell, U\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -5.5e9 or 2.85e20 < l Initial program 100.0%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6470.9
Simplified70.9%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub0-negN/A
sinh-undefN/A
*-lowering-*.f64N/A
sinh-lowering-sinh.f6470.9
Applied egg-rr70.9%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6461.1
Simplified61.1%
Taylor expanded in l around inf
*-lowering-*.f64N/A
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.7
Simplified56.7%
if -5.5e9 < l < 2.85e20Initial program 79.6%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6476.7
Simplified76.7%
Taylor expanded in l around 0
*-lowering-*.f6480.2
Simplified80.2%
Final simplification68.5%
(FPCore (J l K U) :precision binary64 (if (<= l -5500000000.0) (* l J) (if (<= l 9e+19) U (* l J))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -5500000000.0) {
tmp = l * J;
} else if (l <= 9e+19) {
tmp = U;
} else {
tmp = l * J;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-5500000000.0d0)) then
tmp = l * j
else if (l <= 9d+19) then
tmp = u
else
tmp = l * j
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -5500000000.0) {
tmp = l * J;
} else if (l <= 9e+19) {
tmp = U;
} else {
tmp = l * J;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -5500000000.0: tmp = l * J elif l <= 9e+19: tmp = U else: tmp = l * J return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -5500000000.0) tmp = Float64(l * J); elseif (l <= 9e+19) tmp = U; else tmp = Float64(l * J); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -5500000000.0) tmp = l * J; elseif (l <= 9e+19) tmp = U; else tmp = l * J; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -5500000000.0], N[(l * J), $MachinePrecision], If[LessEqual[l, 9e+19], U, N[(l * J), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5500000000:\\
\;\;\;\;\ell \cdot J\\
\mathbf{elif}\;\ell \leq 9 \cdot 10^{+19}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot J\\
\end{array}
\end{array}
if l < -5.5e9 or 9e19 < l Initial program 100.0%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6470.9
Simplified70.9%
Taylor expanded in l around 0
Simplified38.6%
Taylor expanded in l around 0
Simplified22.1%
Taylor expanded in J around inf
*-commutativeN/A
*-lowering-*.f6422.1
Simplified22.1%
if -5.5e9 < l < 9e19Initial program 79.6%
Taylor expanded in J around 0
Simplified72.1%
(FPCore (J l K U) :precision binary64 (fma J (* 2.0 l) U))
double code(double J, double l, double K, double U) {
return fma(J, (2.0 * l), U);
}
function code(J, l, K, U) return fma(J, Float64(2.0 * l), U) end
code[J_, l_, K_, U_] := N[(J * N[(2.0 * l), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(J, 2 \cdot \ell, U\right)
\end{array}
Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6473.8
Simplified73.8%
Taylor expanded in l around 0
*-lowering-*.f6451.4
Simplified51.4%
(FPCore (J l K U) :precision binary64 (fma J l U))
double code(double J, double l, double K, double U) {
return fma(J, l, U);
}
function code(J, l, K, U) return fma(J, l, U) end
code[J_, l_, K_, U_] := N[(J * l + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(J, \ell, U\right)
\end{array}
Initial program 89.7%
Taylor expanded in K around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
neg-mul-1N/A
--lowering--.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6473.8
Simplified73.8%
Taylor expanded in l around 0
Simplified57.0%
Taylor expanded in l around 0
Simplified48.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 89.7%
Taylor expanded in J around 0
Simplified37.4%
herbie shell --seed 2024198
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))