
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ (sin k) l)))
(*
t_s
(if (<= t_m 18000.0)
(/ 2.0 (* (* t_2 k) (* (tan k) (/ (* k t_m) l))))
(/ 2.0 (* (* (/ k l) (* (* t_2 (tan k)) t_m)) k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = sin(k) / l;
double tmp;
if (t_m <= 18000.0) {
tmp = 2.0 / ((t_2 * k) * (tan(k) * ((k * t_m) / l)));
} else {
tmp = 2.0 / (((k / l) * ((t_2 * tan(k)) * t_m)) * k);
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = sin(k) / l
if (t_m <= 18000.0d0) then
tmp = 2.0d0 / ((t_2 * k) * (tan(k) * ((k * t_m) / l)))
else
tmp = 2.0d0 / (((k / l) * ((t_2 * tan(k)) * t_m)) * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = Math.sin(k) / l;
double tmp;
if (t_m <= 18000.0) {
tmp = 2.0 / ((t_2 * k) * (Math.tan(k) * ((k * t_m) / l)));
} else {
tmp = 2.0 / (((k / l) * ((t_2 * Math.tan(k)) * t_m)) * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = math.sin(k) / l tmp = 0 if t_m <= 18000.0: tmp = 2.0 / ((t_2 * k) * (math.tan(k) * ((k * t_m) / l))) else: tmp = 2.0 / (((k / l) * ((t_2 * math.tan(k)) * t_m)) * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(sin(k) / l) tmp = 0.0 if (t_m <= 18000.0) tmp = Float64(2.0 / Float64(Float64(t_2 * k) * Float64(tan(k) * Float64(Float64(k * t_m) / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(Float64(t_2 * tan(k)) * t_m)) * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) t_2 = sin(k) / l; tmp = 0.0; if (t_m <= 18000.0) tmp = 2.0 / ((t_2 * k) * (tan(k) * ((k * t_m) / l))); else tmp = 2.0 / (((k / l) * ((t_2 * tan(k)) * t_m)) * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 18000.0], N[(2.0 / N[(N[(t$95$2 * k), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(N[(t$95$2 * N[Tan[k], $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{\sin k}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 18000:\\
\;\;\;\;\frac{2}{\left(t\_2 \cdot k\right) \cdot \left(\tan k \cdot \frac{k \cdot t\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot \left(\left(t\_2 \cdot \tan k\right) \cdot t\_m\right)\right) \cdot k}\\
\end{array}
\end{array}
\end{array}
if t < 18000Initial program 39.1%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.7
Applied rewrites73.7%
Applied rewrites84.6%
Applied rewrites95.4%
Applied rewrites97.8%
if 18000 < t Initial program 25.9%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6467.4
Applied rewrites67.4%
Applied rewrites72.1%
Applied rewrites90.0%
Applied rewrites99.6%
Final simplification98.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 4.4e-6)
(/ 2.0 (* (* (/ (* k k) l) (/ (* k t_m) l)) k))
(if (<= k 7.5e+113)
(*
(/
(* (* (cos k) 2.0) l)
(* (- 0.5 (* (cos (+ k k)) 0.5)) (* (* k k) t_m)))
l)
(/ 2.0 (* (* (/ (* (sin k) (tan k)) (* l l)) k) (* k t_m)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 4.4e-6) {
tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k);
} else if (k <= 7.5e+113) {
tmp = (((cos(k) * 2.0) * l) / ((0.5 - (cos((k + k)) * 0.5)) * ((k * k) * t_m))) * l;
} else {
tmp = 2.0 / ((((sin(k) * tan(k)) / (l * l)) * k) * (k * t_m));
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.4d-6) then
tmp = 2.0d0 / ((((k * k) / l) * ((k * t_m) / l)) * k)
else if (k <= 7.5d+113) then
tmp = (((cos(k) * 2.0d0) * l) / ((0.5d0 - (cos((k + k)) * 0.5d0)) * ((k * k) * t_m))) * l
else
tmp = 2.0d0 / ((((sin(k) * tan(k)) / (l * l)) * k) * (k * t_m))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 4.4e-6) {
tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k);
} else if (k <= 7.5e+113) {
tmp = (((Math.cos(k) * 2.0) * l) / ((0.5 - (Math.cos((k + k)) * 0.5)) * ((k * k) * t_m))) * l;
} else {
tmp = 2.0 / ((((Math.sin(k) * Math.tan(k)) / (l * l)) * k) * (k * t_m));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 4.4e-6: tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k) elif k <= 7.5e+113: tmp = (((math.cos(k) * 2.0) * l) / ((0.5 - (math.cos((k + k)) * 0.5)) * ((k * k) * t_m))) * l else: tmp = 2.0 / ((((math.sin(k) * math.tan(k)) / (l * l)) * k) * (k * t_m)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 4.4e-6) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l) * Float64(Float64(k * t_m) / l)) * k)); elseif (k <= 7.5e+113) tmp = Float64(Float64(Float64(Float64(cos(k) * 2.0) * l) / Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * Float64(Float64(k * k) * t_m))) * l); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) * tan(k)) / Float64(l * l)) * k) * Float64(k * t_m))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 4.4e-6) tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k); elseif (k <= 7.5e+113) tmp = (((cos(k) * 2.0) * l) / ((0.5 - (cos((k + k)) * 0.5)) * ((k * k) * t_m))) * l; else tmp = 2.0 / ((((sin(k) * tan(k)) / (l * l)) * k) * (k * t_m)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 4.4e-6], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 7.5e+113], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * 2.0), $MachinePrecision] * l), $MachinePrecision] / N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 4.4 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(\frac{k \cdot k}{\ell} \cdot \frac{k \cdot t\_m}{\ell}\right) \cdot k}\\
\mathbf{elif}\;k \leq 7.5 \cdot 10^{+113}:\\
\;\;\;\;\frac{\left(\cos k \cdot 2\right) \cdot \ell}{\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot \left(\left(k \cdot k\right) \cdot t\_m\right)} \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\sin k \cdot \tan k}{\ell \cdot \ell} \cdot k\right) \cdot \left(k \cdot t\_m\right)}\\
\end{array}
\end{array}
if k < 4.4000000000000002e-6Initial program 39.7%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.6
Applied rewrites70.6%
Applied rewrites76.6%
Applied rewrites93.1%
Taylor expanded in k around 0
Applied rewrites76.5%
if 4.4000000000000002e-6 < k < 7.5000000000000001e113Initial program 12.4%
Taylor expanded in t around 0
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.1%
Applied rewrites94.9%
if 7.5000000000000001e113 < k Initial program 32.7%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.8
Applied rewrites78.8%
Applied rewrites89.7%
Final simplification80.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ (* k k) l)))
(*
t_s
(if (<= (* l l) 0.0)
(/ 2.0 (* (* t_2 t_2) t_m))
(/ 2.0 (* (* (* (/ (tan k) (* l l)) (sin k)) (* k t_m)) k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = (k * k) / l;
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / ((t_2 * t_2) * t_m);
} else {
tmp = 2.0 / ((((tan(k) / (l * l)) * sin(k)) * (k * t_m)) * k);
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = (k * k) / l
if ((l * l) <= 0.0d0) then
tmp = 2.0d0 / ((t_2 * t_2) * t_m)
else
tmp = 2.0d0 / ((((tan(k) / (l * l)) * sin(k)) * (k * t_m)) * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = (k * k) / l;
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / ((t_2 * t_2) * t_m);
} else {
tmp = 2.0 / ((((Math.tan(k) / (l * l)) * Math.sin(k)) * (k * t_m)) * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = (k * k) / l tmp = 0 if (l * l) <= 0.0: tmp = 2.0 / ((t_2 * t_2) * t_m) else: tmp = 2.0 / ((((math.tan(k) / (l * l)) * math.sin(k)) * (k * t_m)) * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(Float64(k * k) / l) tmp = 0.0 if (Float64(l * l) <= 0.0) tmp = Float64(2.0 / Float64(Float64(t_2 * t_2) * t_m)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) / Float64(l * l)) * sin(k)) * Float64(k * t_m)) * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) t_2 = (k * k) / l; tmp = 0.0; if ((l * l) <= 0.0) tmp = 2.0 / ((t_2 * t_2) * t_m); else tmp = 2.0 / ((((tan(k) / (l * l)) * sin(k)) * (k * t_m)) * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 0.0], N[(2.0 / N[(N[(t$95$2 * t$95$2), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{k \cdot k}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{2}{\left(t\_2 \cdot t\_2\right) \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{\tan k}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(k \cdot t\_m\right)\right) \cdot k}\\
\end{array}
\end{array}
\end{array}
if (*.f64 l l) < 0.0Initial program 15.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites29.5%
Taylor expanded in k around 0
lower-/.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6453.7
Applied rewrites53.7%
Applied rewrites86.3%
if 0.0 < (*.f64 l l) Initial program 43.4%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.7
Applied rewrites78.7%
Applied rewrites86.5%
Applied rewrites87.0%
Final simplification86.8%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 4e-20)
(/
2.0
(*
(*
(*
(fma
(/ (* k k) l)
(fma (* 0.08611111111111111 k) k 0.16666666666666666)
(/ 1.0 l))
(* k k))
(/ (* k t_m) l))
k))
(/ 2.0 (* (* (/ (* (sin k) (tan k)) (* l l)) k) (* k t_m))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 4e-20) {
tmp = 2.0 / (((fma(((k * k) / l), fma((0.08611111111111111 * k), k, 0.16666666666666666), (1.0 / l)) * (k * k)) * ((k * t_m) / l)) * k);
} else {
tmp = 2.0 / ((((sin(k) * tan(k)) / (l * l)) * k) * (k * t_m));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 4e-20) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(Float64(k * k) / l), fma(Float64(0.08611111111111111 * k), k, 0.16666666666666666), Float64(1.0 / l)) * Float64(k * k)) * Float64(Float64(k * t_m) / l)) * k)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) * tan(k)) / Float64(l * l)) * k) * Float64(k * t_m))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 4e-20], N[(2.0 / N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(0.08611111111111111 * k), $MachinePrecision] * k + 0.16666666666666666), $MachinePrecision] + N[(1.0 / l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 4 \cdot 10^{-20}:\\
\;\;\;\;\frac{2}{\left(\left(\mathsf{fma}\left(\frac{k \cdot k}{\ell}, \mathsf{fma}\left(0.08611111111111111 \cdot k, k, 0.16666666666666666\right), \frac{1}{\ell}\right) \cdot \left(k \cdot k\right)\right) \cdot \frac{k \cdot t\_m}{\ell}\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\sin k \cdot \tan k}{\ell \cdot \ell} \cdot k\right) \cdot \left(k \cdot t\_m\right)}\\
\end{array}
\end{array}
if k < 3.99999999999999978e-20Initial program 39.8%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.1
Applied rewrites70.1%
Applied rewrites76.3%
Applied rewrites93.0%
Taylor expanded in k around 0
Applied rewrites76.1%
if 3.99999999999999978e-20 < k Initial program 25.1%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.8
Applied rewrites78.8%
Applied rewrites85.1%
Final simplification78.3%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ 2.0 (* (* (/ k l) (* (* (/ (sin k) l) (tan k)) t_m)) k))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / (((k / l) * (((sin(k) / l) * tan(k)) * t_m)) * k));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (2.0d0 / (((k / l) * (((sin(k) / l) * tan(k)) * t_m)) * k))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / (((k / l) * (((Math.sin(k) / l) * Math.tan(k)) * t_m)) * k));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 / (((k / l) * (((math.sin(k) / l) * math.tan(k)) * t_m)) * k))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(Float64(Float64(sin(k) / l) * tan(k)) * t_m)) * k))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 / (((k / l) * (((sin(k) / l) * tan(k)) * t_m)) * k)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{2}{\left(\frac{k}{\ell} \cdot \left(\left(\frac{\sin k}{\ell} \cdot \tan k\right) \cdot t\_m\right)\right) \cdot k}
\end{array}
Initial program 36.1%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
Applied rewrites78.1%
Applied rewrites92.8%
Applied rewrites93.9%
Final simplification93.9%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ 2.0 (* (* (* (/ (tan k) l) (* k t_m)) (/ (sin k) l)) k))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / ((((tan(k) / l) * (k * t_m)) * (sin(k) / l)) * k));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (2.0d0 / ((((tan(k) / l) * (k * t_m)) * (sin(k) / l)) * k))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / ((((Math.tan(k) / l) * (k * t_m)) * (Math.sin(k) / l)) * k));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 / ((((math.tan(k) / l) * (k * t_m)) * (math.sin(k) / l)) * k))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) / l) * Float64(k * t_m)) * Float64(sin(k) / l)) * k))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 / ((((tan(k) / l) * (k * t_m)) * (sin(k) / l)) * k)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{2}{\left(\left(\frac{\tan k}{\ell} \cdot \left(k \cdot t\_m\right)\right) \cdot \frac{\sin k}{\ell}\right) \cdot k}
\end{array}
Initial program 36.1%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
Applied rewrites78.1%
Applied rewrites93.2%
Final simplification93.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= l 3.8e+260)
(/ 2.0 (* (* (/ (* k k) l) (/ (* k t_m) l)) k))
(*
(/ (* l l) (* (- 0.5 (* (cos (+ k k)) 0.5)) (* k t_m)))
(/ (- 2.0 (* k k)) k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 3.8e+260) {
tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k);
} else {
tmp = ((l * l) / ((0.5 - (cos((k + k)) * 0.5)) * (k * t_m))) * ((2.0 - (k * k)) / k);
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 3.8d+260) then
tmp = 2.0d0 / ((((k * k) / l) * ((k * t_m) / l)) * k)
else
tmp = ((l * l) / ((0.5d0 - (cos((k + k)) * 0.5d0)) * (k * t_m))) * ((2.0d0 - (k * k)) / k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 3.8e+260) {
tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k);
} else {
tmp = ((l * l) / ((0.5 - (Math.cos((k + k)) * 0.5)) * (k * t_m))) * ((2.0 - (k * k)) / k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if l <= 3.8e+260: tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k) else: tmp = ((l * l) / ((0.5 - (math.cos((k + k)) * 0.5)) * (k * t_m))) * ((2.0 - (k * k)) / k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (l <= 3.8e+260) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l) * Float64(Float64(k * t_m) / l)) * k)); else tmp = Float64(Float64(Float64(l * l) / Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * Float64(k * t_m))) * Float64(Float64(2.0 - Float64(k * k)) / k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (l <= 3.8e+260) tmp = 2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k); else tmp = ((l * l) / ((0.5 - (cos((k + k)) * 0.5)) * (k * t_m))) * ((2.0 - (k * k)) / k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[l, 3.8e+260], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 - N[(k * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 3.8 \cdot 10^{+260}:\\
\;\;\;\;\frac{2}{\left(\frac{k \cdot k}{\ell} \cdot \frac{k \cdot t\_m}{\ell}\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot \left(k \cdot t\_m\right)} \cdot \frac{2 - k \cdot k}{k}\\
\end{array}
\end{array}
if l < 3.7999999999999997e260Initial program 36.4%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites78.1%
Applied rewrites93.1%
Taylor expanded in k around 0
Applied rewrites72.6%
if 3.7999999999999997e260 < l Initial program 20.0%
Taylor expanded in t around 0
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.0%
Applied rewrites80.0%
Taylor expanded in k around 0
Applied rewrites60.0%
Final simplification72.4%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ 2.0 (* (* (/ (* k k) l) (/ (* k t_m) l)) k))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (2.0d0 / ((((k * k) / l) * ((k * t_m) / l)) * k))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l) * Float64(Float64(k * t_m) / l)) * k))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 / ((((k * k) / l) * ((k * t_m) / l)) * k)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{2}{\left(\frac{k \cdot k}{\ell} \cdot \frac{k \cdot t\_m}{\ell}\right) \cdot k}
\end{array}
Initial program 36.1%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
Applied rewrites78.1%
Applied rewrites92.8%
Taylor expanded in k around 0
Applied rewrites71.6%
Final simplification71.6%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (/ (* l 2.0) (* (* k k) t_m)) (/ l (* k k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (((l * 2.0) / ((k * k) * t_m)) * (l / (k * k)));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (((l * 2.0d0) / ((k * k) * t_m)) * (l / (k * k)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (((l * 2.0) / ((k * k) * t_m)) * (l / (k * k)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (((l * 2.0) / ((k * k) * t_m)) * (l / (k * k)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(l * 2.0) / Float64(Float64(k * k) * t_m)) * Float64(l / Float64(k * k)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (((l * 2.0) / ((k * k) * t_m)) * (l / (k * k))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(l * 2.0), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\frac{\ell \cdot 2}{\left(k \cdot k\right) \cdot t\_m} \cdot \frac{\ell}{k \cdot k}\right)
\end{array}
Initial program 36.1%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
Applied rewrites71.4%
Final simplification71.4%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (* (/ (/ l (* k t_m)) (* (* k k) k)) 2.0) l)))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((((l / (k * t_m)) / ((k * k) * k)) * 2.0) * l);
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((((l / (k * t_m)) / ((k * k) * k)) * 2.0d0) * l)
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((((l / (k * t_m)) / ((k * k) * k)) * 2.0) * l);
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((((l / (k * t_m)) / ((k * k) * k)) * 2.0) * l)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(Float64(l / Float64(k * t_m)) / Float64(Float64(k * k) * k)) * 2.0) * l)) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((((l / (k * t_m)) / ((k * k) * k)) * 2.0) * l); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\left(\frac{\frac{\ell}{k \cdot t\_m}}{\left(k \cdot k\right) \cdot k} \cdot 2\right) \cdot \ell\right)
\end{array}
Initial program 36.1%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
Applied rewrites69.3%
Taylor expanded in l around 0
Applied rewrites68.1%
Applied rewrites70.5%
Final simplification70.5%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (* (/ 2.0 (* (* (* k k) (* k t_m)) k)) l) l)))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (((2.0 / (((k * k) * (k * t_m)) * k)) * l) * l);
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (((2.0d0 / (((k * k) * (k * t_m)) * k)) * l) * l)
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (((2.0 / (((k * k) * (k * t_m)) * k)) * l) * l);
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (((2.0 / (((k * k) * (k * t_m)) * k)) * l) * l)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(2.0 / Float64(Float64(Float64(k * k) * Float64(k * t_m)) * k)) * l) * l)) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (((2.0 / (((k * k) * (k * t_m)) * k)) * l) * l); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\left(\frac{2}{\left(\left(k \cdot k\right) \cdot \left(k \cdot t\_m\right)\right) \cdot k} \cdot \ell\right) \cdot \ell\right)
\end{array}
Initial program 36.1%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
Applied rewrites69.3%
Applied rewrites69.4%
Final simplification69.4%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (* (/ 2.0 (* (* (* (* k k) k) t_m) k)) l) l)))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (((2.0 / ((((k * k) * k) * t_m) * k)) * l) * l);
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (((2.0d0 / ((((k * k) * k) * t_m) * k)) * l) * l)
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (((2.0 / ((((k * k) * k) * t_m) * k)) * l) * l);
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (((2.0 / ((((k * k) * k) * t_m) * k)) * l) * l)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * k) * t_m) * k)) * l) * l)) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (((2.0 / ((((k * k) * k) * t_m) * k)) * l) * l); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision] * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\left(\frac{2}{\left(\left(\left(k \cdot k\right) \cdot k\right) \cdot t\_m\right) \cdot k} \cdot \ell\right) \cdot \ell\right)
\end{array}
Initial program 36.1%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
Applied rewrites69.3%
Final simplification69.3%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (/ l (* (* (* k k) (* k k)) t_m)) (+ l l))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / (((k * k) * (k * k)) * t_m)) * (l + l));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l / (((k * k) * (k * k)) * t_m)) * (l + l))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / (((k * k) * (k * k)) * t_m)) * (l + l));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l / (((k * k) * (k * k)) * t_m)) * (l + l))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l / Float64(Float64(Float64(k * k) * Float64(k * k)) * t_m)) * Float64(l + l))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l / (((k * k) * (k * k)) * t_m)) * (l + l)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l / N[(N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\frac{\ell}{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t\_m} \cdot \left(\ell + \ell\right)\right)
\end{array}
Initial program 36.1%
Taylor expanded in t around 0
associate-*r*N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
Applied rewrites84.2%
Applied rewrites93.4%
Taylor expanded in k around 0
associate-*r/N/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.1
Applied rewrites68.1%
Final simplification68.1%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (/ l (* (* k k) t_m)) (* -0.3333333333333333 l))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / ((k * k) * t_m)) * (-0.3333333333333333 * l));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l / ((k * k) * t_m)) * ((-0.3333333333333333d0) * l))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / ((k * k) * t_m)) * (-0.3333333333333333 * l));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l / ((k * k) * t_m)) * (-0.3333333333333333 * l))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l / Float64(Float64(k * k) * t_m)) * Float64(-0.3333333333333333 * l))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l / ((k * k) * t_m)) * (-0.3333333333333333 * l)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\frac{\ell}{\left(k \cdot k\right) \cdot t\_m} \cdot \left(-0.3333333333333333 \cdot \ell\right)\right)
\end{array}
Initial program 36.1%
Taylor expanded in k around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in k around inf
Applied rewrites32.0%
Final simplification32.0%
herbie shell --seed 2024235
(FPCore (t l k)
:name "Toniolo and Linder, Equation (10-)"
:precision binary64
(/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))