
(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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
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 15 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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
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}
(FPCore (t l k) :precision binary64 (* (* (/ 2.0 (* (pow (sin k) 2.0) t)) (* l (/ (cos k) k))) (/ l k)))
double code(double t, double l, double k) {
return ((2.0 / (pow(sin(k), 2.0) * t)) * (l * (cos(k) / k))) * (l / k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((2.0d0 / ((sin(k) ** 2.0d0) * t)) * (l * (cos(k) / k))) * (l / k)
end function
public static double code(double t, double l, double k) {
return ((2.0 / (Math.pow(Math.sin(k), 2.0) * t)) * (l * (Math.cos(k) / k))) * (l / k);
}
def code(t, l, k): return ((2.0 / (math.pow(math.sin(k), 2.0) * t)) * (l * (math.cos(k) / k))) * (l / k)
function code(t, l, k) return Float64(Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(l * Float64(cos(k) / k))) * Float64(l / k)) end
function tmp = code(t, l, k) tmp = ((2.0 / ((sin(k) ^ 2.0) * t)) * (l * (cos(k) / k))) * (l / k); end
code[t_, l_, k_] := N[(N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l * N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{2}{{\sin k}^{2} \cdot t} \cdot \left(\ell \cdot \frac{\cos k}{k}\right)\right) \cdot \frac{\ell}{k}
\end{array}
Initial program 32.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites95.5%
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-cos.f6495.5
Applied rewrites95.5%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (cos k) l)))
(if (<= k 0.32)
(* (* (/ t_1 (* (* k k) t)) (/ l (pow (sin k) 2.0))) 2.0)
(* (* (/ 2.0 (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)) (/ t_1 k)) (/ l k)))))
double code(double t, double l, double k) {
double t_1 = cos(k) * l;
double tmp;
if (k <= 0.32) {
tmp = ((t_1 / ((k * k) * t)) * (l / pow(sin(k), 2.0))) * 2.0;
} else {
tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = cos(k) * l
if (k <= 0.32d0) then
tmp = ((t_1 / ((k * k) * t)) * (l / (sin(k) ** 2.0d0))) * 2.0d0
else
tmp = ((2.0d0 / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t)) * (t_1 / k)) * (l / k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.cos(k) * l;
double tmp;
if (k <= 0.32) {
tmp = ((t_1 / ((k * k) * t)) * (l / Math.pow(Math.sin(k), 2.0))) * 2.0;
} else {
tmp = ((2.0 / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k);
}
return tmp;
}
def code(t, l, k): t_1 = math.cos(k) * l tmp = 0 if k <= 0.32: tmp = ((t_1 / ((k * k) * t)) * (l / math.pow(math.sin(k), 2.0))) * 2.0 else: tmp = ((2.0 / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k) return tmp
function code(t, l, k) t_1 = Float64(cos(k) * l) tmp = 0.0 if (k <= 0.32) tmp = Float64(Float64(Float64(t_1 / Float64(Float64(k * k) * t)) * Float64(l / (sin(k) ^ 2.0))) * 2.0); else tmp = Float64(Float64(Float64(2.0 / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t)) * Float64(t_1 / k)) * Float64(l / k)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = cos(k) * l; tmp = 0.0; if (k <= 0.32) tmp = ((t_1 / ((k * k) * t)) * (l / (sin(k) ^ 2.0))) * 2.0; else tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k, 0.32], N[(N[(N[(t$95$1 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(2.0 / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos k \cdot \ell\\
\mathbf{if}\;k \leq 0.32:\\
\;\;\;\;\left(\frac{t\_1}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell}{{\sin k}^{2}}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t} \cdot \frac{t\_1}{k}\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 0.320000000000000007Initial program 34.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.6
Applied rewrites73.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites86.2%
if 0.320000000000000007 < k Initial program 27.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6470.5
Applied rewrites70.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites89.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (cos k) l)))
(if (<= k 4.9e-5)
(*
(* (/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k)) (/ t_1 k))
(/ l k))
(if (<= k 1.3e+154)
(* (/ 2.0 (* k k)) (* t_1 (/ l (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t))))
(* (* (/ 2.0 (* (pow (sin k) 2.0) t)) (/ l k)) (/ l k))))))
double code(double t, double l, double k) {
double t_1 = cos(k) * l;
double tmp;
if (k <= 4.9e-5) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * (t_1 / k)) * (l / k);
} else if (k <= 1.3e+154) {
tmp = (2.0 / (k * k)) * (t_1 * (l / ((0.5 - (0.5 * cos((2.0 * k)))) * t)));
} else {
tmp = ((2.0 / (pow(sin(k), 2.0) * t)) * (l / k)) * (l / k);
}
return tmp;
}
function code(t, l, k) t_1 = Float64(cos(k) * l) tmp = 0.0 if (k <= 4.9e-5) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(t_1 / k)) * Float64(l / k)); elseif (k <= 1.3e+154) tmp = Float64(Float64(2.0 / Float64(k * k)) * Float64(t_1 * Float64(l / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t)))); else tmp = Float64(Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(l / k)) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k, 4.9e-5], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.3e+154], N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(l / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos k \cdot \ell\\
\mathbf{if}\;k \leq 4.9 \cdot 10^{-5}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{t\_1}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{elif}\;k \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;\frac{2}{k \cdot k} \cdot \left(t\_1 \cdot \frac{\ell}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{{\sin k}^{2} \cdot t} \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 4.9e-5Initial program 34.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.6
Applied rewrites73.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.2%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6471.8
Applied rewrites71.8%
if 4.9e-5 < k < 1.29999999999999994e154Initial program 17.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6483.1
Applied rewrites83.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites86.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6491.4
Applied rewrites91.4%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6491.4
Applied rewrites91.4%
if 1.29999999999999994e154 < k Initial program 39.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6456.2
Applied rewrites56.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.4%
Taylor expanded in k around 0
Applied rewrites70.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (* (cos k) l) k)))
(if (<= k 4.9e-5)
(* (* (/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k)) t_1) (/ l k))
(* (* (/ 2.0 (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)) t_1) (/ l k)))))
double code(double t, double l, double k) {
double t_1 = (cos(k) * l) / k;
double tmp;
if (k <= 4.9e-5) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * t_1) * (l / k);
} else {
tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * t_1) * (l / k);
}
return tmp;
}
function code(t, l, k) t_1 = Float64(Float64(cos(k) * l) / k) tmp = 0.0 if (k <= 4.9e-5) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * t_1) * Float64(l / k)); else tmp = Float64(Float64(Float64(2.0 / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t)) * t_1) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]}, If[LessEqual[k, 4.9e-5], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\cos k \cdot \ell}{k}\\
\mathbf{if}\;k \leq 4.9 \cdot 10^{-5}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot t\_1\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t} \cdot t\_1\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 4.9e-5Initial program 34.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.6
Applied rewrites73.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.2%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6471.8
Applied rewrites71.8%
if 4.9e-5 < k Initial program 27.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6470.5
Applied rewrites70.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites89.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
(FPCore (t l k)
:precision binary64
(if (<= k 1.5e+83)
(*
(*
(/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k))
(/ (* (cos k) l) k))
(/ l k))
(* (* (/ 2.0 (* (pow (sin k) 2.0) t)) (/ l k)) (/ l k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e+83) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * ((cos(k) * l) / k)) * (l / k);
} else {
tmp = ((2.0 / (pow(sin(k), 2.0) * t)) * (l / k)) * (l / k);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.5e+83) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)); else tmp = Float64(Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(l / k)) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.5e+83], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{+83}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{{\sin k}^{2} \cdot t} \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 1.5e83Initial program 32.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.9
Applied rewrites74.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites89.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.7%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6470.1
Applied rewrites70.1%
if 1.5e83 < k Initial program 33.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites91.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.4%
Taylor expanded in k around 0
Applied rewrites68.6%
(FPCore (t l k)
:precision binary64
(if (<= k 1.5e+83)
(*
(*
(/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k))
(/ (* (cos k) l) k))
(/ l k))
(* (/ 2.0 (* k k)) (* l (/ l (* (pow (sin k) 2.0) t))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.5e+83) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * ((cos(k) * l) / k)) * (l / k);
} else {
tmp = (2.0 / (k * k)) * (l * (l / (pow(sin(k), 2.0) * t)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.5e+83) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)); else tmp = Float64(Float64(2.0 / Float64(k * k)) * Float64(l * Float64(l / Float64((sin(k) ^ 2.0) * t)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.5e+83], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.5 \cdot 10^{+83}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot k} \cdot \left(\ell \cdot \frac{\ell}{{\sin k}^{2} \cdot t}\right)\\
\end{array}
\end{array}
if k < 1.5e83Initial program 32.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.9
Applied rewrites74.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites89.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.7%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6470.1
Applied rewrites70.1%
if 1.5e83 < k Initial program 33.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites65.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6470.1
Applied rewrites70.1%
Taylor expanded in k around 0
Applied rewrites63.3%
(FPCore (t l k)
:precision binary64
(if (<= k 4.7e+98)
(*
(*
(/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k))
(/ (* (cos k) l) k))
(/ l k))
(* (* (/ l (* (pow k 3.0) t)) 2.0) (/ l k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.7e+98) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * ((cos(k) * l) / k)) * (l / k);
} else {
tmp = ((l / (pow(k, 3.0) * t)) * 2.0) * (l / k);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 4.7e+98) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)); else tmp = Float64(Float64(Float64(l / Float64((k ^ 3.0) * t)) * 2.0) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 4.7e+98], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[(N[Power[k, 3.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.7 \cdot 10^{+98}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{{k}^{3} \cdot t} \cdot 2\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 4.6999999999999997e98Initial program 32.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6475.1
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites89.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.7%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6469.6
Applied rewrites69.6%
if 4.6999999999999997e98 < k Initial program 32.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6461.7
Applied rewrites61.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites93.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.4%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f6464.9
Applied rewrites64.9%
(FPCore (t l k)
:precision binary64
(if (<= k 2e+111)
(*
(/ 2.0 (* k k))
(*
(* (cos k) l)
(/ (/ (fma 0.3333333333333333 (* (* k k) l) l) t) (* k k))))
(* (* (/ l (* (pow k 3.0) t)) 2.0) (/ l k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 2e+111) {
tmp = (2.0 / (k * k)) * ((cos(k) * l) * ((fma(0.3333333333333333, ((k * k) * l), l) / t) / (k * k)));
} else {
tmp = ((l / (pow(k, 3.0) * t)) * 2.0) * (l / k);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 2e+111) tmp = Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(cos(k) * l) * Float64(Float64(fma(0.3333333333333333, Float64(Float64(k * k) * l), l) / t) / Float64(k * k)))); else tmp = Float64(Float64(Float64(l / Float64((k ^ 3.0) * t)) * 2.0) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 2e+111], N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * N[(N[(N[(0.3333333333333333 * N[(N[(k * k), $MachinePrecision] * l), $MachinePrecision] + l), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[(N[Power[k, 3.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2 \cdot 10^{+111}:\\
\;\;\;\;\frac{2}{k \cdot k} \cdot \left(\left(\cos k \cdot \ell\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{t}}{k \cdot k}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{{k}^{3} \cdot t} \cdot 2\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 1.99999999999999991e111Initial program 32.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.9
Applied rewrites74.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites77.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6487.8
Applied rewrites87.8%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6468.4
Applied rewrites68.4%
if 1.99999999999999991e111 < k Initial program 34.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6462.1
Applied rewrites62.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites92.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f6465.5
Applied rewrites65.5%
(FPCore (t l k) :precision binary64 (if (<= t 1.25e+224) (* (/ 2.0 (* k k)) (* (/ l (* k k)) (/ l t))) (* (/ 2.0 (* (* k k) t)) (* (/ l k) (/ l k)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 1.25e+224) {
tmp = (2.0 / (k * k)) * ((l / (k * k)) * (l / t));
} else {
tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 1.25d+224) then
tmp = (2.0d0 / (k * k)) * ((l / (k * k)) * (l / t))
else
tmp = (2.0d0 / ((k * k) * t)) * ((l / k) * (l / k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 1.25e+224) {
tmp = (2.0 / (k * k)) * ((l / (k * k)) * (l / t));
} else {
tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 1.25e+224: tmp = (2.0 / (k * k)) * ((l / (k * k)) * (l / t)) else: tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 1.25e+224) tmp = Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(l / Float64(k * k)) * Float64(l / t))); else tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l / k) * Float64(l / k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 1.25e+224) tmp = (2.0 / (k * k)) * ((l / (k * k)) * (l / t)); else tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 1.25e+224], N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+224}:\\
\;\;\;\;\frac{2}{k \cdot k} \cdot \left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\
\end{array}
\end{array}
if t < 1.24999999999999991e224Initial program 35.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.4
Applied rewrites74.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites76.0%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6476.5
Applied rewrites76.5%
if 1.24999999999999991e224 < t Initial program 4.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6455.6
Applied rewrites55.6%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6460.3
Applied rewrites60.3%
Final simplification75.1%
(FPCore (t l k) :precision binary64 (if (<= t 3.4e-171) (/ (* (* (/ l t) l) 2.0) (* (* k k) (* k k))) (* (/ 2.0 (* k k)) (/ (* l l) (* (* k k) t)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 3.4e-171) {
tmp = (((l / t) * l) * 2.0) / ((k * k) * (k * k));
} else {
tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 3.4d-171) then
tmp = (((l / t) * l) * 2.0d0) / ((k * k) * (k * k))
else
tmp = (2.0d0 / (k * k)) * ((l * l) / ((k * k) * t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 3.4e-171) {
tmp = (((l / t) * l) * 2.0) / ((k * k) * (k * k));
} else {
tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 3.4e-171: tmp = (((l / t) * l) * 2.0) / ((k * k) * (k * k)) else: tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 3.4e-171) tmp = Float64(Float64(Float64(Float64(l / t) * l) * 2.0) / Float64(Float64(k * k) * Float64(k * k))); else tmp = Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(l * l) / Float64(Float64(k * k) * t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 3.4e-171) tmp = (((l / t) * l) * 2.0) / ((k * k) * (k * k)); else tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 3.4e-171], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.4 \cdot 10^{-171}:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot 2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot k} \cdot \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot t}\\
\end{array}
\end{array}
if t < 3.39999999999999985e-171Initial program 37.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites23.9%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6423.9
Applied rewrites23.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6473.9
Applied rewrites73.9%
if 3.39999999999999985e-171 < t Initial program 25.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6466.7
Applied rewrites66.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites71.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6479.6
Applied rewrites79.6%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6459.6
Applied rewrites59.6%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k k)) (* (/ l (* k k)) (/ l t))))
double code(double t, double l, double k) {
return (2.0 / (k * k)) * ((l / (k * k)) * (l / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 / (k * k)) * ((l / (k * k)) * (l / t))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * k)) * ((l / (k * k)) * (l / t));
}
def code(t, l, k): return (2.0 / (k * k)) * ((l / (k * k)) * (l / t))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(l / Float64(k * k)) * Float64(l / t))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * k)) * ((l / (k * k)) * (l / t)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot k} \cdot \left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{t}\right)
\end{array}
Initial program 32.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites74.6%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
Final simplification73.2%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k k)) (/ (* l l) (* (* k k) t))))
double code(double t, double l, double k) {
return (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 / (k * k)) * ((l * l) / ((k * k) * t))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
def code(t, l, k): return (2.0 / (k * k)) * ((l * l) / ((k * k) * t))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(l * l) / Float64(Float64(k * k) * t))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot k} \cdot \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot t}
\end{array}
Initial program 32.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites74.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6484.5
Applied rewrites84.5%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6464.8
Applied rewrites64.8%
(FPCore (t l k) :precision binary64 (/ (* (* l l) -0.3333333333333333) (* (* k k) t)))
double code(double t, double l, double k) {
return ((l * l) * -0.3333333333333333) / ((k * k) * t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l * l) * (-0.3333333333333333d0)) / ((k * k) * t)
end function
public static double code(double t, double l, double k) {
return ((l * l) * -0.3333333333333333) / ((k * k) * t);
}
def code(t, l, k): return ((l * l) * -0.3333333333333333) / ((k * k) * t)
function code(t, l, k) return Float64(Float64(Float64(l * l) * -0.3333333333333333) / Float64(Float64(k * k) * t)) end
function tmp = code(t, l, k) tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t); end
code[t_, l_, k_] := N[(N[(N[(l * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\ell \cdot \ell\right) \cdot -0.3333333333333333}{\left(k \cdot k\right) \cdot t}
\end{array}
Initial program 32.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites50.2%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6428.9
Applied rewrites28.9%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (/ (* l l) t)))
double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * ((l * l) / t)
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
def code(t, l, k): return -0.11666666666666667 * ((l * l) / t)
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(Float64(l * l) / t)) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * ((l * l) / t); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t}
\end{array}
Initial program 32.5%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites25.7%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.6
Applied rewrites20.6%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (* l (/ l t))))
double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * (l * (l / t))
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
def code(t, l, k): return -0.11666666666666667 * (l * (l / t))
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(l * Float64(l / t))) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * (l * (l / t)); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)
\end{array}
Initial program 32.5%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites25.7%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.6
Applied rewrites20.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.3
Applied rewrites18.3%
herbie shell --seed 2025054
(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))))