
(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 18 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 (* (* (sinh l) J) 2.0) (cos (* K -0.5)) U))
double code(double J, double l, double K, double U) {
return fma(((sinh(l) * J) * 2.0), cos((K * -0.5)), U);
}
function code(J, l, K, U) return fma(Float64(Float64(sinh(l) * J) * 2.0), cos(Float64(K * -0.5)), U) end
code[J_, l_, K_, U_] := N[(N[(N[(N[Sinh[l], $MachinePrecision] * J), $MachinePrecision] * 2.0), $MachinePrecision] * N[Cos[N[(K * -0.5), $MachinePrecision]], $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(\sinh \ell \cdot J\right) \cdot 2, \cos \left(K \cdot -0.5\right), U\right)
\end{array}
Initial program 83.8%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6483.8
Applied rewrites100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (* 0.5 K))))
(if (<= (* J (- (exp l) (exp (- l)))) 5e+70)
(fma (* t_0 (* J (fma (* 0.3333333333333333 l) l 2.0))) l U)
(* (* (* (fma (* l l) 0.3333333333333333 2.0) l) J) t_0))))
double code(double J, double l, double K, double U) {
double t_0 = cos((0.5 * K));
double tmp;
if ((J * (exp(l) - exp(-l))) <= 5e+70) {
tmp = fma((t_0 * (J * fma((0.3333333333333333 * l), l, 2.0))), l, U);
} else {
tmp = ((fma((l * l), 0.3333333333333333, 2.0) * l) * J) * t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(0.5 * K)) tmp = 0.0 if (Float64(J * Float64(exp(l) - exp(Float64(-l)))) <= 5e+70) tmp = fma(Float64(t_0 * Float64(J * fma(Float64(0.3333333333333333 * l), l, 2.0))), l, U); else tmp = Float64(Float64(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l) * J) * t_0); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+70], N[(N[(t$95$0 * N[(J * N[(N[(0.3333333333333333 * l), $MachinePrecision] * l + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l + U), $MachinePrecision], N[(N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(0.5 \cdot K\right)\\
\mathbf{if}\;J \cdot \left(e^{\ell} - e^{-\ell}\right) \leq 5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(t\_0 \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333 \cdot \ell, \ell, 2\right)\right), \ell, U\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell\right) \cdot J\right) \cdot t\_0\\
\end{array}
\end{array}
if (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) < 5.0000000000000002e70Initial program 78.7%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites90.8%
Applied rewrites90.8%
if 5.0000000000000002e70 < (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) Initial program 99.1%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites74.3%
Taylor expanded in J around inf
Applied rewrites81.9%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.02) (fma (* (cos (* 0.5 K)) (* J 2.0)) l U) (fma (/ (* (* (fma (* l l) 0.3333333333333333 2.0) l) J) U) U U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.02) {
tmp = fma((cos((0.5 * K)) * (J * 2.0)), l, U);
} else {
tmp = fma((((fma((l * l), 0.3333333333333333, 2.0) * l) * J) / U), U, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.02) tmp = fma(Float64(cos(Float64(0.5 * K)) * Float64(J * 2.0)), l, U); else tmp = fma(Float64(Float64(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l) * J) / U), U, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.02], N[(N[(N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision] * l + U), $MachinePrecision], N[(N[(N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J), $MachinePrecision] / U), $MachinePrecision] * U + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.02:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot 2\right), \ell, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell\right) \cdot J}{U}, U, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.0200000000000000004Initial program 80.3%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites90.8%
Taylor expanded in l around 0
Applied rewrites74.1%
if 0.0200000000000000004 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 85.1%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in K around 0
Applied rewrites64.2%
Taylor expanded in K around 0
Applied rewrites81.6%
Taylor expanded in U around inf
Applied rewrites85.9%
(FPCore (J l K U)
:precision binary64
(+
(*
(*
J
(*
(fma
(fma
(fma 0.0003968253968253968 (* l l) 0.016666666666666666)
(* l l)
0.3333333333333333)
(* l l)
2.0)
l))
(cos (* K 0.5)))
U))
double code(double J, double l, double K, double U) {
return ((J * (fma(fma(fma(0.0003968253968253968, (l * l), 0.016666666666666666), (l * l), 0.3333333333333333), (l * l), 2.0) * l)) * cos((K * 0.5))) + U;
}
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(fma(fma(fma(0.0003968253968253968, Float64(l * l), 0.016666666666666666), Float64(l * l), 0.3333333333333333), Float64(l * l), 2.0) * l)) * cos(Float64(K * 0.5))) + U) end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[(N[(N[(0.0003968253968253968 * N[(l * l), $MachinePrecision] + 0.016666666666666666), $MachinePrecision] * N[(l * l), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0003968253968253968, \ell \cdot \ell, 0.016666666666666666\right), \ell \cdot \ell, 0.3333333333333333\right), \ell \cdot \ell, 2\right) \cdot \ell\right)\right) \cdot \cos \left(K \cdot 0.5\right) + U
\end{array}
Initial program 83.8%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.3
Applied rewrites94.3%
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6494.3
Applied rewrites94.3%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.01) (fma (fma (* K K) -0.125 1.0) (* (* (* l l) (* l J)) 0.3333333333333333) U) (fma (/ (* (* (fma (* l l) 0.3333333333333333 2.0) l) J) U) U U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.01) {
tmp = fma(fma((K * K), -0.125, 1.0), (((l * l) * (l * J)) * 0.3333333333333333), U);
} else {
tmp = fma((((fma((l * l), 0.3333333333333333, 2.0) * l) * J) / U), U, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.01) tmp = fma(fma(Float64(K * K), -0.125, 1.0), Float64(Float64(Float64(l * l) * Float64(l * J)) * 0.3333333333333333), U); else tmp = fma(Float64(Float64(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l) * J) / U), U, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.01], N[(N[(N[(K * K), $MachinePrecision] * -0.125 + 1.0), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + U), $MachinePrecision], N[(N[(N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J), $MachinePrecision] / U), $MachinePrecision] * U + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(K \cdot K, -0.125, 1\right), \left(\left(\ell \cdot \ell\right) \cdot \left(\ell \cdot J\right)\right) \cdot 0.3333333333333333, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell\right) \cdot J}{U}, U, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0100000000000000002Initial program 81.4%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites90.7%
Taylor expanded in K around 0
Applied rewrites53.9%
Taylor expanded in l around inf
Applied rewrites63.4%
Applied rewrites63.6%
if -0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.7%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.3%
Taylor expanded in K around 0
Applied rewrites63.9%
Taylor expanded in K around 0
Applied rewrites81.3%
Taylor expanded in U around inf
Applied rewrites85.6%
(FPCore (J l K U)
:precision binary64
(+
(*
(*
J
(*
(fma
(fma (* 0.0003968253968253968 (* l l)) (* l l) 0.3333333333333333)
(* l l)
2.0)
l))
(cos (* K 0.5)))
U))
double code(double J, double l, double K, double U) {
return ((J * (fma(fma((0.0003968253968253968 * (l * l)), (l * l), 0.3333333333333333), (l * l), 2.0) * l)) * cos((K * 0.5))) + U;
}
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(fma(fma(Float64(0.0003968253968253968 * Float64(l * l)), Float64(l * l), 0.3333333333333333), Float64(l * l), 2.0) * l)) * cos(Float64(K * 0.5))) + U) end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[(N[(N[(0.0003968253968253968 * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(0.0003968253968253968 \cdot \left(\ell \cdot \ell\right), \ell \cdot \ell, 0.3333333333333333\right), \ell \cdot \ell, 2\right) \cdot \ell\right)\right) \cdot \cos \left(K \cdot 0.5\right) + U
\end{array}
Initial program 83.8%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.3
Applied rewrites94.3%
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6494.3
Applied rewrites94.3%
Taylor expanded in l around inf
Applied rewrites94.2%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.01) (fma (fma (* K K) -0.125 1.0) (* (* (* l l) (* l J)) 0.3333333333333333) U) (fma (* (fma (* l l) 0.3333333333333333 2.0) l) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.01) {
tmp = fma(fma((K * K), -0.125, 1.0), (((l * l) * (l * J)) * 0.3333333333333333), U);
} else {
tmp = fma((fma((l * l), 0.3333333333333333, 2.0) * l), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.01) tmp = fma(fma(Float64(K * K), -0.125, 1.0), Float64(Float64(Float64(l * l) * Float64(l * J)) * 0.3333333333333333), U); else tmp = fma(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.01], N[(N[(N[(K * K), $MachinePrecision] * -0.125 + 1.0), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + U), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(K \cdot K, -0.125, 1\right), \left(\left(\ell \cdot \ell\right) \cdot \left(\ell \cdot J\right)\right) \cdot 0.3333333333333333, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0100000000000000002Initial program 81.4%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites90.7%
Taylor expanded in K around 0
Applied rewrites53.9%
Taylor expanded in l around inf
Applied rewrites63.4%
Applied rewrites63.6%
if -0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.7%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.3%
Taylor expanded in K around 0
Applied rewrites84.3%
(FPCore (J l K U)
:precision binary64
(+
(*
(*
J
(*
(fma (fma 0.016666666666666666 (* l l) 0.3333333333333333) (* l l) 2.0)
l))
(cos (* K 0.5)))
U))
double code(double J, double l, double K, double U) {
return ((J * (fma(fma(0.016666666666666666, (l * l), 0.3333333333333333), (l * l), 2.0) * l)) * cos((K * 0.5))) + U;
}
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(fma(fma(0.016666666666666666, Float64(l * l), 0.3333333333333333), Float64(l * l), 2.0) * l)) * cos(Float64(K * 0.5))) + U) end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[(N[(0.016666666666666666 * N[(l * l), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(0.016666666666666666, \ell \cdot \ell, 0.3333333333333333\right), \ell \cdot \ell, 2\right) \cdot \ell\right)\right) \cdot \cos \left(K \cdot 0.5\right) + U
\end{array}
Initial program 83.8%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.3
Applied rewrites94.3%
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6494.3
Applied rewrites94.3%
Taylor expanded in l around 0
Applied rewrites92.4%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.01) (fma (* 2.0 (* (fma (* K K) -0.125 1.0) l)) J U) (fma (* (fma (* l l) 0.3333333333333333 2.0) l) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.01) {
tmp = fma((2.0 * (fma((K * K), -0.125, 1.0) * l)), J, U);
} else {
tmp = fma((fma((l * l), 0.3333333333333333, 2.0) * l), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.01) tmp = fma(Float64(2.0 * Float64(fma(Float64(K * K), -0.125, 1.0) * l)), J, U); else tmp = fma(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.01], N[(N[(2.0 * N[(N[(N[(K * K), $MachinePrecision] * -0.125 + 1.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \left(\mathsf{fma}\left(K \cdot K, -0.125, 1\right) \cdot \ell\right), J, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0100000000000000002Initial program 81.4%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites90.7%
Taylor expanded in K around 0
Applied rewrites53.9%
Taylor expanded in l around 0
Applied rewrites55.4%
if -0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.7%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.3%
Taylor expanded in K around 0
Applied rewrites84.3%
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (* 0.5 K))))
(if (or (<= l -12500000000.0) (not (<= l 3e-13)))
(* (* (* (fma (* l l) 0.3333333333333333 2.0) l) J) t_0)
(fma (* (* 2.0 l) J) t_0 U))))
double code(double J, double l, double K, double U) {
double t_0 = cos((0.5 * K));
double tmp;
if ((l <= -12500000000.0) || !(l <= 3e-13)) {
tmp = ((fma((l * l), 0.3333333333333333, 2.0) * l) * J) * t_0;
} else {
tmp = fma(((2.0 * l) * J), t_0, U);
}
return tmp;
}
function code(J, l, K, U) t_0 = cos(Float64(0.5 * K)) tmp = 0.0 if ((l <= -12500000000.0) || !(l <= 3e-13)) tmp = Float64(Float64(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l) * J) * t_0); else tmp = fma(Float64(Float64(2.0 * l) * J), t_0, U); end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(0.5 * K), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[l, -12500000000.0], N[Not[LessEqual[l, 3e-13]], $MachinePrecision]], N[(N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(2.0 * l), $MachinePrecision] * J), $MachinePrecision] * t$95$0 + U), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(0.5 \cdot K\right)\\
\mathbf{if}\;\ell \leq -12500000000 \lor \neg \left(\ell \leq 3 \cdot 10^{-13}\right):\\
\;\;\;\;\left(\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell\right) \cdot J\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(2 \cdot \ell\right) \cdot J, t\_0, U\right)\\
\end{array}
\end{array}
if l < -1.25e10 or 2.99999999999999984e-13 < l Initial program 99.2%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites74.4%
Taylor expanded in J around inf
Applied rewrites79.1%
if -1.25e10 < l < 2.99999999999999984e-13Initial program 68.9%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6498.6
Applied rewrites98.6%
Final simplification89.0%
(FPCore (J l K U) :precision binary64 (+ (* (* J (* (fma (* l l) 0.3333333333333333 2.0) l)) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (fma((l * l), 0.3333333333333333, 2.0) * l)) * cos((K / 2.0))) + U;
}
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l)) * cos(Float64(K / 2.0))) + U) end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Initial program 83.8%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6488.9
Applied rewrites88.9%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.01) (fma (* J l) (fma (* K K) -0.25 2.0) U) (fma (* (fma (* l l) 0.3333333333333333 2.0) l) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.01) {
tmp = fma((J * l), fma((K * K), -0.25, 2.0), U);
} else {
tmp = fma((fma((l * l), 0.3333333333333333, 2.0) * l), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.01) tmp = fma(Float64(J * l), fma(Float64(K * K), -0.25, 2.0), U); else tmp = fma(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.01], N[(N[(J * l), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25 + 2.0), $MachinePrecision] + U), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(J \cdot \ell, \mathsf{fma}\left(K \cdot K, -0.25, 2\right), U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0100000000000000002Initial program 81.4%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6473.7
Applied rewrites73.7%
Taylor expanded in K around 0
Applied rewrites53.9%
if -0.0100000000000000002 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 84.7%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.3%
Taylor expanded in K around 0
Applied rewrites84.3%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.98) (* (* (* (* K J) -0.25) l) K) (fma (* (fma (* l l) 0.3333333333333333 2.0) l) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.98) {
tmp = (((K * J) * -0.25) * l) * K;
} else {
tmp = fma((fma((l * l), 0.3333333333333333, 2.0) * l), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.98) tmp = Float64(Float64(Float64(Float64(K * J) * -0.25) * l) * K); else tmp = fma(Float64(fma(Float64(l * l), 0.3333333333333333, 2.0) * l), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.98], N[(N[(N[(N[(K * J), $MachinePrecision] * -0.25), $MachinePrecision] * l), $MachinePrecision] * K), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * l), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.98:\\
\;\;\;\;\left(\left(\left(K \cdot J\right) \cdot -0.25\right) \cdot \ell\right) \cdot K\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333, 2\right) \cdot \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.97999999999999998Initial program 85.6%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.5%
Taylor expanded in K around 0
Applied rewrites71.5%
Taylor expanded in K around inf
Applied rewrites52.0%
Taylor expanded in l around 0
Applied rewrites51.9%
if -0.97999999999999998 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 83.7%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites86.8%
Taylor expanded in K around 0
Applied rewrites75.6%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.98) (* (* (* (* K J) -0.25) l) K) (fma (* J (fma (* 0.3333333333333333 l) l 2.0)) l U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.98) {
tmp = (((K * J) * -0.25) * l) * K;
} else {
tmp = fma((J * fma((0.3333333333333333 * l), l, 2.0)), l, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.98) tmp = Float64(Float64(Float64(Float64(K * J) * -0.25) * l) * K); else tmp = fma(Float64(J * fma(Float64(0.3333333333333333 * l), l, 2.0)), l, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.98], N[(N[(N[(N[(K * J), $MachinePrecision] * -0.25), $MachinePrecision] * l), $MachinePrecision] * K), $MachinePrecision], N[(N[(J * N[(N[(0.3333333333333333 * l), $MachinePrecision] * l + 2.0), $MachinePrecision]), $MachinePrecision] * l + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.98:\\
\;\;\;\;\left(\left(\left(K \cdot J\right) \cdot -0.25\right) \cdot \ell\right) \cdot K\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(J \cdot \mathsf{fma}\left(0.3333333333333333 \cdot \ell, \ell, 2\right), \ell, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.97999999999999998Initial program 85.6%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.5%
Taylor expanded in K around 0
Applied rewrites71.5%
Taylor expanded in K around inf
Applied rewrites52.0%
Taylor expanded in l around 0
Applied rewrites51.9%
if -0.97999999999999998 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 83.7%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites86.8%
Taylor expanded in K around 0
Applied rewrites60.4%
Taylor expanded in K around 0
Applied rewrites73.2%
Applied rewrites73.2%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.98) (* (* (* (* K J) -0.25) l) K) (fma (* 2.0 l) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.98) {
tmp = (((K * J) * -0.25) * l) * K;
} else {
tmp = fma((2.0 * l), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.98) tmp = Float64(Float64(Float64(Float64(K * J) * -0.25) * l) * K); else tmp = fma(Float64(2.0 * l), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.98], N[(N[(N[(N[(K * J), $MachinePrecision] * -0.25), $MachinePrecision] * l), $MachinePrecision] * K), $MachinePrecision], N[(N[(2.0 * l), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.98:\\
\;\;\;\;\left(\left(\left(K \cdot J\right) \cdot -0.25\right) \cdot \ell\right) \cdot K\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.97999999999999998Initial program 85.6%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.5%
Taylor expanded in K around 0
Applied rewrites71.5%
Taylor expanded in K around inf
Applied rewrites52.0%
Taylor expanded in l around 0
Applied rewrites51.9%
if -0.97999999999999998 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 83.7%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in K around 0
Applied rewrites57.3%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.98) (* (* (* (* K K) J) -0.25) l) (fma (* 2.0 l) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.98) {
tmp = (((K * K) * J) * -0.25) * l;
} else {
tmp = fma((2.0 * l), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.98) tmp = Float64(Float64(Float64(Float64(K * K) * J) * -0.25) * l); else tmp = fma(Float64(2.0 * l), J, U); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.98], N[(N[(N[(N[(K * K), $MachinePrecision] * J), $MachinePrecision] * -0.25), $MachinePrecision] * l), $MachinePrecision], N[(N[(2.0 * l), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.98:\\
\;\;\;\;\left(\left(\left(K \cdot K\right) \cdot J\right) \cdot -0.25\right) \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \ell, J, U\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.97999999999999998Initial program 85.6%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.5%
Taylor expanded in K around 0
Applied rewrites71.5%
Taylor expanded in K around inf
Applied rewrites52.0%
Taylor expanded in l around 0
Applied rewrites51.9%
if -0.97999999999999998 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 83.7%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in K around 0
Applied rewrites57.3%
(FPCore (J l K U) :precision binary64 (if (or (<= l -15.6) (not (<= l 2.5e+17))) (fma (* (* (* l J) l) 0.3333333333333333) l U) (fma (* 2.0 l) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -15.6) || !(l <= 2.5e+17)) {
tmp = fma((((l * J) * l) * 0.3333333333333333), l, U);
} else {
tmp = fma((2.0 * l), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if ((l <= -15.6) || !(l <= 2.5e+17)) tmp = fma(Float64(Float64(Float64(l * J) * l) * 0.3333333333333333), l, U); else tmp = fma(Float64(2.0 * l), J, U); end return tmp end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -15.6], N[Not[LessEqual[l, 2.5e+17]], $MachinePrecision]], N[(N[(N[(N[(l * J), $MachinePrecision] * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * l + U), $MachinePrecision], N[(N[(2.0 * l), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -15.6 \lor \neg \left(\ell \leq 2.5 \cdot 10^{+17}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\ell \cdot J\right) \cdot \ell\right) \cdot 0.3333333333333333, \ell, U\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \ell, J, U\right)\\
\end{array}
\end{array}
if l < -15.5999999999999996 or 2.5e17 < l Initial program 100.0%
Taylor expanded in l around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites74.6%
Taylor expanded in K around 0
Applied rewrites57.5%
Taylor expanded in K around 0
Applied rewrites56.3%
Taylor expanded in l around inf
Applied rewrites56.3%
if -15.5999999999999996 < l < 2.5e17Initial program 69.3%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6496.8
Applied rewrites96.8%
Taylor expanded in K around 0
Applied rewrites81.4%
Final simplification69.6%
(FPCore (J l K U) :precision binary64 (fma (* 2.0 l) J U))
double code(double J, double l, double K, double U) {
return fma((2.0 * l), J, U);
}
function code(J, l, K, U) return fma(Float64(2.0 * l), J, U) end
code[J_, l_, K_, U_] := N[(N[(2.0 * l), $MachinePrecision] * J + U), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(2 \cdot \ell, J, U\right)
\end{array}
Initial program 83.8%
Taylor expanded in l around 0
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6467.5
Applied rewrites67.5%
Taylor expanded in K around 0
Applied rewrites55.2%
herbie shell --seed 2024302
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))