
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ (pow (sin k) 2.0) l) (* (* k t) (/ k (* (cos k) l))))))
double code(double t, double l, double k) {
return 2.0 / ((pow(sin(k), 2.0) / l) * ((k * t) * (k / (cos(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 / (((sin(k) ** 2.0d0) / l) * ((k * t) * (k / (cos(k) * l))))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((Math.pow(Math.sin(k), 2.0) / l) * ((k * t) * (k / (Math.cos(k) * l))));
}
def code(t, l, k): return 2.0 / ((math.pow(math.sin(k), 2.0) / l) * ((k * t) * (k / (math.cos(k) * l))))
function code(t, l, k) return Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) / l) * Float64(Float64(k * t) * Float64(k / Float64(cos(k) * l))))) end
function tmp = code(t, l, k) tmp = 2.0 / (((sin(k) ^ 2.0) / l) * ((k * t) * (k / (cos(k) * l)))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * t), $MachinePrecision] * N[(k / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{{\sin k}^{2}}{\ell} \cdot \left(\left(k \cdot t\right) \cdot \frac{k}{\cos k \cdot \ell}\right)}
\end{array}
Initial program 39.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6475.0
Applied rewrites75.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.3%
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f6490.6
Applied rewrites90.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f6493.0
Applied rewrites93.0%
(FPCore (t l k)
:precision binary64
(if (<=
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(- (+ 1.0 (pow (/ k t) 2.0)) 1.0))
1e-46)
(/
2.0
(*
(* (* k k) t)
(* (/ (fma (* k k) -0.3333333333333333 1.0) (* l l)) (* k k))))
(/ 2.0 (/ (* (/ (pow k 4.0) l) t) l))))
double code(double t, double l, double k) {
double tmp;
if (((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0)) <= 1e-46) {
tmp = 2.0 / (((k * k) * t) * ((fma((k * k), -0.3333333333333333, 1.0) / (l * l)) * (k * k)));
} else {
tmp = 2.0 / (((pow(k, 4.0) / l) * t) / l);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (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)) <= 1e-46) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / Float64(l * l)) * Float64(k * k)))); else tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 4.0) / l) * t) / l)); end return tmp end
code[t_, l_, k_] := If[LessEqual[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], 1e-46], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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) \leq 10^{-46}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell \cdot \ell} \cdot \left(k \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{k}^{4}}{\ell} \cdot t}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) < 1.00000000000000002e-46Initial program 85.8%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6494.6
Applied rewrites94.6%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6487.1
Applied rewrites87.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
div-add-revN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6489.5
Applied rewrites89.5%
if 1.00000000000000002e-46 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) Initial program 9.6%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6459.9
Applied rewrites59.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6463.7
Applied rewrites63.7%
(FPCore (t l k)
:precision binary64
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(- (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
-5e-8)
(* -0.11666666666666667 (* l (/ l t)))
(/ 2.0 (* (/ (* (* k k) (* k k)) l) (/ t l)))))
double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0))) <= -5e-8) {
tmp = -0.11666666666666667 * (l * (l / t));
} else {
tmp = 2.0 / ((((k * k) * (k * k)) / l) * (t / 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 ((2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))) <= (-5d-8)) then
tmp = (-0.11666666666666667d0) * (l * (l / t))
else
tmp = 2.0d0 / ((((k * k) * (k * k)) / l) * (t / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((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))) <= -5e-8) {
tmp = -0.11666666666666667 * (l * (l / t));
} else {
tmp = 2.0 / ((((k * k) * (k * k)) / l) * (t / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (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))) <= -5e-8: tmp = -0.11666666666666667 * (l * (l / t)) else: tmp = 2.0 / ((((k * k) * (k * k)) / l) * (t / l)) return tmp
function code(t, l, k) tmp = 0.0 if (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))) <= -5e-8) tmp = Float64(-0.11666666666666667 * Float64(l * Float64(l / t))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * Float64(k * k)) / l) * Float64(t / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0))) <= -5e-8) tmp = -0.11666666666666667 * (l * (l / t)); else tmp = 2.0 / ((((k * k) * (k * k)) / l) * (t / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[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], -5e-8], N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq -5 \cdot 10^{-8}:\\
\;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < -4.9999999999999998e-8Initial program 80.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites46.3%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f645.7
Applied rewrites5.7%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f645.7
Applied rewrites5.7%
if -4.9999999999999998e-8 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 32.0%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6467.7
Applied rewrites67.7%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6467.7
Applied rewrites67.7%
(FPCore (t l k)
:precision binary64
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(- (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
-5e-8)
(* -0.11666666666666667 (* l (/ l t)))
(/ 2.0 (* (* (* k k) t) (/ (* k k) (* l l))))))
double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0))) <= -5e-8) {
tmp = -0.11666666666666667 * (l * (l / t));
} else {
tmp = 2.0 / (((k * 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 ((2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))) <= (-5d-8)) then
tmp = (-0.11666666666666667d0) * (l * (l / t))
else
tmp = 2.0d0 / (((k * 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 ((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))) <= -5e-8) {
tmp = -0.11666666666666667 * (l * (l / t));
} else {
tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (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))) <= -5e-8: tmp = -0.11666666666666667 * (l * (l / t)) else: tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l))) return tmp
function code(t, l, k) tmp = 0.0 if (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))) <= -5e-8) tmp = Float64(-0.11666666666666667 * Float64(l * Float64(l / t))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(k * k) / Float64(l * l)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0))) <= -5e-8) tmp = -0.11666666666666667 * (l * (l / t)); else tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[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], -5e-8], N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq -5 \cdot 10^{-8}:\\
\;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k \cdot k}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < -4.9999999999999998e-8Initial program 80.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites46.3%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f645.7
Applied rewrites5.7%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f645.7
Applied rewrites5.7%
if -4.9999999999999998e-8 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 32.0%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.9
Applied rewrites71.9%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6463.7
Applied rewrites63.7%
Taylor expanded in k around 0
pow2N/A
lift-*.f6463.5
Applied rewrites63.5%
(FPCore (t l k)
:precision binary64
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(- (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
-5e-8)
(* -0.11666666666666667 (* l (/ l t)))
(* (/ 2.0 (* (* k k) t)) (/ (* l l) (* k k)))))
double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0))) <= -5e-8) {
tmp = -0.11666666666666667 * (l * (l / t));
} else {
tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))) <= (-5d-8)) then
tmp = (-0.11666666666666667d0) * (l * (l / t))
else
tmp = (2.0d0 / ((k * k) * t)) * ((l * l) / (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((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))) <= -5e-8) {
tmp = -0.11666666666666667 * (l * (l / t));
} else {
tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (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))) <= -5e-8: tmp = -0.11666666666666667 * (l * (l / t)) else: tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (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))) <= -5e-8) tmp = Float64(-0.11666666666666667 * Float64(l * Float64(l / t))); else tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l * l) / Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0))) <= -5e-8) tmp = -0.11666666666666667 * (l * (l / t)); else tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[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], -5e-8], N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq -5 \cdot 10^{-8}:\\
\;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < -4.9999999999999998e-8Initial program 80.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites46.3%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f645.7
Applied rewrites5.7%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f645.7
Applied rewrites5.7%
if -4.9999999999999998e-8 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 32.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6471.7
Applied rewrites71.7%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6463.3
Applied rewrites63.3%
(FPCore (t l k)
:precision binary64
(if (<= k 3.6e-6)
(/
2.0
(*
(* (/ (fma (* k k) -0.3333333333333333 1.0) l) (* k k))
(* (/ (* k k) l) (/ t (cos k)))))
(if (<= k 4.1e+238)
(*
(/ (/ 2.0 k) (* k t))
(/ (* (cos k) (* l l)) (- 0.5 (* 0.5 (cos (* 2.0 k))))))
(/ 2.0 (/ (* (/ (pow k 4.0) l) t) l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.6e-6) {
tmp = 2.0 / (((fma((k * k), -0.3333333333333333, 1.0) / l) * (k * k)) * (((k * k) / l) * (t / cos(k))));
} else if (k <= 4.1e+238) {
tmp = ((2.0 / k) / (k * t)) * ((cos(k) * (l * l)) / (0.5 - (0.5 * cos((2.0 * k)))));
} else {
tmp = 2.0 / (((pow(k, 4.0) / l) * t) / l);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.6e-6) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / l) * Float64(k * k)) * Float64(Float64(Float64(k * k) / l) * Float64(t / cos(k))))); elseif (k <= 4.1e+238) tmp = Float64(Float64(Float64(2.0 / k) / Float64(k * t)) * Float64(Float64(cos(k) * Float64(l * l)) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))))); else tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 4.0) / l) * t) / l)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.6e-6], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.1e+238], N[(N[(N[(2.0 / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell} \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{k \cdot k}{\ell} \cdot \frac{t}{\cos k}\right)}\\
\mathbf{elif}\;k \leq 4.1 \cdot 10^{+238}:\\
\;\;\;\;\frac{\frac{2}{k}}{k \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{k}^{4}}{\ell} \cdot t}{\ell}}\\
\end{array}
\end{array}
if k < 3.59999999999999984e-6Initial program 40.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.0
Applied rewrites74.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
inv-powN/A
lower-pow.f64N/A
pow2N/A
lift-*.f6477.6
Applied rewrites77.6%
Applied rewrites81.4%
if 3.59999999999999984e-6 < k < 4.0999999999999999e238Initial program 27.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6483.9
Applied rewrites83.9%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f6489.4
Applied rewrites89.4%
if 4.0999999999999999e238 < k Initial program 63.6%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6465.4
Applied rewrites65.4%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6465.4
Applied rewrites65.4%
(FPCore (t l k)
:precision binary64
(if (<= k 3.6e-6)
(/
2.0
(*
(* (/ (fma (* k k) -0.3333333333333333 1.0) l) (* k k))
(* (/ (* k k) l) (/ t (cos k)))))
(if (<= k 3.1e+238)
(*
(/ 2.0 (* (* k t) k))
(/ (* (cos k) (* l l)) (- 0.5 (* 0.5 (cos (* 2.0 k))))))
(/ 2.0 (/ (* (/ (pow k 4.0) l) t) l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.6e-6) {
tmp = 2.0 / (((fma((k * k), -0.3333333333333333, 1.0) / l) * (k * k)) * (((k * k) / l) * (t / cos(k))));
} else if (k <= 3.1e+238) {
tmp = (2.0 / ((k * t) * k)) * ((cos(k) * (l * l)) / (0.5 - (0.5 * cos((2.0 * k)))));
} else {
tmp = 2.0 / (((pow(k, 4.0) / l) * t) / l);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.6e-6) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / l) * Float64(k * k)) * Float64(Float64(Float64(k * k) / l) * Float64(t / cos(k))))); elseif (k <= 3.1e+238) tmp = Float64(Float64(2.0 / Float64(Float64(k * t) * k)) * Float64(Float64(cos(k) * Float64(l * l)) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))))); else tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 4.0) / l) * t) / l)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.6e-6], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3.1e+238], N[(N[(2.0 / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell} \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{k \cdot k}{\ell} \cdot \frac{t}{\cos k}\right)}\\
\mathbf{elif}\;k \leq 3.1 \cdot 10^{+238}:\\
\;\;\;\;\frac{2}{\left(k \cdot t\right) \cdot k} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{k}^{4}}{\ell} \cdot t}{\ell}}\\
\end{array}
\end{array}
if k < 3.59999999999999984e-6Initial program 40.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.0
Applied rewrites74.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
inv-powN/A
lower-pow.f64N/A
pow2N/A
lift-*.f6477.6
Applied rewrites77.6%
Applied rewrites81.4%
if 3.59999999999999984e-6 < k < 3.10000000000000012e238Initial program 27.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6483.9
Applied rewrites83.9%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6489.6
Applied rewrites89.6%
if 3.10000000000000012e238 < k Initial program 63.6%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6465.4
Applied rewrites65.4%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6465.4
Applied rewrites65.4%
(FPCore (t l k)
:precision binary64
(if (<= k 3.6e-6)
(/
2.0
(*
(* (/ (fma (* k k) -0.3333333333333333 1.0) l) (* k k))
(* (/ (* k k) l) (/ t (cos k)))))
(/
2.0
(*
(/ (- 0.5 (* 0.5 (cos (* 2.0 k)))) l)
(/ (* (* k t) k) (* (cos k) l))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.6e-6) {
tmp = 2.0 / (((fma((k * k), -0.3333333333333333, 1.0) / l) * (k * k)) * (((k * k) / l) * (t / cos(k))));
} else {
tmp = 2.0 / (((0.5 - (0.5 * cos((2.0 * k)))) / l) * (((k * t) * k) / (cos(k) * l)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.6e-6) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / l) * Float64(k * k)) * Float64(Float64(Float64(k * k) / l) * Float64(t / cos(k))))); else tmp = Float64(2.0 / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) / l) * Float64(Float64(Float64(k * t) * k) / Float64(cos(k) * l)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.6e-6], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell} \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{k \cdot k}{\ell} \cdot \frac{t}{\cos k}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{\ell} \cdot \frac{\left(k \cdot t\right) \cdot k}{\cos k \cdot \ell}}\\
\end{array}
\end{array}
if k < 3.59999999999999984e-6Initial program 40.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.0
Applied rewrites74.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
inv-powN/A
lower-pow.f64N/A
pow2N/A
lift-*.f6477.6
Applied rewrites77.6%
Applied rewrites81.4%
if 3.59999999999999984e-6 < k Initial program 35.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6479.2
Applied rewrites79.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites81.8%
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f6489.9
Applied rewrites89.9%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6489.8
Applied rewrites89.8%
(FPCore (t l k)
:precision binary64
(if (<= k 3.6e-6)
(/
2.0
(*
(* (/ (fma (* k k) -0.3333333333333333 1.0) l) (* k k))
(* (/ (* k k) l) (/ t (cos k)))))
(if (<= k 2.35e+138)
(*
(/ 2.0 (* (* k k) t))
(/ (* (cos k) (* l l)) (- 0.5 (* 0.5 (cos (+ k k))))))
(/ 2.0 (* (/ (pow (sin k) 2.0) l) (/ (* (* k t) k) l))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.6e-6) {
tmp = 2.0 / (((fma((k * k), -0.3333333333333333, 1.0) / l) * (k * k)) * (((k * k) / l) * (t / cos(k))));
} else if (k <= 2.35e+138) {
tmp = (2.0 / ((k * k) * t)) * ((cos(k) * (l * l)) / (0.5 - (0.5 * cos((k + k)))));
} else {
tmp = 2.0 / ((pow(sin(k), 2.0) / l) * (((k * t) * k) / l));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.6e-6) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / l) * Float64(k * k)) * Float64(Float64(Float64(k * k) / l) * Float64(t / cos(k))))); elseif (k <= 2.35e+138) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(cos(k) * Float64(l * l)) / Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))))); else tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) / l) * Float64(Float64(Float64(k * t) * k) / l))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.6e-6], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.35e+138], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell} \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{k \cdot k}{\ell} \cdot \frac{t}{\cos k}\right)}\\
\mathbf{elif}\;k \leq 2.35 \cdot 10^{+138}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{0.5 - 0.5 \cdot \cos \left(k + k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2}}{\ell} \cdot \frac{\left(k \cdot t\right) \cdot k}{\ell}}\\
\end{array}
\end{array}
if k < 3.59999999999999984e-6Initial program 40.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.0
Applied rewrites74.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
inv-powN/A
lower-pow.f64N/A
pow2N/A
lift-*.f6477.6
Applied rewrites77.6%
Applied rewrites81.4%
if 3.59999999999999984e-6 < k < 2.3499999999999999e138Initial program 20.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6492.0
Applied rewrites92.0%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6491.9
Applied rewrites91.9%
lift-*.f64N/A
count-2-revN/A
lower-+.f6491.9
Applied rewrites91.9%
if 2.3499999999999999e138 < k Initial program 52.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6465.4
Applied rewrites65.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites66.5%
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f6483.4
Applied rewrites83.4%
Taylor expanded in k around 0
*-commutative67.2
Applied rewrites67.2%
(FPCore (t l k)
:precision binary64
(if (<= l 1.3e+186)
(/
2.0
(*
(* (/ (fma (* k k) -0.3333333333333333 1.0) l) (* k k))
(* (/ (* k k) l) (/ t (cos k)))))
(* (/ 2.0 (* k (* k t))) (/ (* (cos k) (* l l)) (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (l <= 1.3e+186) {
tmp = 2.0 / (((fma((k * k), -0.3333333333333333, 1.0) / l) * (k * k)) * (((k * k) / l) * (t / cos(k))));
} else {
tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l * l)) / (k * k));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (l <= 1.3e+186) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / l) * Float64(k * k)) * Float64(Float64(Float64(k * k) / l) * Float64(t / cos(k))))); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(cos(k) * Float64(l * l)) / Float64(k * k))); end return tmp end
code[t_, l_, k_] := If[LessEqual[l, 1.3e+186], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.3 \cdot 10^{+186}:\\
\;\;\;\;\frac{2}{\left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell} \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{k \cdot k}{\ell} \cdot \frac{t}{\cos k}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{k \cdot k}\\
\end{array}
\end{array}
if l < 1.3e186Initial program 36.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6473.5
Applied rewrites73.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
inv-powN/A
lower-pow.f64N/A
pow2N/A
lift-*.f6473.9
Applied rewrites73.9%
Applied rewrites77.3%
if 1.3e186 < l Initial program 65.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6488.5
Applied rewrites88.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6488.5
Applied rewrites88.5%
Taylor expanded in k around 0
unpow2N/A
sqr-sin-a-revN/A
pow2N/A
lift-*.f6488.5
Applied rewrites88.5%
(FPCore (t l k) :precision binary64 (if (<= l 2.8e-171) (/ 2.0 (/ (* (/ (pow k 4.0) l) t) l)) (* (/ 2.0 (* k (* k t))) (/ (* (cos k) (* l l)) (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (l <= 2.8e-171) {
tmp = 2.0 / (((pow(k, 4.0) / l) * t) / l);
} else {
tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l * l)) / (k * k));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 2.8d-171) then
tmp = 2.0d0 / ((((k ** 4.0d0) / l) * t) / l)
else
tmp = (2.0d0 / (k * (k * t))) * ((cos(k) * (l * l)) / (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 2.8e-171) {
tmp = 2.0 / (((Math.pow(k, 4.0) / l) * t) / l);
} else {
tmp = (2.0 / (k * (k * t))) * ((Math.cos(k) * (l * l)) / (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 2.8e-171: tmp = 2.0 / (((math.pow(k, 4.0) / l) * t) / l) else: tmp = (2.0 / (k * (k * t))) * ((math.cos(k) * (l * l)) / (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 2.8e-171) tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 4.0) / l) * t) / l)); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(cos(k) * Float64(l * l)) / Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 2.8e-171) tmp = 2.0 / ((((k ^ 4.0) / l) * t) / l); else tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l * l)) / (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 2.8e-171], N[(2.0 / N[(N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.8 \cdot 10^{-171}:\\
\;\;\;\;\frac{2}{\frac{\frac{{k}^{4}}{\ell} \cdot t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{k \cdot k}\\
\end{array}
\end{array}
if l < 2.80000000000000023e-171Initial program 31.7%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6467.9
Applied rewrites67.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6470.9
Applied rewrites70.9%
if 2.80000000000000023e-171 < l Initial program 49.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6486.9
Applied rewrites86.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6490.4
Applied rewrites90.4%
Taylor expanded in k around 0
unpow2N/A
sqr-sin-a-revN/A
pow2N/A
lift-*.f6475.7
Applied rewrites75.7%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ (* k k) l) (/ (* (* k t) k) (* (cos k) l)))))
double code(double t, double l, double k) {
return 2.0 / (((k * k) / l) * (((k * t) * k) / (cos(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 * k) / l) * (((k * t) * k) / (cos(k) * l)))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((k * k) / l) * (((k * t) * k) / (Math.cos(k) * l)));
}
def code(t, l, k): return 2.0 / (((k * k) / l) * (((k * t) * k) / (math.cos(k) * l)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(k * k) / l) * Float64(Float64(Float64(k * t) * k) / Float64(cos(k) * l)))) end
function tmp = code(t, l, k) tmp = 2.0 / (((k * k) / l) * (((k * t) * k) / (cos(k) * l))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{k \cdot k}{\ell} \cdot \frac{\left(k \cdot t\right) \cdot k}{\cos k \cdot \ell}}
\end{array}
Initial program 39.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6475.0
Applied rewrites75.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.3%
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f6490.6
Applied rewrites90.6%
Taylor expanded in k around 0
pow2N/A
lift-*.f6478.1
Applied rewrites78.1%
(FPCore (t l k)
:precision binary64
(if (<= (* l l) 4e-298)
(/ 2.0 (* (/ (pow k 4.0) l) (/ t l)))
(/
2.0
(*
(* (* k k) t)
(* (/ (fma (* k k) -0.3333333333333333 1.0) (* l l)) (* k k))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 4e-298) {
tmp = 2.0 / ((pow(k, 4.0) / l) * (t / l));
} else {
tmp = 2.0 / (((k * k) * t) * ((fma((k * k), -0.3333333333333333, 1.0) / (l * l)) * (k * k)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 4e-298) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l) * Float64(t / l))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / Float64(l * l)) * Float64(k * k)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 4e-298], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 4 \cdot 10^{-298}:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell \cdot \ell} \cdot \left(k \cdot k\right)\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 3.99999999999999965e-298Initial program 20.6%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6469.5
Applied rewrites69.5%
if 3.99999999999999965e-298 < (*.f64 l l) Initial program 46.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6483.2
Applied rewrites83.2%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6471.8
Applied rewrites71.8%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
div-add-revN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6472.4
Applied rewrites72.4%
(FPCore (t l k)
:precision binary64
(if (<= l 8e-155)
(/ 2.0 (* (/ (* (* k k) (* k k)) l) (/ t l)))
(/
2.0
(*
(* (* k k) t)
(* (/ (fma (* k k) -0.3333333333333333 1.0) (* l l)) (* k k))))))
double code(double t, double l, double k) {
double tmp;
if (l <= 8e-155) {
tmp = 2.0 / ((((k * k) * (k * k)) / l) * (t / l));
} else {
tmp = 2.0 / (((k * k) * t) * ((fma((k * k), -0.3333333333333333, 1.0) / (l * l)) * (k * k)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (l <= 8e-155) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * Float64(k * k)) / l) * Float64(t / l))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(fma(Float64(k * k), -0.3333333333333333, 1.0) / Float64(l * l)) * Float64(k * k)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[l, 8e-155], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 8 \cdot 10^{-155}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 1\right)}{\ell \cdot \ell} \cdot \left(k \cdot k\right)\right)}\\
\end{array}
\end{array}
if l < 8.00000000000000011e-155Initial program 31.7%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6467.9
Applied rewrites67.9%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6467.9
Applied rewrites67.9%
if 8.00000000000000011e-155 < l Initial program 50.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6487.8
Applied rewrites87.8%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6473.1
Applied rewrites73.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
div-add-revN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6474.3
Applied rewrites74.3%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (/ (* l l) t)))
double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * ((l * l) / t)
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
def code(t, l, k): return -0.11666666666666667 * ((l * l) / t)
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(Float64(l * l) / t)) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * ((l * l) / t); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t}
\end{array}
Initial program 39.3%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites31.7%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f6418.2
Applied rewrites18.2%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (* l (/ l t))))
double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * (l * (l / t))
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
def code(t, l, k): return -0.11666666666666667 * (l * (l / t))
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(l * Float64(l / t))) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * (l * (l / t)); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)
\end{array}
Initial program 39.3%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites31.7%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f6418.2
Applied rewrites18.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6416.0
Applied rewrites16.0%
herbie shell --seed 2025043
(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))))