
(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 11 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 (/ (- k) l))) (/ 2.0 (* t_1 (* t_1 (* (* (tan k) t) (sin k)))))))
double code(double t, double l, double k) {
double t_1 = -k / l;
return 2.0 / (t_1 * (t_1 * ((tan(k) * t) * sin(k))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
t_1 = -k / l
code = 2.0d0 / (t_1 * (t_1 * ((tan(k) * t) * sin(k))))
end function
public static double code(double t, double l, double k) {
double t_1 = -k / l;
return 2.0 / (t_1 * (t_1 * ((Math.tan(k) * t) * Math.sin(k))));
}
def code(t, l, k): t_1 = -k / l return 2.0 / (t_1 * (t_1 * ((math.tan(k) * t) * math.sin(k))))
function code(t, l, k) t_1 = Float64(Float64(-k) / l) return Float64(2.0 / Float64(t_1 * Float64(t_1 * Float64(Float64(tan(k) * t) * sin(k))))) end
function tmp = code(t, l, k) t_1 = -k / l; tmp = 2.0 / (t_1 * (t_1 * ((tan(k) * t) * sin(k)))); end
code[t_, l_, k_] := Block[{t$95$1 = N[((-k) / l), $MachinePrecision]}, N[(2.0 / N[(t$95$1 * N[(t$95$1 * N[(N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_1 := \frac{-k}{\ell}\\
\frac{2}{t\_1 \cdot \left(t\_1 \cdot \left(\left(\tan k \cdot t\right) \cdot \sin k\right)\right)}
\end{array}
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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
sqr-neg-revN/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6496.0%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-sin.f6497.6%
Applied rewrites97.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (fabs k) l))
(t_2 (* t_1 t_1))
(t_3 (sin (fabs k)))
(t_4 (tan (fabs k))))
(if (<= (fabs k) 2e-161)
(/ 2.0 (* (* (* t_3 t) t_4) t_2))
(if (<= (fabs k) 2e+144)
(/ 2.0 (* t_1 (* (* t_3 (fabs k)) (/ (* t_4 t) l))))
(/ 2.0 (* (* t (* t_4 t_3)) t_2))))))double code(double t, double l, double k) {
double t_1 = fabs(k) / l;
double t_2 = t_1 * t_1;
double t_3 = sin(fabs(k));
double t_4 = tan(fabs(k));
double tmp;
if (fabs(k) <= 2e-161) {
tmp = 2.0 / (((t_3 * t) * t_4) * t_2);
} else if (fabs(k) <= 2e+144) {
tmp = 2.0 / (t_1 * ((t_3 * fabs(k)) * ((t_4 * t) / l)));
} else {
tmp = 2.0 / ((t * (t_4 * t_3)) * 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) :: t_4
real(8) :: tmp
t_1 = abs(k) / l
t_2 = t_1 * t_1
t_3 = sin(abs(k))
t_4 = tan(abs(k))
if (abs(k) <= 2d-161) then
tmp = 2.0d0 / (((t_3 * t) * t_4) * t_2)
else if (abs(k) <= 2d+144) then
tmp = 2.0d0 / (t_1 * ((t_3 * abs(k)) * ((t_4 * t) / l)))
else
tmp = 2.0d0 / ((t * (t_4 * t_3)) * t_2)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.abs(k) / l;
double t_2 = t_1 * t_1;
double t_3 = Math.sin(Math.abs(k));
double t_4 = Math.tan(Math.abs(k));
double tmp;
if (Math.abs(k) <= 2e-161) {
tmp = 2.0 / (((t_3 * t) * t_4) * t_2);
} else if (Math.abs(k) <= 2e+144) {
tmp = 2.0 / (t_1 * ((t_3 * Math.abs(k)) * ((t_4 * t) / l)));
} else {
tmp = 2.0 / ((t * (t_4 * t_3)) * t_2);
}
return tmp;
}
def code(t, l, k): t_1 = math.fabs(k) / l t_2 = t_1 * t_1 t_3 = math.sin(math.fabs(k)) t_4 = math.tan(math.fabs(k)) tmp = 0 if math.fabs(k) <= 2e-161: tmp = 2.0 / (((t_3 * t) * t_4) * t_2) elif math.fabs(k) <= 2e+144: tmp = 2.0 / (t_1 * ((t_3 * math.fabs(k)) * ((t_4 * t) / l))) else: tmp = 2.0 / ((t * (t_4 * t_3)) * t_2) return tmp
function code(t, l, k) t_1 = Float64(abs(k) / l) t_2 = Float64(t_1 * t_1) t_3 = sin(abs(k)) t_4 = tan(abs(k)) tmp = 0.0 if (abs(k) <= 2e-161) tmp = Float64(2.0 / Float64(Float64(Float64(t_3 * t) * t_4) * t_2)); elseif (abs(k) <= 2e+144) tmp = Float64(2.0 / Float64(t_1 * Float64(Float64(t_3 * abs(k)) * Float64(Float64(t_4 * t) / l)))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(t_4 * t_3)) * t_2)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = abs(k) / l; t_2 = t_1 * t_1; t_3 = sin(abs(k)); t_4 = tan(abs(k)); tmp = 0.0; if (abs(k) <= 2e-161) tmp = 2.0 / (((t_3 * t) * t_4) * t_2); elseif (abs(k) <= 2e+144) tmp = 2.0 / (t_1 * ((t_3 * abs(k)) * ((t_4 * t) / l))); else tmp = 2.0 / ((t * (t_4 * t_3)) * t_2); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 2e-161], N[(2.0 / N[(N[(N[(t$95$3 * t), $MachinePrecision] * t$95$4), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[k], $MachinePrecision], 2e+144], N[(2.0 / N[(t$95$1 * N[(N[(t$95$3 * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$4 * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(t$95$4 * t$95$3), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{\left|k\right|}{\ell}\\
t_2 := t\_1 \cdot t\_1\\
t_3 := \sin \left(\left|k\right|\right)\\
t_4 := \tan \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 2 \cdot 10^{-161}:\\
\;\;\;\;\frac{2}{\left(\left(t\_3 \cdot t\right) \cdot t\_4\right) \cdot t\_2}\\
\mathbf{elif}\;\left|k\right| \leq 2 \cdot 10^{+144}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(\left(t\_3 \cdot \left|k\right|\right) \cdot \frac{t\_4 \cdot t}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(t\_4 \cdot t\_3\right)\right) \cdot t\_2}\\
\end{array}
if k < 2.0000000000000001e-161Initial 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f6492.2%
Applied rewrites92.2%
if 2.0000000000000001e-161 < k < 2e144Initial 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
Applied rewrites93.6%
if 2e144 < 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
(FPCore (t l k) :precision binary64 (* (copysign 1.0 t) (if (<= (fabs t) 1.5e-142) (/ 2.0 (/ (* (* (* (tan k) (fabs t)) (* (sin k) k)) (/ k l)) l)) (/ 2.0 (* (* (* (sin k) (fabs t)) (tan k)) (* (/ k l) (/ k l)))))))
double code(double t, double l, double k) {
double tmp;
if (fabs(t) <= 1.5e-142) {
tmp = 2.0 / ((((tan(k) * fabs(t)) * (sin(k) * k)) * (k / l)) / l);
} else {
tmp = 2.0 / (((sin(k) * fabs(t)) * tan(k)) * ((k / l) * (k / l)));
}
return copysign(1.0, t) * tmp;
}
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(t) <= 1.5e-142) {
tmp = 2.0 / ((((Math.tan(k) * Math.abs(t)) * (Math.sin(k) * k)) * (k / l)) / l);
} else {
tmp = 2.0 / (((Math.sin(k) * Math.abs(t)) * Math.tan(k)) * ((k / l) * (k / l)));
}
return Math.copySign(1.0, t) * tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(t) <= 1.5e-142: tmp = 2.0 / ((((math.tan(k) * math.fabs(t)) * (math.sin(k) * k)) * (k / l)) / l) else: tmp = 2.0 / (((math.sin(k) * math.fabs(t)) * math.tan(k)) * ((k / l) * (k / l))) return math.copysign(1.0, t) * tmp
function code(t, l, k) tmp = 0.0 if (abs(t) <= 1.5e-142) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * abs(t)) * Float64(sin(k) * k)) * Float64(k / l)) / l)); else tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * abs(t)) * tan(k)) * Float64(Float64(k / l) * Float64(k / l)))); end return Float64(copysign(1.0, t) * tmp) end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(t) <= 1.5e-142) tmp = 2.0 / ((((tan(k) * abs(t)) * (sin(k) * k)) * (k / l)) / l); else tmp = 2.0 / (((sin(k) * abs(t)) * tan(k)) * ((k / l) * (k / 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], 1.5e-142], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 1.5 \cdot 10^{-142}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(\tan k \cdot \left|t\right|\right) \cdot \left(\sin k \cdot k\right)\right) \cdot \frac{k}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\sin k \cdot \left|t\right|\right) \cdot \tan k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\end{array}
if t < 1.5000000000000001e-142Initial 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
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
Applied rewrites90.8%
if 1.5000000000000001e-142 < 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f6492.2%
Applied rewrites92.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ k (fabs l))))
(if (<= (fabs l) 4e+70)
(/ 2.0 (* t_1 (* (* (sin k) k) (/ (* (tan k) t) (fabs l)))))
(/ 2.0 (* (* t (* (tan k) (sin k))) (* t_1 t_1))))))double code(double t, double l, double k) {
double t_1 = k / fabs(l);
double tmp;
if (fabs(l) <= 4e+70) {
tmp = 2.0 / (t_1 * ((sin(k) * k) * ((tan(k) * t) / fabs(l))));
} else {
tmp = 2.0 / ((t * (tan(k) * sin(k))) * (t_1 * 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 = k / abs(l)
if (abs(l) <= 4d+70) then
tmp = 2.0d0 / (t_1 * ((sin(k) * k) * ((tan(k) * t) / abs(l))))
else
tmp = 2.0d0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k / Math.abs(l);
double tmp;
if (Math.abs(l) <= 4e+70) {
tmp = 2.0 / (t_1 * ((Math.sin(k) * k) * ((Math.tan(k) * t) / Math.abs(l))));
} else {
tmp = 2.0 / ((t * (Math.tan(k) * Math.sin(k))) * (t_1 * t_1));
}
return tmp;
}
def code(t, l, k): t_1 = k / math.fabs(l) tmp = 0 if math.fabs(l) <= 4e+70: tmp = 2.0 / (t_1 * ((math.sin(k) * k) * ((math.tan(k) * t) / math.fabs(l)))) else: tmp = 2.0 / ((t * (math.tan(k) * math.sin(k))) * (t_1 * t_1)) return tmp
function code(t, l, k) t_1 = Float64(k / abs(l)) tmp = 0.0 if (abs(l) <= 4e+70) tmp = Float64(2.0 / Float64(t_1 * Float64(Float64(sin(k) * k) * Float64(Float64(tan(k) * t) / abs(l))))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(tan(k) * sin(k))) * Float64(t_1 * t_1))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k / abs(l); tmp = 0.0; if (abs(l) <= 4e+70) tmp = 2.0 / (t_1 * ((sin(k) * k) * ((tan(k) * t) / abs(l)))); else tmp = 2.0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 4e+70], N[(2.0 / N[(t$95$1 * N[(N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision] * N[(N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{k}{\left|\ell\right|}\\
\mathbf{if}\;\left|\ell\right| \leq 4 \cdot 10^{+70}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(\left(\sin k \cdot k\right) \cdot \frac{\tan k \cdot t}{\left|\ell\right|}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(t\_1 \cdot t\_1\right)}\\
\end{array}
if l < 4.0000000000000003e70Initial 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
Applied rewrites93.6%
if 4.0000000000000003e70 < 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ k l) (* (* (sin k) k) (/ (* (tan k) t) l)))))
double code(double t, double l, double k) {
return 2.0 / ((k / l) * ((sin(k) * k) * ((tan(k) * t) / 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) * ((sin(k) * k) * ((tan(k) * t) / l)))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((k / l) * ((Math.sin(k) * k) * ((Math.tan(k) * t) / l)));
}
def code(t, l, k): return 2.0 / ((k / l) * ((math.sin(k) * k) * ((math.tan(k) * t) / l)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(k / l) * Float64(Float64(sin(k) * k) * Float64(Float64(tan(k) * t) / l)))) end
function tmp = code(t, l, k) tmp = 2.0 / ((k / l) * ((sin(k) * k) * ((tan(k) * t) / l))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(k / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision] * N[(N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{k}{\ell} \cdot \left(\left(\sin k \cdot k\right) \cdot \frac{\tan k \cdot t}{\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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
Applied rewrites93.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ k (fabs l))))
(if (<= (fabs l) 9.5e-163)
(/ 2.0 (* (* t (pow k 2.0)) (* t_1 t_1)))
(/
2.0
(*
(* (* (* (tan k) t) (sin k)) (/ k (* (fabs l) (fabs l))))
k)))))double code(double t, double l, double k) {
double t_1 = k / fabs(l);
double tmp;
if (fabs(l) <= 9.5e-163) {
tmp = 2.0 / ((t * pow(k, 2.0)) * (t_1 * t_1));
} else {
tmp = 2.0 / ((((tan(k) * t) * sin(k)) * (k / (fabs(l) * fabs(l)))) * k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = k / abs(l)
if (abs(l) <= 9.5d-163) then
tmp = 2.0d0 / ((t * (k ** 2.0d0)) * (t_1 * t_1))
else
tmp = 2.0d0 / ((((tan(k) * t) * sin(k)) * (k / (abs(l) * abs(l)))) * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k / Math.abs(l);
double tmp;
if (Math.abs(l) <= 9.5e-163) {
tmp = 2.0 / ((t * Math.pow(k, 2.0)) * (t_1 * t_1));
} else {
tmp = 2.0 / ((((Math.tan(k) * t) * Math.sin(k)) * (k / (Math.abs(l) * Math.abs(l)))) * k);
}
return tmp;
}
def code(t, l, k): t_1 = k / math.fabs(l) tmp = 0 if math.fabs(l) <= 9.5e-163: tmp = 2.0 / ((t * math.pow(k, 2.0)) * (t_1 * t_1)) else: tmp = 2.0 / ((((math.tan(k) * t) * math.sin(k)) * (k / (math.fabs(l) * math.fabs(l)))) * k) return tmp
function code(t, l, k) t_1 = Float64(k / abs(l)) tmp = 0.0 if (abs(l) <= 9.5e-163) tmp = Float64(2.0 / Float64(Float64(t * (k ^ 2.0)) * Float64(t_1 * t_1))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * t) * sin(k)) * Float64(k / Float64(abs(l) * abs(l)))) * k)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k / abs(l); tmp = 0.0; if (abs(l) <= 9.5e-163) tmp = 2.0 / ((t * (k ^ 2.0)) * (t_1 * t_1)); else tmp = 2.0 / ((((tan(k) * t) * sin(k)) * (k / (abs(l) * abs(l)))) * k); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 9.5e-163], N[(2.0 / N[(N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{k}{\left|\ell\right|}\\
\mathbf{if}\;\left|\ell\right| \leq 9.5 \cdot 10^{-163}:\\
\;\;\;\;\frac{2}{\left(t \cdot {k}^{2}\right) \cdot \left(t\_1 \cdot t\_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\tan k \cdot t\right) \cdot \sin k\right) \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right) \cdot k}\\
\end{array}
if l < 9.5000000000000001e-163Initial 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
Taylor expanded in k around 0
lower-pow.f6471.4%
Applied rewrites71.4%
if 9.5000000000000001e-163 < 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6478.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.0%
Applied rewrites79.0%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 0.0) (/ 2.0 (* (* t (pow k 2.0)) (* (/ k l) (/ k l)))) (/ 2.0 (* (tan k) (* (* (* (sin k) t) k) (/ k (* l l)))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / ((t * pow(k, 2.0)) * ((k / l) * (k / l)));
} else {
tmp = 2.0 / (tan(k) * (((sin(k) * t) * k) * (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) :: tmp
if ((l * l) <= 0.0d0) then
tmp = 2.0d0 / ((t * (k ** 2.0d0)) * ((k / l) * (k / l)))
else
tmp = 2.0d0 / (tan(k) * (((sin(k) * t) * k) * (k / (l * l))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / ((t * Math.pow(k, 2.0)) * ((k / l) * (k / l)));
} else {
tmp = 2.0 / (Math.tan(k) * (((Math.sin(k) * t) * k) * (k / (l * l))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 0.0: tmp = 2.0 / ((t * math.pow(k, 2.0)) * ((k / l) * (k / l))) else: tmp = 2.0 / (math.tan(k) * (((math.sin(k) * t) * k) * (k / (l * l)))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 0.0) tmp = Float64(2.0 / Float64(Float64(t * (k ^ 2.0)) * Float64(Float64(k / l) * Float64(k / l)))); else tmp = Float64(2.0 / Float64(tan(k) * Float64(Float64(Float64(sin(k) * t) * k) * Float64(k / Float64(l * l))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 0.0) tmp = 2.0 / ((t * (k ^ 2.0)) * ((k / l) * (k / l))); else tmp = 2.0 / (tan(k) * (((sin(k) * t) * k) * (k / (l * l)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 0.0], N[(2.0 / N[(N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * N[(k / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{2}{\left(t \cdot {k}^{2}\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\tan k \cdot \left(\left(\left(\sin k \cdot t\right) \cdot k\right) \cdot \frac{k}{\ell \cdot \ell}\right)}\\
\end{array}
if (*.f64 l l) < 0.0Initial 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
Taylor expanded in k around 0
lower-pow.f6471.4%
Applied rewrites71.4%
if 0.0 < (*.f64 l 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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-sin.f64N/A
Applied rewrites78.8%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* t (pow k 2.0)) (* (/ k l) (/ k l)))))
double code(double t, double l, double k) {
return 2.0 / ((t * pow(k, 2.0)) * ((k / l) * (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 / ((t * (k ** 2.0d0)) * ((k / l) * (k / l)))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((t * Math.pow(k, 2.0)) * ((k / l) * (k / l)));
}
def code(t, l, k): return 2.0 / ((t * math.pow(k, 2.0)) * ((k / l) * (k / l)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(t * (k ^ 2.0)) * Float64(Float64(k / l) * Float64(k / l)))) end
function tmp = code(t, l, k) tmp = 2.0 / ((t * (k ^ 2.0)) * ((k / l) * (k / l))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{2}{\left(t \cdot {k}^{2}\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\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.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.6%
Applied rewrites90.6%
Taylor expanded in k around 0
lower-pow.f6471.4%
Applied rewrites71.4%
(FPCore (t l k) :precision binary64 (/ (* (+ l l) (* (pow k -4.0) l)) t))
double code(double t, double l, double k) {
return ((l + l) * (pow(k, -4.0) * l)) / t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l + l) * ((k ** (-4.0d0)) * l)) / t
end function
public static double code(double t, double l, double k) {
return ((l + l) * (Math.pow(k, -4.0) * l)) / t;
}
def code(t, l, k): return ((l + l) * (math.pow(k, -4.0) * l)) / t
function code(t, l, k) return Float64(Float64(Float64(l + l) * Float64((k ^ -4.0) * l)) / t) end
function tmp = code(t, l, k) tmp = ((l + l) * ((k ^ -4.0) * l)) / t; end
code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[k, -4.0], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t}
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.5%
Applied rewrites62.5%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
mult-flipN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/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.1%
Applied rewrites68.1%
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
count-2-revN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6468.5%
Applied rewrites68.5%
(FPCore (t l k) :precision binary64 (* (+ l l) (* (/ (pow k -4.0) t) l)))
double code(double t, double l, double k) {
return (l + l) * ((pow(k, -4.0) / t) * 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 + l) * (((k ** (-4.0d0)) / t) * l)
end function
public static double code(double t, double l, double k) {
return (l + l) * ((Math.pow(k, -4.0) / t) * l);
}
def code(t, l, k): return (l + l) * ((math.pow(k, -4.0) / t) * l)
function code(t, l, k) return Float64(Float64(l + l) * Float64(Float64((k ^ -4.0) / t) * l)) end
function tmp = code(t, l, k) tmp = (l + l) * (((k ^ -4.0) / t) * l); end
code[t_, l_, k_] := N[(N[(l + l), $MachinePrecision] * N[(N[(N[Power[k, -4.0], $MachinePrecision] / t), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \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.5%
Applied rewrites62.5%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
mult-flipN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/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.1%
Applied rewrites68.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6468.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.1%
Applied rewrites68.1%
(FPCore (t l k) :precision binary64 (* (* (+ l l) l) (/ (pow k -4.0) t)))
double code(double t, double l, double k) {
return ((l + l) * l) * (pow(k, -4.0) / t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l + l) * l) * ((k ** (-4.0d0)) / t)
end function
public static double code(double t, double l, double k) {
return ((l + l) * l) * (Math.pow(k, -4.0) / t);
}
def code(t, l, k): return ((l + l) * l) * (math.pow(k, -4.0) / t)
function code(t, l, k) return Float64(Float64(Float64(l + l) * l) * Float64((k ^ -4.0) / t)) end
function tmp = code(t, l, k) tmp = ((l + l) * l) * ((k ^ -4.0) / t); end
code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] * l), $MachinePrecision] * N[(N[Power[k, -4.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\left(\left(\ell + \ell\right) \cdot \ell\right) \cdot \frac{{k}^{-4}}{t}
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.5%
Applied rewrites62.5%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
mult-flipN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/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.1%
Applied rewrites68.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6462.4%
Applied rewrites62.4%
herbie shell --seed 2025210
(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))))