
(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]
\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)}
Herbie found 20 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]
\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)}
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (tan k) t)))
(if (<= (fabs l) 2e-101)
(/ 2.0 (* k (* k (* (/ t_1 (fabs l)) (/ (sin k) (fabs l))))))
(if (<= (fabs l) 2e+146)
(/ 2.0 (* (/ k (* (fabs l) (fabs l))) (* t_1 (* (sin k) k))))
(/
2.0
(* (* t (* (tan k) (sin k))) (/ (* (/ k (fabs l)) k) (fabs l))))))))double code(double t, double l, double k) {
double t_1 = tan(k) * t;
double tmp;
if (fabs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / fabs(l)) * (sin(k) / fabs(l)))));
} else if (fabs(l) <= 2e+146) {
tmp = 2.0 / ((k / (fabs(l) * fabs(l))) * (t_1 * (sin(k) * k)));
} else {
tmp = 2.0 / ((t * (tan(k) * sin(k))) * (((k / fabs(l)) * k) / fabs(l)));
}
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 = tan(k) * t
if (abs(l) <= 2d-101) then
tmp = 2.0d0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l)))))
else if (abs(l) <= 2d+146) then
tmp = 2.0d0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k)))
else
tmp = 2.0d0 / ((t * (tan(k) * sin(k))) * (((k / abs(l)) * k) / abs(l)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.tan(k) * t;
double tmp;
if (Math.abs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / Math.abs(l)) * (Math.sin(k) / Math.abs(l)))));
} else if (Math.abs(l) <= 2e+146) {
tmp = 2.0 / ((k / (Math.abs(l) * Math.abs(l))) * (t_1 * (Math.sin(k) * k)));
} else {
tmp = 2.0 / ((t * (Math.tan(k) * Math.sin(k))) * (((k / Math.abs(l)) * k) / Math.abs(l)));
}
return tmp;
}
def code(t, l, k): t_1 = math.tan(k) * t tmp = 0 if math.fabs(l) <= 2e-101: tmp = 2.0 / (k * (k * ((t_1 / math.fabs(l)) * (math.sin(k) / math.fabs(l))))) elif math.fabs(l) <= 2e+146: tmp = 2.0 / ((k / (math.fabs(l) * math.fabs(l))) * (t_1 * (math.sin(k) * k))) else: tmp = 2.0 / ((t * (math.tan(k) * math.sin(k))) * (((k / math.fabs(l)) * k) / math.fabs(l))) return tmp
function code(t, l, k) t_1 = Float64(tan(k) * t) tmp = 0.0 if (abs(l) <= 2e-101) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t_1 / abs(l)) * Float64(sin(k) / abs(l)))))); elseif (abs(l) <= 2e+146) tmp = Float64(2.0 / Float64(Float64(k / Float64(abs(l) * abs(l))) * Float64(t_1 * Float64(sin(k) * k)))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(tan(k) * sin(k))) * Float64(Float64(Float64(k / abs(l)) * k) / abs(l)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = tan(k) * t; tmp = 0.0; if (abs(l) <= 2e-101) tmp = 2.0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l))))); elseif (abs(l) <= 2e+146) tmp = 2.0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k))); else tmp = 2.0 / ((t * (tan(k) * sin(k))) * (((k / abs(l)) * k) / abs(l))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 2e-101], N[(2.0 / N[(k * N[(k * N[(N[(t$95$1 / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 2e+146], N[(2.0 / N[(N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \tan k \cdot t\\
\mathbf{if}\;\left|\ell\right| \leq 2 \cdot 10^{-101}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\frac{t\_1}{\left|\ell\right|} \cdot \frac{\sin k}{\left|\ell\right|}\right)\right)}\\
\mathbf{elif}\;\left|\ell\right| \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\frac{2}{\frac{k}{\left|\ell\right| \cdot \left|\ell\right|} \cdot \left(t\_1 \cdot \left(\sin k \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \frac{\frac{k}{\left|\ell\right|} \cdot k}{\left|\ell\right|}}\\
\end{array}
if l < 2.0000000000000001e-101Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
if 2.0000000000000001e-101 < l < 1.99999999999999987e146Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
if 1.99999999999999987e146 < l Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6489.1
Applied rewrites89.1%
(FPCore (t l k) :precision binary64 (if (<= t 1.7e+100) (/ 2.0 (/ (* (* (/ k l) (tan k)) (* (* (sin k) k) t)) l)) (/ 2.0 (* (* t (* (tan k) (sin k))) (/ (* (/ k l) k) l)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 1.7e+100) {
tmp = 2.0 / ((((k / l) * tan(k)) * ((sin(k) * k) * t)) / l);
} else {
tmp = 2.0 / ((t * (tan(k) * sin(k))) * (((k / l) * k) / l));
}
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.7d+100) then
tmp = 2.0d0 / ((((k / l) * tan(k)) * ((sin(k) * k) * t)) / l)
else
tmp = 2.0d0 / ((t * (tan(k) * sin(k))) * (((k / l) * k) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 1.7e+100) {
tmp = 2.0 / ((((k / l) * Math.tan(k)) * ((Math.sin(k) * k) * t)) / l);
} else {
tmp = 2.0 / ((t * (Math.tan(k) * Math.sin(k))) * (((k / l) * k) / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 1.7e+100: tmp = 2.0 / ((((k / l) * math.tan(k)) * ((math.sin(k) * k) * t)) / l) else: tmp = 2.0 / ((t * (math.tan(k) * math.sin(k))) * (((k / l) * k) / l)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 1.7e+100) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k / l) * tan(k)) * Float64(Float64(sin(k) * k) * t)) / l)); else tmp = Float64(2.0 / Float64(Float64(t * Float64(tan(k) * sin(k))) * Float64(Float64(Float64(k / l) * k) / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 1.7e+100) tmp = 2.0 / ((((k / l) * tan(k)) * ((sin(k) * k) * t)) / l); else tmp = 2.0 / ((t * (tan(k) * sin(k))) * (((k / l) * k) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 1.7e+100], N[(2.0 / N[(N[(N[(N[(k / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;t \leq 1.7 \cdot 10^{+100}:\\
\;\;\;\;\frac{2}{\frac{\left(\frac{k}{\ell} \cdot \tan k\right) \cdot \left(\left(\sin k \cdot k\right) \cdot t\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \frac{\frac{k}{\ell} \cdot k}{\ell}}\\
\end{array}
if t < 1.69999999999999997e100Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6491.6
Applied rewrites91.6%
if 1.69999999999999997e100 < t Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6489.1
Applied rewrites89.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (tan k) t)))
(if (<= (fabs l) 2e-101)
(/ 2.0 (* k (* k (* (/ t_1 (fabs l)) (/ (sin k) (fabs l))))))
(if (<= (fabs l) 1.6e+142)
(/ 2.0 (* (/ k (* (fabs l) (fabs l))) (* t_1 (* (sin k) k))))
(/
2.0
(* k (/ (* (* (* k (sin k)) (tan k)) (/ t (fabs l))) (fabs l))))))))double code(double t, double l, double k) {
double t_1 = tan(k) * t;
double tmp;
if (fabs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / fabs(l)) * (sin(k) / fabs(l)))));
} else if (fabs(l) <= 1.6e+142) {
tmp = 2.0 / ((k / (fabs(l) * fabs(l))) * (t_1 * (sin(k) * k)));
} else {
tmp = 2.0 / (k * ((((k * sin(k)) * tan(k)) * (t / fabs(l))) / fabs(l)));
}
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 = tan(k) * t
if (abs(l) <= 2d-101) then
tmp = 2.0d0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l)))))
else if (abs(l) <= 1.6d+142) then
tmp = 2.0d0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k)))
else
tmp = 2.0d0 / (k * ((((k * sin(k)) * tan(k)) * (t / abs(l))) / abs(l)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.tan(k) * t;
double tmp;
if (Math.abs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / Math.abs(l)) * (Math.sin(k) / Math.abs(l)))));
} else if (Math.abs(l) <= 1.6e+142) {
tmp = 2.0 / ((k / (Math.abs(l) * Math.abs(l))) * (t_1 * (Math.sin(k) * k)));
} else {
tmp = 2.0 / (k * ((((k * Math.sin(k)) * Math.tan(k)) * (t / Math.abs(l))) / Math.abs(l)));
}
return tmp;
}
def code(t, l, k): t_1 = math.tan(k) * t tmp = 0 if math.fabs(l) <= 2e-101: tmp = 2.0 / (k * (k * ((t_1 / math.fabs(l)) * (math.sin(k) / math.fabs(l))))) elif math.fabs(l) <= 1.6e+142: tmp = 2.0 / ((k / (math.fabs(l) * math.fabs(l))) * (t_1 * (math.sin(k) * k))) else: tmp = 2.0 / (k * ((((k * math.sin(k)) * math.tan(k)) * (t / math.fabs(l))) / math.fabs(l))) return tmp
function code(t, l, k) t_1 = Float64(tan(k) * t) tmp = 0.0 if (abs(l) <= 2e-101) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t_1 / abs(l)) * Float64(sin(k) / abs(l)))))); elseif (abs(l) <= 1.6e+142) tmp = Float64(2.0 / Float64(Float64(k / Float64(abs(l) * abs(l))) * Float64(t_1 * Float64(sin(k) * k)))); else tmp = Float64(2.0 / Float64(k * Float64(Float64(Float64(Float64(k * sin(k)) * tan(k)) * Float64(t / abs(l))) / abs(l)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = tan(k) * t; tmp = 0.0; if (abs(l) <= 2e-101) tmp = 2.0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l))))); elseif (abs(l) <= 1.6e+142) tmp = 2.0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k))); else tmp = 2.0 / (k * ((((k * sin(k)) * tan(k)) * (t / abs(l))) / abs(l))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 2e-101], N[(2.0 / N[(k * N[(k * N[(N[(t$95$1 / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 1.6e+142], N[(2.0 / N[(N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(N[(N[(N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(t / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \tan k \cdot t\\
\mathbf{if}\;\left|\ell\right| \leq 2 \cdot 10^{-101}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\frac{t\_1}{\left|\ell\right|} \cdot \frac{\sin k}{\left|\ell\right|}\right)\right)}\\
\mathbf{elif}\;\left|\ell\right| \leq 1.6 \cdot 10^{+142}:\\
\;\;\;\;\frac{2}{\frac{k}{\left|\ell\right| \cdot \left|\ell\right|} \cdot \left(t\_1 \cdot \left(\sin k \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \frac{\left(\left(k \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{t}{\left|\ell\right|}}{\left|\ell\right|}}\\
\end{array}
if l < 2.0000000000000001e-101Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
if 2.0000000000000001e-101 < l < 1.60000000000000003e142Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
if 1.60000000000000003e142 < l Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6488.8
Applied rewrites88.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (tan k) t)))
(if (<= (fabs l) 2e-101)
(/ 2.0 (* k (* k (* (/ t_1 (fabs l)) (/ (sin k) (fabs l))))))
(if (<= (fabs l) 1.6e+142)
(/ 2.0 (* (/ k (* (fabs l) (fabs l))) (* t_1 (* (sin k) k))))
(/
2.0
(* k (* (* (* (sin k) (tan k)) (/ t (fabs l))) (/ k (fabs l)))))))))double code(double t, double l, double k) {
double t_1 = tan(k) * t;
double tmp;
if (fabs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / fabs(l)) * (sin(k) / fabs(l)))));
} else if (fabs(l) <= 1.6e+142) {
tmp = 2.0 / ((k / (fabs(l) * fabs(l))) * (t_1 * (sin(k) * k)));
} else {
tmp = 2.0 / (k * (((sin(k) * tan(k)) * (t / fabs(l))) * (k / fabs(l))));
}
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 = tan(k) * t
if (abs(l) <= 2d-101) then
tmp = 2.0d0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l)))))
else if (abs(l) <= 1.6d+142) then
tmp = 2.0d0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k)))
else
tmp = 2.0d0 / (k * (((sin(k) * tan(k)) * (t / abs(l))) * (k / abs(l))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.tan(k) * t;
double tmp;
if (Math.abs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / Math.abs(l)) * (Math.sin(k) / Math.abs(l)))));
} else if (Math.abs(l) <= 1.6e+142) {
tmp = 2.0 / ((k / (Math.abs(l) * Math.abs(l))) * (t_1 * (Math.sin(k) * k)));
} else {
tmp = 2.0 / (k * (((Math.sin(k) * Math.tan(k)) * (t / Math.abs(l))) * (k / Math.abs(l))));
}
return tmp;
}
def code(t, l, k): t_1 = math.tan(k) * t tmp = 0 if math.fabs(l) <= 2e-101: tmp = 2.0 / (k * (k * ((t_1 / math.fabs(l)) * (math.sin(k) / math.fabs(l))))) elif math.fabs(l) <= 1.6e+142: tmp = 2.0 / ((k / (math.fabs(l) * math.fabs(l))) * (t_1 * (math.sin(k) * k))) else: tmp = 2.0 / (k * (((math.sin(k) * math.tan(k)) * (t / math.fabs(l))) * (k / math.fabs(l)))) return tmp
function code(t, l, k) t_1 = Float64(tan(k) * t) tmp = 0.0 if (abs(l) <= 2e-101) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t_1 / abs(l)) * Float64(sin(k) / abs(l)))))); elseif (abs(l) <= 1.6e+142) tmp = Float64(2.0 / Float64(Float64(k / Float64(abs(l) * abs(l))) * Float64(t_1 * Float64(sin(k) * k)))); else tmp = Float64(2.0 / Float64(k * Float64(Float64(Float64(sin(k) * tan(k)) * Float64(t / abs(l))) * Float64(k / abs(l))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = tan(k) * t; tmp = 0.0; if (abs(l) <= 2e-101) tmp = 2.0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l))))); elseif (abs(l) <= 1.6e+142) tmp = 2.0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k))); else tmp = 2.0 / (k * (((sin(k) * tan(k)) * (t / abs(l))) * (k / abs(l)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 2e-101], N[(2.0 / N[(k * N[(k * N[(N[(t$95$1 / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 1.6e+142], N[(2.0 / N[(N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(t / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \tan k \cdot t\\
\mathbf{if}\;\left|\ell\right| \leq 2 \cdot 10^{-101}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\frac{t\_1}{\left|\ell\right|} \cdot \frac{\sin k}{\left|\ell\right|}\right)\right)}\\
\mathbf{elif}\;\left|\ell\right| \leq 1.6 \cdot 10^{+142}:\\
\;\;\;\;\frac{2}{\frac{k}{\left|\ell\right| \cdot \left|\ell\right|} \cdot \left(t\_1 \cdot \left(\sin k \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(\left(\left(\sin k \cdot \tan k\right) \cdot \frac{t}{\left|\ell\right|}\right) \cdot \frac{k}{\left|\ell\right|}\right)}\\
\end{array}
if l < 2.0000000000000001e-101Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
if 2.0000000000000001e-101 < l < 1.60000000000000003e142Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
if 1.60000000000000003e142 < l Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6486.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.5
Applied rewrites86.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6490.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6490.6
Applied rewrites90.6%
(FPCore (t l k) :precision binary64 (if (<= t 100.0) (/ 2.0 (/ (* (* (* (tan k) t) (* (sin k) k)) (/ k l)) l)) (/ 2.0 (* (* t (* (tan k) (sin k))) (/ (* (/ k l) k) l)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 100.0) {
tmp = 2.0 / ((((tan(k) * t) * (sin(k) * k)) * (k / l)) / l);
} else {
tmp = 2.0 / ((t * (tan(k) * sin(k))) * (((k / l) * k) / l));
}
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 <= 100.0d0) then
tmp = 2.0d0 / ((((tan(k) * t) * (sin(k) * k)) * (k / l)) / l)
else
tmp = 2.0d0 / ((t * (tan(k) * sin(k))) * (((k / l) * k) / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 100.0) {
tmp = 2.0 / ((((Math.tan(k) * t) * (Math.sin(k) * k)) * (k / l)) / l);
} else {
tmp = 2.0 / ((t * (Math.tan(k) * Math.sin(k))) * (((k / l) * k) / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 100.0: tmp = 2.0 / ((((math.tan(k) * t) * (math.sin(k) * k)) * (k / l)) / l) else: tmp = 2.0 / ((t * (math.tan(k) * math.sin(k))) * (((k / l) * k) / l)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 100.0) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * t) * Float64(sin(k) * k)) * Float64(k / l)) / l)); else tmp = Float64(2.0 / Float64(Float64(t * Float64(tan(k) * sin(k))) * Float64(Float64(Float64(k / l) * k) / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 100.0) tmp = 2.0 / ((((tan(k) * t) * (sin(k) * k)) * (k / l)) / l); else tmp = 2.0 / ((t * (tan(k) * sin(k))) * (((k / l) * k) / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 100.0], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;t \leq 100:\\
\;\;\;\;\frac{2}{\frac{\left(\left(\tan k \cdot t\right) \cdot \left(\sin k \cdot k\right)\right) \cdot \frac{k}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \frac{\frac{k}{\ell} \cdot k}{\ell}}\\
\end{array}
if t < 100Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
if 100 < t Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6489.1
Applied rewrites89.1%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ (* (* (/ k l) (* (* t (sin k)) (tan k))) k) l)))
double code(double t, double l, double k) {
return 2.0 / ((((k / l) * ((t * sin(k)) * tan(k))) * k) / l);
}
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 / l) * ((t * sin(k)) * tan(k))) * k) / l)
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k / l) * ((t * Math.sin(k)) * Math.tan(k))) * k) / l);
}
def code(t, l, k): return 2.0 / ((((k / l) * ((t * math.sin(k)) * math.tan(k))) * k) / l)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k / l) * Float64(Float64(t * sin(k)) * tan(k))) * k) / l)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k / l) * ((t * sin(k)) * tan(k))) * k) / l); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k / l), $MachinePrecision] * N[(N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{\left(\frac{k}{\ell} \cdot \left(\left(t \cdot \sin k\right) \cdot \tan k\right)\right) \cdot k}{\ell}}
Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6493.3
Applied rewrites93.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (sin (fabs k))) (t_2 (/ (fabs k) l)) (t_3 (tan (fabs k))))
(if (<= (fabs k) 3.2e+156)
(/ 2.0 (/ (* t_3 (* t (* (* t_1 (fabs k)) t_2))) l))
(/ 2.0 (* (fabs k) (* (* (* t_1 t_3) (/ t l)) t_2))))))double code(double t, double l, double k) {
double t_1 = sin(fabs(k));
double t_2 = fabs(k) / l;
double t_3 = tan(fabs(k));
double tmp;
if (fabs(k) <= 3.2e+156) {
tmp = 2.0 / ((t_3 * (t * ((t_1 * fabs(k)) * t_2))) / l);
} else {
tmp = 2.0 / (fabs(k) * (((t_1 * t_3) * (t / l)) * t_2));
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sin(abs(k))
t_2 = abs(k) / l
t_3 = tan(abs(k))
if (abs(k) <= 3.2d+156) then
tmp = 2.0d0 / ((t_3 * (t * ((t_1 * abs(k)) * t_2))) / l)
else
tmp = 2.0d0 / (abs(k) * (((t_1 * t_3) * (t / l)) * t_2))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.sin(Math.abs(k));
double t_2 = Math.abs(k) / l;
double t_3 = Math.tan(Math.abs(k));
double tmp;
if (Math.abs(k) <= 3.2e+156) {
tmp = 2.0 / ((t_3 * (t * ((t_1 * Math.abs(k)) * t_2))) / l);
} else {
tmp = 2.0 / (Math.abs(k) * (((t_1 * t_3) * (t / l)) * t_2));
}
return tmp;
}
def code(t, l, k): t_1 = math.sin(math.fabs(k)) t_2 = math.fabs(k) / l t_3 = math.tan(math.fabs(k)) tmp = 0 if math.fabs(k) <= 3.2e+156: tmp = 2.0 / ((t_3 * (t * ((t_1 * math.fabs(k)) * t_2))) / l) else: tmp = 2.0 / (math.fabs(k) * (((t_1 * t_3) * (t / l)) * t_2)) return tmp
function code(t, l, k) t_1 = sin(abs(k)) t_2 = Float64(abs(k) / l) t_3 = tan(abs(k)) tmp = 0.0 if (abs(k) <= 3.2e+156) tmp = Float64(2.0 / Float64(Float64(t_3 * Float64(t * Float64(Float64(t_1 * abs(k)) * t_2))) / l)); else tmp = Float64(2.0 / Float64(abs(k) * Float64(Float64(Float64(t_1 * t_3) * Float64(t / l)) * t_2))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(abs(k)); t_2 = abs(k) / l; t_3 = tan(abs(k)); tmp = 0.0; if (abs(k) <= 3.2e+156) tmp = 2.0 / ((t_3 * (t * ((t_1 * abs(k)) * t_2))) / l); else tmp = 2.0 / (abs(k) * (((t_1 * t_3) * (t / l)) * t_2)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$3 = N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 3.2e+156], N[(2.0 / N[(N[(t$95$3 * N[(t * N[(N[(t$95$1 * N[Abs[k], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Abs[k], $MachinePrecision] * N[(N[(N[(t$95$1 * t$95$3), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \sin \left(\left|k\right|\right)\\
t_2 := \frac{\left|k\right|}{\ell}\\
t_3 := \tan \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 3.2 \cdot 10^{+156}:\\
\;\;\;\;\frac{2}{\frac{t\_3 \cdot \left(t \cdot \left(\left(t\_1 \cdot \left|k\right|\right) \cdot t\_2\right)\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left|k\right| \cdot \left(\left(\left(t\_1 \cdot t\_3\right) \cdot \frac{t}{\ell}\right) \cdot t\_2\right)}\\
\end{array}
if k < 3.20000000000000002e156Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
if 3.20000000000000002e156 < k Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6486.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.5
Applied rewrites86.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6490.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6490.6
Applied rewrites90.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (tan k) t)))
(if (<= (fabs l) 2e-101)
(/ 2.0 (* k (* k (* (/ t_1 (fabs l)) (/ (sin k) (fabs l))))))
(if (<= (fabs l) 6.5e+149)
(/ 2.0 (* (/ k (* (fabs l) (fabs l))) (* t_1 (* (sin k) k))))
(/
2.0
(* k (* k (/ (* (/ t (fabs l)) (* (sin k) (tan k))) (fabs l)))))))))double code(double t, double l, double k) {
double t_1 = tan(k) * t;
double tmp;
if (fabs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / fabs(l)) * (sin(k) / fabs(l)))));
} else if (fabs(l) <= 6.5e+149) {
tmp = 2.0 / ((k / (fabs(l) * fabs(l))) * (t_1 * (sin(k) * k)));
} else {
tmp = 2.0 / (k * (k * (((t / fabs(l)) * (sin(k) * tan(k))) / fabs(l))));
}
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 = tan(k) * t
if (abs(l) <= 2d-101) then
tmp = 2.0d0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l)))))
else if (abs(l) <= 6.5d+149) then
tmp = 2.0d0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k)))
else
tmp = 2.0d0 / (k * (k * (((t / abs(l)) * (sin(k) * tan(k))) / abs(l))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.tan(k) * t;
double tmp;
if (Math.abs(l) <= 2e-101) {
tmp = 2.0 / (k * (k * ((t_1 / Math.abs(l)) * (Math.sin(k) / Math.abs(l)))));
} else if (Math.abs(l) <= 6.5e+149) {
tmp = 2.0 / ((k / (Math.abs(l) * Math.abs(l))) * (t_1 * (Math.sin(k) * k)));
} else {
tmp = 2.0 / (k * (k * (((t / Math.abs(l)) * (Math.sin(k) * Math.tan(k))) / Math.abs(l))));
}
return tmp;
}
def code(t, l, k): t_1 = math.tan(k) * t tmp = 0 if math.fabs(l) <= 2e-101: tmp = 2.0 / (k * (k * ((t_1 / math.fabs(l)) * (math.sin(k) / math.fabs(l))))) elif math.fabs(l) <= 6.5e+149: tmp = 2.0 / ((k / (math.fabs(l) * math.fabs(l))) * (t_1 * (math.sin(k) * k))) else: tmp = 2.0 / (k * (k * (((t / math.fabs(l)) * (math.sin(k) * math.tan(k))) / math.fabs(l)))) return tmp
function code(t, l, k) t_1 = Float64(tan(k) * t) tmp = 0.0 if (abs(l) <= 2e-101) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t_1 / abs(l)) * Float64(sin(k) / abs(l)))))); elseif (abs(l) <= 6.5e+149) tmp = Float64(2.0 / Float64(Float64(k / Float64(abs(l) * abs(l))) * Float64(t_1 * Float64(sin(k) * k)))); else tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(Float64(t / abs(l)) * Float64(sin(k) * tan(k))) / abs(l))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = tan(k) * t; tmp = 0.0; if (abs(l) <= 2e-101) tmp = 2.0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l))))); elseif (abs(l) <= 6.5e+149) tmp = 2.0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k))); else tmp = 2.0 / (k * (k * (((t / abs(l)) * (sin(k) * tan(k))) / abs(l)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 2e-101], N[(2.0 / N[(k * N[(k * N[(N[(t$95$1 / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 6.5e+149], N[(2.0 / N[(N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(k * N[(N[(N[(t / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \tan k \cdot t\\
\mathbf{if}\;\left|\ell\right| \leq 2 \cdot 10^{-101}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\frac{t\_1}{\left|\ell\right|} \cdot \frac{\sin k}{\left|\ell\right|}\right)\right)}\\
\mathbf{elif}\;\left|\ell\right| \leq 6.5 \cdot 10^{+149}:\\
\;\;\;\;\frac{2}{\frac{k}{\left|\ell\right| \cdot \left|\ell\right|} \cdot \left(t\_1 \cdot \left(\sin k \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\frac{t}{\left|\ell\right|} \cdot \left(\sin k \cdot \tan k\right)}{\left|\ell\right|}\right)}\\
\end{array}
if l < 2.0000000000000001e-101Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
if 2.0000000000000001e-101 < l < 6.50000000000000015e149Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
if 6.50000000000000015e149 < l Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6486.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.5
Applied rewrites86.5%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (tan k) t))
(t_2 (/ 2.0 (* k (* k (* (/ t_1 (fabs l)) (/ (sin k) (fabs l))))))))
(if (<= (fabs l) 2e-101)
t_2
(if (<= (fabs l) 6.5e+149)
(/ 2.0 (* (/ k (* (fabs l) (fabs l))) (* t_1 (* (sin k) k))))
t_2))))double code(double t, double l, double k) {
double t_1 = tan(k) * t;
double t_2 = 2.0 / (k * (k * ((t_1 / fabs(l)) * (sin(k) / fabs(l)))));
double tmp;
if (fabs(l) <= 2e-101) {
tmp = t_2;
} else if (fabs(l) <= 6.5e+149) {
tmp = 2.0 / ((k / (fabs(l) * fabs(l))) * (t_1 * (sin(k) * k)));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = tan(k) * t
t_2 = 2.0d0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l)))))
if (abs(l) <= 2d-101) then
tmp = t_2
else if (abs(l) <= 6.5d+149) then
tmp = 2.0d0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.tan(k) * t;
double t_2 = 2.0 / (k * (k * ((t_1 / Math.abs(l)) * (Math.sin(k) / Math.abs(l)))));
double tmp;
if (Math.abs(l) <= 2e-101) {
tmp = t_2;
} else if (Math.abs(l) <= 6.5e+149) {
tmp = 2.0 / ((k / (Math.abs(l) * Math.abs(l))) * (t_1 * (Math.sin(k) * k)));
} else {
tmp = t_2;
}
return tmp;
}
def code(t, l, k): t_1 = math.tan(k) * t t_2 = 2.0 / (k * (k * ((t_1 / math.fabs(l)) * (math.sin(k) / math.fabs(l))))) tmp = 0 if math.fabs(l) <= 2e-101: tmp = t_2 elif math.fabs(l) <= 6.5e+149: tmp = 2.0 / ((k / (math.fabs(l) * math.fabs(l))) * (t_1 * (math.sin(k) * k))) else: tmp = t_2 return tmp
function code(t, l, k) t_1 = Float64(tan(k) * t) t_2 = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t_1 / abs(l)) * Float64(sin(k) / abs(l)))))) tmp = 0.0 if (abs(l) <= 2e-101) tmp = t_2; elseif (abs(l) <= 6.5e+149) tmp = Float64(2.0 / Float64(Float64(k / Float64(abs(l) * abs(l))) * Float64(t_1 * Float64(sin(k) * k)))); else tmp = t_2; end return tmp end
function tmp_2 = code(t, l, k) t_1 = tan(k) * t; t_2 = 2.0 / (k * (k * ((t_1 / abs(l)) * (sin(k) / abs(l))))); tmp = 0.0; if (abs(l) <= 2e-101) tmp = t_2; elseif (abs(l) <= 6.5e+149) tmp = 2.0 / ((k / (abs(l) * abs(l))) * (t_1 * (sin(k) * k))); else tmp = t_2; end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 / N[(k * N[(k * N[(N[(t$95$1 / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 2e-101], t$95$2, If[LessEqual[N[Abs[l], $MachinePrecision], 6.5e+149], N[(2.0 / N[(N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \tan k \cdot t\\
t_2 := \frac{2}{k \cdot \left(k \cdot \left(\frac{t\_1}{\left|\ell\right|} \cdot \frac{\sin k}{\left|\ell\right|}\right)\right)}\\
\mathbf{if}\;\left|\ell\right| \leq 2 \cdot 10^{-101}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\left|\ell\right| \leq 6.5 \cdot 10^{+149}:\\
\;\;\;\;\frac{2}{\frac{k}{\left|\ell\right| \cdot \left|\ell\right|} \cdot \left(t\_1 \cdot \left(\sin k \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if l < 2.0000000000000001e-101 or 6.50000000000000015e149 < l Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
if 2.0000000000000001e-101 < l < 6.50000000000000015e149Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin (fabs k)) (fabs k))))
(if (<= (fabs k) 0.000112)
(/ 2.0 (/ (* (* (* (fabs k) t) t_1) (/ (fabs k) l)) l))
(/ 2.0 (* (/ (fabs k) (* l l)) (* (* (tan (fabs k)) t) t_1))))))double code(double t, double l, double k) {
double t_1 = sin(fabs(k)) * fabs(k);
double tmp;
if (fabs(k) <= 0.000112) {
tmp = 2.0 / ((((fabs(k) * t) * t_1) * (fabs(k) / l)) / l);
} else {
tmp = 2.0 / ((fabs(k) / (l * l)) * ((tan(fabs(k)) * t) * t_1));
}
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 = sin(abs(k)) * abs(k)
if (abs(k) <= 0.000112d0) then
tmp = 2.0d0 / ((((abs(k) * t) * t_1) * (abs(k) / l)) / l)
else
tmp = 2.0d0 / ((abs(k) / (l * l)) * ((tan(abs(k)) * t) * t_1))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.sin(Math.abs(k)) * Math.abs(k);
double tmp;
if (Math.abs(k) <= 0.000112) {
tmp = 2.0 / ((((Math.abs(k) * t) * t_1) * (Math.abs(k) / l)) / l);
} else {
tmp = 2.0 / ((Math.abs(k) / (l * l)) * ((Math.tan(Math.abs(k)) * t) * t_1));
}
return tmp;
}
def code(t, l, k): t_1 = math.sin(math.fabs(k)) * math.fabs(k) tmp = 0 if math.fabs(k) <= 0.000112: tmp = 2.0 / ((((math.fabs(k) * t) * t_1) * (math.fabs(k) / l)) / l) else: tmp = 2.0 / ((math.fabs(k) / (l * l)) * ((math.tan(math.fabs(k)) * t) * t_1)) return tmp
function code(t, l, k) t_1 = Float64(sin(abs(k)) * abs(k)) tmp = 0.0 if (abs(k) <= 0.000112) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(abs(k) * t) * t_1) * Float64(abs(k) / l)) / l)); else tmp = Float64(2.0 / Float64(Float64(abs(k) / Float64(l * l)) * Float64(Float64(tan(abs(k)) * t) * t_1))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(abs(k)) * abs(k); tmp = 0.0; if (abs(k) <= 0.000112) tmp = 2.0 / ((((abs(k) * t) * t_1) * (abs(k) / l)) / l); else tmp = 2.0 / ((abs(k) / (l * l)) * ((tan(abs(k)) * t) * t_1)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 0.000112], N[(2.0 / N[(N[(N[(N[(N[Abs[k], $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Abs[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \sin \left(\left|k\right|\right) \cdot \left|k\right|\\
\mathbf{if}\;\left|k\right| \leq 0.000112:\\
\;\;\;\;\frac{2}{\frac{\left(\left(\left|k\right| \cdot t\right) \cdot t\_1\right) \cdot \frac{\left|k\right|}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left|k\right|}{\ell \cdot \ell} \cdot \left(\left(\tan \left(\left|k\right|\right) \cdot t\right) \cdot t\_1\right)}\\
\end{array}
if k < 1.11999999999999998e-4Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
Taylor expanded in k around 0
Applied rewrites72.1%
if 1.11999999999999998e-4 < k Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6478.3
Applied rewrites78.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin (fabs k)) (fabs k))))
(if (<= (fabs k) 0.000112)
(/ 2.0 (/ (* (* (* (fabs k) t) t_1) (/ (fabs k) l)) l))
(/ 2.0 (* (tan (fabs k)) (* (* t_1 t) (/ (fabs k) (* l l))))))))double code(double t, double l, double k) {
double t_1 = sin(fabs(k)) * fabs(k);
double tmp;
if (fabs(k) <= 0.000112) {
tmp = 2.0 / ((((fabs(k) * t) * t_1) * (fabs(k) / l)) / l);
} else {
tmp = 2.0 / (tan(fabs(k)) * ((t_1 * t) * (fabs(k) / (l * l))));
}
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 = sin(abs(k)) * abs(k)
if (abs(k) <= 0.000112d0) then
tmp = 2.0d0 / ((((abs(k) * t) * t_1) * (abs(k) / l)) / l)
else
tmp = 2.0d0 / (tan(abs(k)) * ((t_1 * t) * (abs(k) / (l * l))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.sin(Math.abs(k)) * Math.abs(k);
double tmp;
if (Math.abs(k) <= 0.000112) {
tmp = 2.0 / ((((Math.abs(k) * t) * t_1) * (Math.abs(k) / l)) / l);
} else {
tmp = 2.0 / (Math.tan(Math.abs(k)) * ((t_1 * t) * (Math.abs(k) / (l * l))));
}
return tmp;
}
def code(t, l, k): t_1 = math.sin(math.fabs(k)) * math.fabs(k) tmp = 0 if math.fabs(k) <= 0.000112: tmp = 2.0 / ((((math.fabs(k) * t) * t_1) * (math.fabs(k) / l)) / l) else: tmp = 2.0 / (math.tan(math.fabs(k)) * ((t_1 * t) * (math.fabs(k) / (l * l)))) return tmp
function code(t, l, k) t_1 = Float64(sin(abs(k)) * abs(k)) tmp = 0.0 if (abs(k) <= 0.000112) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(abs(k) * t) * t_1) * Float64(abs(k) / l)) / l)); else tmp = Float64(2.0 / Float64(tan(abs(k)) * Float64(Float64(t_1 * t) * Float64(abs(k) / Float64(l * l))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(abs(k)) * abs(k); tmp = 0.0; if (abs(k) <= 0.000112) tmp = 2.0 / ((((abs(k) * t) * t_1) * (abs(k) / l)) / l); else tmp = 2.0 / (tan(abs(k)) * ((t_1 * t) * (abs(k) / (l * l)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 0.000112], N[(2.0 / N[(N[(N[(N[(N[Abs[k], $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$1 * t), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \sin \left(\left|k\right|\right) \cdot \left|k\right|\\
\mathbf{if}\;\left|k\right| \leq 0.000112:\\
\;\;\;\;\frac{2}{\frac{\left(\left(\left|k\right| \cdot t\right) \cdot t\_1\right) \cdot \frac{\left|k\right|}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\tan \left(\left|k\right|\right) \cdot \left(\left(t\_1 \cdot t\right) \cdot \frac{\left|k\right|}{\ell \cdot \ell}\right)}\\
\end{array}
if k < 1.11999999999999998e-4Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
Taylor expanded in k around 0
Applied rewrites72.1%
if 1.11999999999999998e-4 < k Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.6
Applied rewrites78.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin (fabs k)) (fabs k))))
(if (<= (fabs k) 0.0014)
(/
2.0
(/
(*
(*
(* (fabs k) (+ t (* 0.3333333333333333 (* (pow (fabs k) 2.0) t))))
t_1)
(/ (fabs k) l))
l))
(/ 2.0 (/ (* t_1 (* (* (tan (fabs k)) t) (fabs k))) (* l l))))))double code(double t, double l, double k) {
double t_1 = sin(fabs(k)) * fabs(k);
double tmp;
if (fabs(k) <= 0.0014) {
tmp = 2.0 / ((((fabs(k) * (t + (0.3333333333333333 * (pow(fabs(k), 2.0) * t)))) * t_1) * (fabs(k) / l)) / l);
} else {
tmp = 2.0 / ((t_1 * ((tan(fabs(k)) * t) * fabs(k))) / (l * l));
}
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 = sin(abs(k)) * abs(k)
if (abs(k) <= 0.0014d0) then
tmp = 2.0d0 / ((((abs(k) * (t + (0.3333333333333333d0 * ((abs(k) ** 2.0d0) * t)))) * t_1) * (abs(k) / l)) / l)
else
tmp = 2.0d0 / ((t_1 * ((tan(abs(k)) * t) * abs(k))) / (l * l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.sin(Math.abs(k)) * Math.abs(k);
double tmp;
if (Math.abs(k) <= 0.0014) {
tmp = 2.0 / ((((Math.abs(k) * (t + (0.3333333333333333 * (Math.pow(Math.abs(k), 2.0) * t)))) * t_1) * (Math.abs(k) / l)) / l);
} else {
tmp = 2.0 / ((t_1 * ((Math.tan(Math.abs(k)) * t) * Math.abs(k))) / (l * l));
}
return tmp;
}
def code(t, l, k): t_1 = math.sin(math.fabs(k)) * math.fabs(k) tmp = 0 if math.fabs(k) <= 0.0014: tmp = 2.0 / ((((math.fabs(k) * (t + (0.3333333333333333 * (math.pow(math.fabs(k), 2.0) * t)))) * t_1) * (math.fabs(k) / l)) / l) else: tmp = 2.0 / ((t_1 * ((math.tan(math.fabs(k)) * t) * math.fabs(k))) / (l * l)) return tmp
function code(t, l, k) t_1 = Float64(sin(abs(k)) * abs(k)) tmp = 0.0 if (abs(k) <= 0.0014) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(abs(k) * Float64(t + Float64(0.3333333333333333 * Float64((abs(k) ^ 2.0) * t)))) * t_1) * Float64(abs(k) / l)) / l)); else tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(Float64(tan(abs(k)) * t) * abs(k))) / Float64(l * l))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(abs(k)) * abs(k); tmp = 0.0; if (abs(k) <= 0.0014) tmp = 2.0 / ((((abs(k) * (t + (0.3333333333333333 * ((abs(k) ^ 2.0) * t)))) * t_1) * (abs(k) / l)) / l); else tmp = 2.0 / ((t_1 * ((tan(abs(k)) * t) * abs(k))) / (l * l)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 0.0014], N[(2.0 / N[(N[(N[(N[(N[Abs[k], $MachinePrecision] * N[(t + N[(0.3333333333333333 * N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$1 * N[(N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \sin \left(\left|k\right|\right) \cdot \left|k\right|\\
\mathbf{if}\;\left|k\right| \leq 0.0014:\\
\;\;\;\;\frac{2}{\frac{\left(\left(\left|k\right| \cdot \left(t + 0.3333333333333333 \cdot \left({\left(\left|k\right|\right)}^{2} \cdot t\right)\right)\right) \cdot t\_1\right) \cdot \frac{\left|k\right|}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t\_1 \cdot \left(\left(\tan \left(\left|k\right|\right) \cdot t\right) \cdot \left|k\right|\right)}{\ell \cdot \ell}}\\
\end{array}
if k < 0.00139999999999999999Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
Taylor expanded in k around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6471.6
Applied rewrites71.6%
if 0.00139999999999999999 < k Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-/l/N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6476.1
Applied rewrites76.1%
(FPCore (t l k)
:precision binary64
(*
(copysign 1.0 t)
(if (<= (fabs t) 6e-83)
(/ 2.0 (* k (* k (/ (* (/ (fabs t) l) (* (sin k) k)) l))))
(/ 2.0 (/ (* (* (* (tan k) (fabs t)) (pow k 2.0)) (/ k l)) l)))))double code(double t, double l, double k) {
double tmp;
if (fabs(t) <= 6e-83) {
tmp = 2.0 / (k * (k * (((fabs(t) / l) * (sin(k) * k)) / l)));
} else {
tmp = 2.0 / ((((tan(k) * fabs(t)) * pow(k, 2.0)) * (k / l)) / l);
}
return copysign(1.0, t) * tmp;
}
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(t) <= 6e-83) {
tmp = 2.0 / (k * (k * (((Math.abs(t) / l) * (Math.sin(k) * k)) / l)));
} else {
tmp = 2.0 / ((((Math.tan(k) * Math.abs(t)) * Math.pow(k, 2.0)) * (k / l)) / l);
}
return Math.copySign(1.0, t) * tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(t) <= 6e-83: tmp = 2.0 / (k * (k * (((math.fabs(t) / l) * (math.sin(k) * k)) / l))) else: tmp = 2.0 / ((((math.tan(k) * math.fabs(t)) * math.pow(k, 2.0)) * (k / l)) / l) return math.copysign(1.0, t) * tmp
function code(t, l, k) tmp = 0.0 if (abs(t) <= 6e-83) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(Float64(abs(t) / l) * Float64(sin(k) * k)) / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * abs(t)) * (k ^ 2.0)) * Float64(k / l)) / l)); end return Float64(copysign(1.0, t) * tmp) end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(t) <= 6e-83) tmp = 2.0 / (k * (k * (((abs(t) / l) * (sin(k) * k)) / l))); else tmp = 2.0 / ((((tan(k) * abs(t)) * (k ^ 2.0)) * (k / l)) / l); end tmp_2 = (sign(t) * abs(1.0)) * tmp; end
code[t_, l_, k_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 6e-83], N[(2.0 / N[(k * N[(k * N[(N[(N[(N[Abs[t], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 6 \cdot 10^{-83}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\frac{\left|t\right|}{\ell} \cdot \left(\sin k \cdot k\right)}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(\tan k \cdot \left|t\right|\right) \cdot {k}^{2}\right) \cdot \frac{k}{\ell}}{\ell}}\\
\end{array}
if t < 6.00000000000000021e-83Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6486.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.5
Applied rewrites86.5%
Taylor expanded in k around 0
Applied rewrites71.7%
if 6.00000000000000021e-83 < t Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
Taylor expanded in k around 0
lower-pow.f6472.1
Applied rewrites72.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (sin k) k)))
(*
(copysign 1.0 t)
(if (<= (fabs t) 1e+98)
(/ 2.0 (* k (* k (/ (* (/ (fabs t) l) t_1) l))))
(/ 2.0 (/ (* (* (* k (fabs t)) t_1) (/ k l)) l))))))double code(double t, double l, double k) {
double t_1 = sin(k) * k;
double tmp;
if (fabs(t) <= 1e+98) {
tmp = 2.0 / (k * (k * (((fabs(t) / l) * t_1) / l)));
} else {
tmp = 2.0 / ((((k * fabs(t)) * t_1) * (k / l)) / l);
}
return copysign(1.0, t) * tmp;
}
public static double code(double t, double l, double k) {
double t_1 = Math.sin(k) * k;
double tmp;
if (Math.abs(t) <= 1e+98) {
tmp = 2.0 / (k * (k * (((Math.abs(t) / l) * t_1) / l)));
} else {
tmp = 2.0 / ((((k * Math.abs(t)) * t_1) * (k / l)) / l);
}
return Math.copySign(1.0, t) * tmp;
}
def code(t, l, k): t_1 = math.sin(k) * k tmp = 0 if math.fabs(t) <= 1e+98: tmp = 2.0 / (k * (k * (((math.fabs(t) / l) * t_1) / l))) else: tmp = 2.0 / ((((k * math.fabs(t)) * t_1) * (k / l)) / l) return math.copysign(1.0, t) * tmp
function code(t, l, k) t_1 = Float64(sin(k) * k) tmp = 0.0 if (abs(t) <= 1e+98) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(Float64(abs(t) / l) * t_1) / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * abs(t)) * t_1) * Float64(k / l)) / l)); end return Float64(copysign(1.0, t) * tmp) end
function tmp_2 = code(t, l, k) t_1 = sin(k) * k; tmp = 0.0; if (abs(t) <= 1e+98) tmp = 2.0 / (k * (k * (((abs(t) / l) * t_1) / l))); else tmp = 2.0 / ((((k * abs(t)) * t_1) * (k / l)) / l); end tmp_2 = (sign(t) * abs(1.0)) * tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 1e+98], N[(2.0 / N[(k * N[(k * N[(N[(N[(N[Abs[t], $MachinePrecision] / l), $MachinePrecision] * t$95$1), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * N[Abs[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \sin k \cdot k\\
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 10^{+98}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\frac{\left|t\right|}{\ell} \cdot t\_1}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(k \cdot \left|t\right|\right) \cdot t\_1\right) \cdot \frac{k}{\ell}}{\ell}}\\
\end{array}
\end{array}
if t < 9.99999999999999998e97Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6486.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.5
Applied rewrites86.5%
Taylor expanded in k around 0
Applied rewrites71.7%
if 9.99999999999999998e97 < t Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
Taylor expanded in k around 0
Applied rewrites72.1%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ (* (* (* k t) (* (sin k) k)) (/ k l)) l)))
double code(double t, double l, double k) {
return 2.0 / ((((k * t) * (sin(k) * k)) * (k / l)) / l);
}
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 * t) * (sin(k) * k)) * (k / l)) / l)
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k * t) * (Math.sin(k) * k)) * (k / l)) / l);
}
def code(t, l, k): return 2.0 / ((((k * t) * (math.sin(k) * k)) * (k / l)) / l)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k * t) * Float64(sin(k) * k)) * Float64(k / l)) / l)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k * t) * (sin(k) * k)) * (k / l)) / l); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * t), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{\left(\left(k \cdot t\right) \cdot \left(\sin k \cdot k\right)\right) \cdot \frac{k}{\ell}}{\ell}}
Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
Taylor expanded in k around 0
Applied rewrites72.1%
(FPCore (t l k) :precision binary64 (/ 2.0 (* k (* k (/ (/ (* (pow k 2.0) t) l) l)))))
double code(double t, double l, double k) {
return 2.0 / (k * (k * (((pow(k, 2.0) * t) / l) / l)));
}
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 * ((((k ** 2.0d0) * t) / l) / l)))
end function
public static double code(double t, double l, double k) {
return 2.0 / (k * (k * (((Math.pow(k, 2.0) * t) / l) / l)));
}
def code(t, l, k): return 2.0 / (k * (k * (((math.pow(k, 2.0) * t) / l) / l)))
function code(t, l, k) return Float64(2.0 / Float64(k * Float64(k * Float64(Float64(Float64((k ^ 2.0) * t) / l) / l)))) end
function tmp = code(t, l, k) tmp = 2.0 / (k * (k * ((((k ^ 2.0) * t) / l) / l))); end
code[t_, l_, k_] := N[(2.0 / N[(k * N[(k * N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{2}{k \cdot \left(k \cdot \frac{\frac{{k}^{2} \cdot t}{\ell}}{\ell}\right)}
Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites75.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6486.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.5
Applied rewrites86.5%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f6472.0
Applied rewrites72.0%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ (* (* (pow k 3.0) t) (/ k l)) l)))
double code(double t, double l, double k) {
return 2.0 / (((pow(k, 3.0) * t) * (k / l)) / l);
}
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 ** 3.0d0) * t) * (k / l)) / l)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.pow(k, 3.0) * t) * (k / l)) / l);
}
def code(t, l, k): return 2.0 / (((math.pow(k, 3.0) * t) * (k / l)) / l)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64((k ^ 3.0) * t) * Float64(k / l)) / l)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k ^ 3.0) * t) * (k / l)) / l); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Power[k, 3.0], $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{\left({k}^{3} \cdot t\right) \cdot \frac{k}{\ell}}{\ell}}
Initial program 35.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6491.0
Applied rewrites91.0%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6470.2
Applied rewrites70.2%
(FPCore (t l k) :precision binary64 (* (/ (* l (pow k -4.0)) t) (+ l l)))
double code(double t, double l, double k) {
return ((l * pow(k, -4.0)) / t) * (l + l);
}
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 * (k ** (-4.0d0))) / t) * (l + l)
end function
public static double code(double t, double l, double k) {
return ((l * Math.pow(k, -4.0)) / t) * (l + l);
}
def code(t, l, k): return ((l * math.pow(k, -4.0)) / t) * (l + l)
function code(t, l, k) return Float64(Float64(Float64(l * (k ^ -4.0)) / t) * Float64(l + l)) end
function tmp = code(t, l, k) tmp = ((l * (k ^ -4.0)) / t) * (l + l); end
code[t_, l_, k_] := N[(N[(N[(l * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
\frac{\ell \cdot {k}^{-4}}{t} \cdot \left(\ell + \ell\right)
Initial program 35.5%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6462.3
Applied rewrites62.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.5
Applied rewrites68.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lift-pow.f64N/A
lift-pow.f64N/A
exp-to-powN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
lift-/.f64N/A
count-2-revN/A
Applied rewrites68.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval69.1
Applied rewrites69.1%
(FPCore (t l k) :precision binary64 (* (/ l (* (pow k 4.0) t)) (+ l l)))
double code(double t, double l, double k) {
return (l / (pow(k, 4.0) * t)) * (l + l);
}
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 / ((k ** 4.0d0) * t)) * (l + l)
end function
public static double code(double t, double l, double k) {
return (l / (Math.pow(k, 4.0) * t)) * (l + l);
}
def code(t, l, k): return (l / (math.pow(k, 4.0) * t)) * (l + l)
function code(t, l, k) return Float64(Float64(l / Float64((k ^ 4.0) * t)) * Float64(l + l)) end
function tmp = code(t, l, k) tmp = (l / ((k ^ 4.0) * t)) * (l + l); end
code[t_, l_, k_] := N[(N[(l / N[(N[Power[k, 4.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)
Initial program 35.5%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6462.3
Applied rewrites62.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.5
Applied rewrites68.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lift-pow.f64N/A
lift-pow.f64N/A
exp-to-powN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
lift-/.f64N/A
count-2-revN/A
Applied rewrites68.5%
(FPCore (t l k) :precision binary64 (* (* (/ (pow k -4.0) t) l) (+ l l)))
double code(double t, double l, double k) {
return ((pow(k, -4.0) / t) * l) * (l + l);
}
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 = (((k ** (-4.0d0)) / t) * l) * (l + l)
end function
public static double code(double t, double l, double k) {
return ((Math.pow(k, -4.0) / t) * l) * (l + l);
}
def code(t, l, k): return ((math.pow(k, -4.0) / t) * l) * (l + l)
function code(t, l, k) return Float64(Float64(Float64((k ^ -4.0) / t) * l) * Float64(l + l)) end
function tmp = code(t, l, k) tmp = (((k ^ -4.0) / t) * l) * (l + l); end
code[t_, l_, k_] := N[(N[(N[(N[Power[k, -4.0], $MachinePrecision] / t), $MachinePrecision] * l), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
\left(\frac{{k}^{-4}}{t} \cdot \ell\right) \cdot \left(\ell + \ell\right)
Initial program 35.5%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6462.3
Applied rewrites62.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.5
Applied rewrites68.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lift-pow.f64N/A
lift-pow.f64N/A
exp-to-powN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
lift-/.f64N/A
count-2-revN/A
Applied rewrites68.5%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval68.3
Applied rewrites68.3%
herbie shell --seed 2025178
(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))))