
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / 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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / 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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h)))
(t_1 (* (* l d_m) t_0))
(t_2 (/ (* D_m M_m) (+ d_m d_m))))
(if (<= l -2.0)
(fma (/ (* (* (* (* M_m M_m) h) D_m) D_m) t_1) -0.125 (/ d_m t_0))
(if (<= l 6e+67)
(*
(/ (fabs d_m) (sqrt (* h l)))
(- 1.0 (* (* (* t_2 t_2) 0.5) (/ h l))))
(fma
(* (/ (* (* D_m M_m) (* D_m M_m)) t_1) -0.125)
h
(* (/ d_m (* (sqrt l) (sqrt h))) 1.0))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double t_1 = (l * d_m) * t_0;
double t_2 = (D_m * M_m) / (d_m + d_m);
double tmp;
if (l <= -2.0) {
tmp = fma((((((M_m * M_m) * h) * D_m) * D_m) / t_1), -0.125, (d_m / t_0));
} else if (l <= 6e+67) {
tmp = (fabs(d_m) / sqrt((h * l))) * (1.0 - (((t_2 * t_2) * 0.5) * (h / l)));
} else {
tmp = fma(((((D_m * M_m) * (D_m * M_m)) / t_1) * -0.125), h, ((d_m / (sqrt(l) * sqrt(h))) * 1.0));
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) t_1 = Float64(Float64(l * d_m) * t_0) t_2 = Float64(Float64(D_m * M_m) / Float64(d_m + d_m)) tmp = 0.0 if (l <= -2.0) tmp = fma(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / t_1), -0.125, Float64(d_m / t_0)); elseif (l <= 6e+67) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * Float64(1.0 - Float64(Float64(Float64(t_2 * t_2) * 0.5) * Float64(h / l)))); else tmp = fma(Float64(Float64(Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) / t_1) * -0.125), h, Float64(Float64(d_m / Float64(sqrt(l) * sqrt(h))) * 1.0)); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(d$95$m + d$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.0], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / t$95$1), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+67], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$2 * t$95$2), $MachinePrecision] * 0.5), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * -0.125), $MachinePrecision] * h + N[(N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \left(\ell \cdot d\_m\right) \cdot t\_0\\
t_2 := \frac{D\_m \cdot M\_m}{d\_m + d\_m}\\
\mathbf{if}\;\ell \leq -2:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{t\_1}, -0.125, \frac{d\_m}{t\_0}\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+67}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(t\_2 \cdot t\_2\right) \cdot 0.5\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{t\_1} \cdot -0.125, h, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}} \cdot 1\right)\\
\end{array}
\end{array}
if l < -2Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around 0
*-commutativeN/A
sqrt-prodN/A
mult-flipN/A
metadata-evalN/A
sqrt-divN/A
lower-fma.f64N/A
Applied rewrites60.0%
if -2 < l < 6.0000000000000002e67Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Applied rewrites68.9%
lift-+.f64N/A
lift-/.f64N/A
lower-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f6468.5
Applied rewrites68.5%
lift-+.f64N/A
lift-/.f64N/A
lower-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f6469.8
Applied rewrites69.8%
if 6.0000000000000002e67 < l Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in d around 0
lower-/.f64N/A
pow-prod-downN/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lower-*.f6436.7
Applied rewrites36.7%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h)))
(t_1 (* (* l d_m) t_0))
(t_2 (* M_m (/ D_m (+ d_m d_m)))))
(if (<= l -2.0)
(fma (/ (* (* (* (* M_m M_m) h) D_m) D_m) t_1) -0.125 (/ d_m t_0))
(if (<= l 6e+67)
(*
(/ (fabs d_m) (sqrt (* h l)))
(- 1.0 (* (* (* t_2 t_2) 0.5) (/ h l))))
(fma
(* (/ (* (* D_m M_m) (* D_m M_m)) t_1) -0.125)
h
(* (/ d_m (* (sqrt l) (sqrt h))) 1.0))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double t_1 = (l * d_m) * t_0;
double t_2 = M_m * (D_m / (d_m + d_m));
double tmp;
if (l <= -2.0) {
tmp = fma((((((M_m * M_m) * h) * D_m) * D_m) / t_1), -0.125, (d_m / t_0));
} else if (l <= 6e+67) {
tmp = (fabs(d_m) / sqrt((h * l))) * (1.0 - (((t_2 * t_2) * 0.5) * (h / l)));
} else {
tmp = fma(((((D_m * M_m) * (D_m * M_m)) / t_1) * -0.125), h, ((d_m / (sqrt(l) * sqrt(h))) * 1.0));
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) t_1 = Float64(Float64(l * d_m) * t_0) t_2 = Float64(M_m * Float64(D_m / Float64(d_m + d_m))) tmp = 0.0 if (l <= -2.0) tmp = fma(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / t_1), -0.125, Float64(d_m / t_0)); elseif (l <= 6e+67) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * Float64(1.0 - Float64(Float64(Float64(t_2 * t_2) * 0.5) * Float64(h / l)))); else tmp = fma(Float64(Float64(Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) / t_1) * -0.125), h, Float64(Float64(d_m / Float64(sqrt(l) * sqrt(h))) * 1.0)); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(M$95$m * N[(D$95$m / N[(d$95$m + d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.0], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / t$95$1), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+67], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$2 * t$95$2), $MachinePrecision] * 0.5), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * -0.125), $MachinePrecision] * h + N[(N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \left(\ell \cdot d\_m\right) \cdot t\_0\\
t_2 := M\_m \cdot \frac{D\_m}{d\_m + d\_m}\\
\mathbf{if}\;\ell \leq -2:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{t\_1}, -0.125, \frac{d\_m}{t\_0}\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+67}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(t\_2 \cdot t\_2\right) \cdot 0.5\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{t\_1} \cdot -0.125, h, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}} \cdot 1\right)\\
\end{array}
\end{array}
if l < -2Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around 0
*-commutativeN/A
sqrt-prodN/A
mult-flipN/A
metadata-evalN/A
sqrt-divN/A
lower-fma.f64N/A
Applied rewrites60.0%
if -2 < l < 6.0000000000000002e67Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Applied rewrites68.9%
if 6.0000000000000002e67 < l Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in d around 0
lower-/.f64N/A
pow-prod-downN/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lower-*.f6436.7
Applied rewrites36.7%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h)))
(t_1 (* (* l d_m) t_0))
(t_2 (* (* D_m M_m) (* D_m M_m))))
(if (<= l -2.0)
(fma (/ (* (* (* (* M_m M_m) h) D_m) D_m) t_1) -0.125 (/ d_m t_0))
(if (<= l 9.5e-166)
(*
(/ (fabs d_m) (sqrt (* h l)))
(- 1.0 (/ (* (* (/ t_2 (* (+ d_m d_m) (+ d_m d_m))) 0.5) h) l)))
(fma (* (/ t_2 t_1) -0.125) h (* (/ d_m (* (sqrt l) (sqrt h))) 1.0))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double t_1 = (l * d_m) * t_0;
double t_2 = (D_m * M_m) * (D_m * M_m);
double tmp;
if (l <= -2.0) {
tmp = fma((((((M_m * M_m) * h) * D_m) * D_m) / t_1), -0.125, (d_m / t_0));
} else if (l <= 9.5e-166) {
tmp = (fabs(d_m) / sqrt((h * l))) * (1.0 - ((((t_2 / ((d_m + d_m) * (d_m + d_m))) * 0.5) * h) / l));
} else {
tmp = fma(((t_2 / t_1) * -0.125), h, ((d_m / (sqrt(l) * sqrt(h))) * 1.0));
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) t_1 = Float64(Float64(l * d_m) * t_0) t_2 = Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) tmp = 0.0 if (l <= -2.0) tmp = fma(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / t_1), -0.125, Float64(d_m / t_0)); elseif (l <= 9.5e-166) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * Float64(1.0 - Float64(Float64(Float64(Float64(t_2 / Float64(Float64(d_m + d_m) * Float64(d_m + d_m))) * 0.5) * h) / l))); else tmp = fma(Float64(Float64(t_2 / t_1) * -0.125), h, Float64(Float64(d_m / Float64(sqrt(l) * sqrt(h))) * 1.0)); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.0], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / t$95$1), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.5e-166], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(t$95$2 / N[(N[(d$95$m + d$95$m), $MachinePrecision] * N[(d$95$m + d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 / t$95$1), $MachinePrecision] * -0.125), $MachinePrecision] * h + N[(N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \left(\ell \cdot d\_m\right) \cdot t\_0\\
t_2 := \left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)\\
\mathbf{if}\;\ell \leq -2:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{t\_1}, -0.125, \frac{d\_m}{t\_0}\right)\\
\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \left(1 - \frac{\left(\frac{t\_2}{\left(d\_m + d\_m\right) \cdot \left(d\_m + d\_m\right)} \cdot 0.5\right) \cdot h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_2}{t\_1} \cdot -0.125, h, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}} \cdot 1\right)\\
\end{array}
\end{array}
if l < -2Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around 0
*-commutativeN/A
sqrt-prodN/A
mult-flipN/A
metadata-evalN/A
sqrt-divN/A
lower-fma.f64N/A
Applied rewrites60.0%
if -2 < l < 9.50000000000000046e-166Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Applied rewrites68.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites61.3%
if 9.50000000000000046e-166 < l Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in d around 0
lower-/.f64N/A
pow-prod-downN/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lower-*.f6436.7
Applied rewrites36.7%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (* (* D_m M_m) (* D_m M_m)))
(t_1 (sqrt (* l h)))
(t_2 (* (* l d_m) t_1)))
(if (<= l -2.0)
(fma (/ (* (* (* (* M_m M_m) h) D_m) D_m) t_2) -0.125 (/ d_m t_1))
(if (<= l 1.15e-170)
(*
(/ (fabs d_m) (sqrt (* h l)))
(fma (* (/ t_0 (* (* d_m d_m) l)) -0.125) h 1.0))
(fma (* (/ t_0 t_2) -0.125) h (* (/ d_m (* (sqrt l) (sqrt h))) 1.0))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = (D_m * M_m) * (D_m * M_m);
double t_1 = sqrt((l * h));
double t_2 = (l * d_m) * t_1;
double tmp;
if (l <= -2.0) {
tmp = fma((((((M_m * M_m) * h) * D_m) * D_m) / t_2), -0.125, (d_m / t_1));
} else if (l <= 1.15e-170) {
tmp = (fabs(d_m) / sqrt((h * l))) * fma(((t_0 / ((d_m * d_m) * l)) * -0.125), h, 1.0);
} else {
tmp = fma(((t_0 / t_2) * -0.125), h, ((d_m / (sqrt(l) * sqrt(h))) * 1.0));
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) t_1 = sqrt(Float64(l * h)) t_2 = Float64(Float64(l * d_m) * t_1) tmp = 0.0 if (l <= -2.0) tmp = fma(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / t_2), -0.125, Float64(d_m / t_1)); elseif (l <= 1.15e-170) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * fma(Float64(Float64(t_0 / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0)); else tmp = fma(Float64(Float64(t_0 / t_2) * -0.125), h, Float64(Float64(d_m / Float64(sqrt(l) * sqrt(h))) * 1.0)); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * d$95$m), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[l, -2.0], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / t$95$2), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.15e-170], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$0 / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$0 / t$95$2), $MachinePrecision] * -0.125), $MachinePrecision] * h + N[(N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)\\
t_1 := \sqrt{\ell \cdot h}\\
t_2 := \left(\ell \cdot d\_m\right) \cdot t\_1\\
\mathbf{if}\;\ell \leq -2:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{t\_2}, -0.125, \frac{d\_m}{t\_1}\right)\\
\mathbf{elif}\;\ell \leq 1.15 \cdot 10^{-170}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(\frac{t\_0}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0}{t\_2} \cdot -0.125, h, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}} \cdot 1\right)\\
\end{array}
\end{array}
if l < -2Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around 0
*-commutativeN/A
sqrt-prodN/A
mult-flipN/A
metadata-evalN/A
sqrt-divN/A
lower-fma.f64N/A
Applied rewrites60.0%
if -2 < l < 1.14999999999999993e-170Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Applied rewrites68.9%
Taylor expanded in h around inf
Applied rewrites60.4%
if 1.14999999999999993e-170 < l Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in d around 0
lower-/.f64N/A
pow-prod-downN/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lower-*.f6436.7
Applied rewrites36.7%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))) (t_1 (/ d_m t_0)))
(if (<= (* M_m D_m) 5e-178)
t_1
(if (<= (* M_m D_m) 1.5e+106)
(*
(/ (fabs d_m) (sqrt (* h l)))
(fma
(* (/ (* (* D_m M_m) (* D_m M_m)) (* (* d_m d_m) l)) -0.125)
h
1.0))
(if (<= (* M_m D_m) 1e+202)
(fma
(/ (* (* (* (* M_m M_m) h) D_m) D_m) (* (* l d_m) t_0))
-0.125
t_1)
(/
(* (* (* D_m D_m) (/ (* M_m M_m) (/ (* l d_m) t_0))) -0.125)
l))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double t_1 = d_m / t_0;
double tmp;
if ((M_m * D_m) <= 5e-178) {
tmp = t_1;
} else if ((M_m * D_m) <= 1.5e+106) {
tmp = (fabs(d_m) / sqrt((h * l))) * fma(((((D_m * M_m) * (D_m * M_m)) / ((d_m * d_m) * l)) * -0.125), h, 1.0);
} else if ((M_m * D_m) <= 1e+202) {
tmp = fma((((((M_m * M_m) * h) * D_m) * D_m) / ((l * d_m) * t_0)), -0.125, t_1);
} else {
tmp = (((D_m * D_m) * ((M_m * M_m) / ((l * d_m) / t_0))) * -0.125) / l;
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) t_1 = Float64(d_m / t_0) tmp = 0.0 if (Float64(M_m * D_m) <= 5e-178) tmp = t_1; elseif (Float64(M_m * D_m) <= 1.5e+106) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * fma(Float64(Float64(Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0)); elseif (Float64(M_m * D_m) <= 1e+202) tmp = fma(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / Float64(Float64(l * d_m) * t_0)), -0.125, t_1); else tmp = Float64(Float64(Float64(Float64(D_m * D_m) * Float64(Float64(M_m * M_m) / Float64(Float64(l * d_m) / t_0))) * -0.125) / l); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(d$95$m / t$95$0), $MachinePrecision]}, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 5e-178], t$95$1, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 1.5e+106], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 1e+202], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * -0.125 + t$95$1), $MachinePrecision], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \frac{d\_m}{t\_0}\\
\mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{-178}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;M\_m \cdot D\_m \leq 1.5 \cdot 10^{+106}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(\frac{\left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
\mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+202}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{\left(\ell \cdot d\_m\right) \cdot t\_0}, -0.125, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{\frac{\ell \cdot d\_m}{t\_0}}\right) \cdot -0.125}{\ell}\\
\end{array}
\end{array}
if (*.f64 M D) < 4.99999999999999976e-178Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 4.99999999999999976e-178 < (*.f64 M D) < 1.5e106Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Applied rewrites68.9%
Taylor expanded in h around inf
Applied rewrites60.4%
if 1.5e106 < (*.f64 M D) < 9.999999999999999e201Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around 0
*-commutativeN/A
sqrt-prodN/A
mult-flipN/A
metadata-evalN/A
sqrt-divN/A
lower-fma.f64N/A
Applied rewrites60.0%
if 9.999999999999999e201 < (*.f64 M D) Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites29.3%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (* (* D_m M_m) (* D_m M_m)))
(t_1 (sqrt (* l h)))
(t_2 (sqrt (/ l h))))
(if (<= l -2.0)
(fma
(/ (* (* (* (* M_m M_m) h) D_m) D_m) (* (* l d_m) t_1))
-0.125
(/ d_m t_1))
(if (<= l 6.2e-208)
(*
(/ (fabs d_m) (sqrt (* h l)))
(fma (* (/ t_0 (* (* d_m d_m) l)) -0.125) h 1.0))
(fma (/ t_0 (* (* t_2 l) d_m)) -0.125 (/ d_m (* t_2 h)))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = (D_m * M_m) * (D_m * M_m);
double t_1 = sqrt((l * h));
double t_2 = sqrt((l / h));
double tmp;
if (l <= -2.0) {
tmp = fma((((((M_m * M_m) * h) * D_m) * D_m) / ((l * d_m) * t_1)), -0.125, (d_m / t_1));
} else if (l <= 6.2e-208) {
tmp = (fabs(d_m) / sqrt((h * l))) * fma(((t_0 / ((d_m * d_m) * l)) * -0.125), h, 1.0);
} else {
tmp = fma((t_0 / ((t_2 * l) * d_m)), -0.125, (d_m / (t_2 * h)));
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) t_1 = sqrt(Float64(l * h)) t_2 = sqrt(Float64(l / h)) tmp = 0.0 if (l <= -2.0) tmp = fma(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / Float64(Float64(l * d_m) * t_1)), -0.125, Float64(d_m / t_1)); elseif (l <= 6.2e-208) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * fma(Float64(Float64(t_0 / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0)); else tmp = fma(Float64(t_0 / Float64(Float64(t_2 * l) * d_m)), -0.125, Float64(d_m / Float64(t_2 * h))); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -2.0], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.2e-208], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$0 / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(N[(t$95$2 * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125 + N[(d$95$m / N[(t$95$2 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)\\
t_1 := \sqrt{\ell \cdot h}\\
t_2 := \sqrt{\frac{\ell}{h}}\\
\mathbf{if}\;\ell \leq -2:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{\left(\ell \cdot d\_m\right) \cdot t\_1}, -0.125, \frac{d\_m}{t\_1}\right)\\
\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{-208}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(\frac{t\_0}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0}{\left(t\_2 \cdot \ell\right) \cdot d\_m}, -0.125, \frac{d\_m}{t\_2 \cdot h}\right)\\
\end{array}
\end{array}
if l < -2Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around 0
*-commutativeN/A
sqrt-prodN/A
mult-flipN/A
metadata-evalN/A
sqrt-divN/A
lower-fma.f64N/A
Applied rewrites60.0%
if -2 < l < 6.1999999999999996e-208Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Applied rewrites68.9%
Taylor expanded in h around inf
Applied rewrites60.4%
if 6.1999999999999996e-208 < l Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in h around inf
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites33.1%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= (* M_m D_m) 5e-178)
(/ d_m t_0)
(if (<= (* M_m D_m) 1e+143)
(*
(/ (fabs d_m) (sqrt (* h l)))
(fma
(* (/ (* (* D_m M_m) (* D_m M_m)) (* (* d_m d_m) l)) -0.125)
h
1.0))
(/ (* (* (* D_m D_m) (/ (* M_m M_m) (/ (* l d_m) t_0))) -0.125) l)))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double tmp;
if ((M_m * D_m) <= 5e-178) {
tmp = d_m / t_0;
} else if ((M_m * D_m) <= 1e+143) {
tmp = (fabs(d_m) / sqrt((h * l))) * fma(((((D_m * M_m) * (D_m * M_m)) / ((d_m * d_m) * l)) * -0.125), h, 1.0);
} else {
tmp = (((D_m * D_m) * ((M_m * M_m) / ((l * d_m) / t_0))) * -0.125) / l;
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (Float64(M_m * D_m) <= 5e-178) tmp = Float64(d_m / t_0); elseif (Float64(M_m * D_m) <= 1e+143) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * fma(Float64(Float64(Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0)); else tmp = Float64(Float64(Float64(Float64(D_m * D_m) * Float64(Float64(M_m * M_m) / Float64(Float64(l * d_m) / t_0))) * -0.125) / l); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 5e-178], N[(d$95$m / t$95$0), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 1e+143], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{-178}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+143}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(\frac{\left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{\frac{\ell \cdot d\_m}{t\_0}}\right) \cdot -0.125}{\ell}\\
\end{array}
\end{array}
if (*.f64 M D) < 4.99999999999999976e-178Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 4.99999999999999976e-178 < (*.f64 M D) < 1e143Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Applied rewrites68.9%
Taylor expanded in h around inf
Applied rewrites60.4%
if 1e143 < (*.f64 M D) Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites29.3%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M_m 1.55e-84)
(/ d_m t_0)
(if (<= M_m 3.6e+75)
(*
(/ (fabs d_m) (sqrt (* h l)))
(fma
(* (* (/ h (* (* d_m d_m) l)) (* M_m M_m)) -0.125)
(* D_m D_m)
1.0))
(/ (* (* (* D_m D_m) (/ (* M_m M_m) (/ (* l d_m) t_0))) -0.125) l)))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double tmp;
if (M_m <= 1.55e-84) {
tmp = d_m / t_0;
} else if (M_m <= 3.6e+75) {
tmp = (fabs(d_m) / sqrt((h * l))) * fma((((h / ((d_m * d_m) * l)) * (M_m * M_m)) * -0.125), (D_m * D_m), 1.0);
} else {
tmp = (((D_m * D_m) * ((M_m * M_m) / ((l * d_m) / t_0))) * -0.125) / l;
}
return tmp;
}
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M_m <= 1.55e-84) tmp = Float64(d_m / t_0); elseif (M_m <= 3.6e+75) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(h * l))) * fma(Float64(Float64(Float64(h / Float64(Float64(d_m * d_m) * l)) * Float64(M_m * M_m)) * -0.125), Float64(D_m * D_m), 1.0)); else tmp = Float64(Float64(Float64(Float64(D_m * D_m) * Float64(Float64(M_m * M_m) / Float64(Float64(l * d_m) / t_0))) * -0.125) / l); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M$95$m, 1.55e-84], N[(d$95$m / t$95$0), $MachinePrecision], If[LessEqual[M$95$m, 3.6e+75], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(h / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M\_m \leq 1.55 \cdot 10^{-84}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{elif}\;M\_m \leq 3.6 \cdot 10^{+75}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(\left(\frac{h}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot \left(M\_m \cdot M\_m\right)\right) \cdot -0.125, D\_m \cdot D\_m, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{\frac{\ell \cdot d\_m}{t\_0}}\right) \cdot -0.125}{\ell}\\
\end{array}
\end{array}
if M < 1.55000000000000001e-84Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 1.55000000000000001e-84 < M < 3.6e75Initial program 36.1%
Taylor expanded in D around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites22.3%
Applied rewrites48.4%
if 3.6e75 < M Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites29.3%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M_m 2.5e-34)
(/ d_m t_0)
(*
(/ (* (* (* (/ 1.0 t_0) h) (* M_m M_m)) (* D_m D_m)) (* l d_m))
-0.125))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double tmp;
if (M_m <= 2.5e-34) {
tmp = d_m / t_0;
} else {
tmp = (((((1.0 / t_0) * h) * (M_m * M_m)) * (D_m * D_m)) / (l * d_m)) * -0.125;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (m_m <= 2.5d-34) then
tmp = d_m / t_0
else
tmp = (((((1.0d0 / t_0) * h) * (m_m * m_m)) * (d_m_1 * d_m_1)) / (l * d_m)) * (-0.125d0)
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (M_m <= 2.5e-34) {
tmp = d_m / t_0;
} else {
tmp = (((((1.0 / t_0) * h) * (M_m * M_m)) * (D_m * D_m)) / (l * d_m)) * -0.125;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): t_0 = math.sqrt((l * h)) tmp = 0 if M_m <= 2.5e-34: tmp = d_m / t_0 else: tmp = (((((1.0 / t_0) * h) * (M_m * M_m)) * (D_m * D_m)) / (l * d_m)) * -0.125 return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M_m <= 2.5e-34) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(1.0 / t_0) * h) * Float64(M_m * M_m)) * Float64(D_m * D_m)) / Float64(l * d_m)) * -0.125); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
t_0 = sqrt((l * h));
tmp = 0.0;
if (M_m <= 2.5e-34)
tmp = d_m / t_0;
else
tmp = (((((1.0 / t_0) * h) * (M_m * M_m)) * (D_m * D_m)) / (l * d_m)) * -0.125;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M$95$m, 2.5e-34], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(1.0 / t$95$0), $MachinePrecision] * h), $MachinePrecision] * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M\_m \leq 2.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\frac{1}{t\_0} \cdot h\right) \cdot \left(M\_m \cdot M\_m\right)\right) \cdot \left(D\_m \cdot D\_m\right)}{\ell \cdot d\_m} \cdot -0.125\\
\end{array}
\end{array}
if M < 2.5000000000000001e-34Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 2.5000000000000001e-34 < M Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Taylor expanded in d around inf
Applied rewrites32.9%
Taylor expanded in d around 0
pow1/2N/A
*-commutativeN/A
pow-prod-downN/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites32.7%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(if (<= M_m 2.5e-34)
(/ d_m (sqrt (* l h)))
(*
(/ (* (* (* (* M_m M_m) h) (sqrt (/ 1.0 (* h l)))) (* D_m D_m)) (* l d_m))
-0.125)))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (M_m <= 2.5e-34) {
tmp = d_m / sqrt((l * h));
} else {
tmp = (((((M_m * M_m) * h) * sqrt((1.0 / (h * l)))) * (D_m * D_m)) / (l * d_m)) * -0.125;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (m_m <= 2.5d-34) then
tmp = d_m / sqrt((l * h))
else
tmp = (((((m_m * m_m) * h) * sqrt((1.0d0 / (h * l)))) * (d_m_1 * d_m_1)) / (l * d_m)) * (-0.125d0)
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (M_m <= 2.5e-34) {
tmp = d_m / Math.sqrt((l * h));
} else {
tmp = (((((M_m * M_m) * h) * Math.sqrt((1.0 / (h * l)))) * (D_m * D_m)) / (l * d_m)) * -0.125;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if M_m <= 2.5e-34: tmp = d_m / math.sqrt((l * h)) else: tmp = (((((M_m * M_m) * h) * math.sqrt((1.0 / (h * l)))) * (D_m * D_m)) / (l * d_m)) * -0.125 return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (M_m <= 2.5e-34) tmp = Float64(d_m / sqrt(Float64(l * h))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(D_m * D_m)) / Float64(l * d_m)) * -0.125); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (M_m <= 2.5e-34)
tmp = d_m / sqrt((l * h));
else
tmp = (((((M_m * M_m) * h) * sqrt((1.0 / (h * l)))) * (D_m * D_m)) / (l * d_m)) * -0.125;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[M$95$m, 2.5e-34], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 2.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(D\_m \cdot D\_m\right)}{\ell \cdot d\_m} \cdot -0.125\\
\end{array}
\end{array}
if M < 2.5000000000000001e-34Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 2.5000000000000001e-34 < M Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Taylor expanded in d around 0
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites31.2%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M_m 2.6e-34)
(/ d_m t_0)
(*
(* (* D_m D_m) (/ (* (* M_m M_m) h) (* (* (fabs d_m) t_0) l)))
-0.125))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double tmp;
if (M_m <= 2.6e-34) {
tmp = d_m / t_0;
} else {
tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((fabs(d_m) * t_0) * l))) * -0.125;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (m_m <= 2.6d-34) then
tmp = d_m / t_0
else
tmp = ((d_m_1 * d_m_1) * (((m_m * m_m) * h) / ((abs(d_m) * t_0) * l))) * (-0.125d0)
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (M_m <= 2.6e-34) {
tmp = d_m / t_0;
} else {
tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((Math.abs(d_m) * t_0) * l))) * -0.125;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): t_0 = math.sqrt((l * h)) tmp = 0 if M_m <= 2.6e-34: tmp = d_m / t_0 else: tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((math.fabs(d_m) * t_0) * l))) * -0.125 return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M_m <= 2.6e-34) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(D_m * D_m) * Float64(Float64(Float64(M_m * M_m) * h) / Float64(Float64(abs(d_m) * t_0) * l))) * -0.125); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
t_0 = sqrt((l * h));
tmp = 0.0;
if (M_m <= 2.6e-34)
tmp = d_m / t_0;
else
tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((abs(d_m) * t_0) * l))) * -0.125;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M$95$m, 2.6e-34], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] / N[(N[(N[Abs[d$95$m], $MachinePrecision] * t$95$0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M\_m \leq 2.6 \cdot 10^{-34}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(D\_m \cdot D\_m\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\left(\left|d\_m\right| \cdot t\_0\right) \cdot \ell}\right) \cdot -0.125\\
\end{array}
\end{array}
if M < 2.5999999999999999e-34Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 2.5999999999999999e-34 < M Initial program 36.1%
Taylor expanded in d around inf
Applied rewrites18.9%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites24.1%
Applied rewrites30.4%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M_m 3.8e-33)
(/ d_m t_0)
(/ (* (* (* D_m D_m) (/ (* M_m M_m) (/ (* l d_m) t_0))) -0.125) l))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double tmp;
if (M_m <= 3.8e-33) {
tmp = d_m / t_0;
} else {
tmp = (((D_m * D_m) * ((M_m * M_m) / ((l * d_m) / t_0))) * -0.125) / l;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (m_m <= 3.8d-33) then
tmp = d_m / t_0
else
tmp = (((d_m_1 * d_m_1) * ((m_m * m_m) / ((l * d_m) / t_0))) * (-0.125d0)) / l
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (M_m <= 3.8e-33) {
tmp = d_m / t_0;
} else {
tmp = (((D_m * D_m) * ((M_m * M_m) / ((l * d_m) / t_0))) * -0.125) / l;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): t_0 = math.sqrt((l * h)) tmp = 0 if M_m <= 3.8e-33: tmp = d_m / t_0 else: tmp = (((D_m * D_m) * ((M_m * M_m) / ((l * d_m) / t_0))) * -0.125) / l return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M_m <= 3.8e-33) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(Float64(D_m * D_m) * Float64(Float64(M_m * M_m) / Float64(Float64(l * d_m) / t_0))) * -0.125) / l); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
t_0 = sqrt((l * h));
tmp = 0.0;
if (M_m <= 3.8e-33)
tmp = d_m / t_0;
else
tmp = (((D_m * D_m) * ((M_m * M_m) / ((l * d_m) / t_0))) * -0.125) / l;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M$95$m, 3.8e-33], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M\_m \leq 3.8 \cdot 10^{-33}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{\frac{\ell \cdot d\_m}{t\_0}}\right) \cdot -0.125}{\ell}\\
\end{array}
\end{array}
if M < 3.79999999999999994e-33Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 3.79999999999999994e-33 < M Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in h around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites29.3%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M_m 2.5e-34)
(/ d_m t_0)
(/ (* (/ (* (* (* (* M_m M_m) h) D_m) D_m) (* t_0 d_m)) -0.125) l))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double tmp;
if (M_m <= 2.5e-34) {
tmp = d_m / t_0;
} else {
tmp = ((((((M_m * M_m) * h) * D_m) * D_m) / (t_0 * d_m)) * -0.125) / l;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (m_m <= 2.5d-34) then
tmp = d_m / t_0
else
tmp = ((((((m_m * m_m) * h) * d_m_1) * d_m_1) / (t_0 * d_m)) * (-0.125d0)) / l
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (M_m <= 2.5e-34) {
tmp = d_m / t_0;
} else {
tmp = ((((((M_m * M_m) * h) * D_m) * D_m) / (t_0 * d_m)) * -0.125) / l;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): t_0 = math.sqrt((l * h)) tmp = 0 if M_m <= 2.5e-34: tmp = d_m / t_0 else: tmp = ((((((M_m * M_m) * h) * D_m) * D_m) / (t_0 * d_m)) * -0.125) / l return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M_m <= 2.5e-34) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / Float64(t_0 * d_m)) * -0.125) / l); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
t_0 = sqrt((l * h));
tmp = 0.0;
if (M_m <= 2.5e-34)
tmp = d_m / t_0;
else
tmp = ((((((M_m * M_m) * h) * D_m) * D_m) / (t_0 * d_m)) * -0.125) / l;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M$95$m, 2.5e-34], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(t$95$0 * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M\_m \leq 2.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{t\_0 \cdot d\_m} \cdot -0.125}{\ell}\\
\end{array}
\end{array}
if M < 2.5000000000000001e-34Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 2.5000000000000001e-34 < M Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites32.0%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M_m 2.1e-34)
(/ d_m t_0)
(* (/ (* (* (* (* M_m M_m) h) D_m) D_m) (* (* l d_m) t_0)) -0.125))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((l * h));
double tmp;
if (M_m <= 2.1e-34) {
tmp = d_m / t_0;
} else {
tmp = (((((M_m * M_m) * h) * D_m) * D_m) / ((l * d_m) * t_0)) * -0.125;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (m_m <= 2.1d-34) then
tmp = d_m / t_0
else
tmp = (((((m_m * m_m) * h) * d_m_1) * d_m_1) / ((l * d_m) * t_0)) * (-0.125d0)
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (M_m <= 2.1e-34) {
tmp = d_m / t_0;
} else {
tmp = (((((M_m * M_m) * h) * D_m) * D_m) / ((l * d_m) * t_0)) * -0.125;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): t_0 = math.sqrt((l * h)) tmp = 0 if M_m <= 2.1e-34: tmp = d_m / t_0 else: tmp = (((((M_m * M_m) * h) * D_m) * D_m) / ((l * d_m) * t_0)) * -0.125 return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M_m <= 2.1e-34) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * D_m) / Float64(Float64(l * d_m) * t_0)) * -0.125); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
t_0 = sqrt((l * h));
tmp = 0.0;
if (M_m <= 2.1e-34)
tmp = d_m / t_0;
else
tmp = (((((M_m * M_m) * h) * D_m) * D_m) / ((l * d_m) * t_0)) * -0.125;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M$95$m, 2.1e-34], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M\_m \leq 2.1 \cdot 10^{-34}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot D\_m}{\left(\ell \cdot d\_m\right) \cdot t\_0} \cdot -0.125\\
\end{array}
\end{array}
if M < 2.1000000000000001e-34Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 2.1000000000000001e-34 < M Initial program 36.1%
Taylor expanded in d around inf
Applied rewrites18.9%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites24.1%
Taylor expanded in d around 0
lower-/.f64N/A
*-commutativeN/A
pow2N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites31.6%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(if (<=
(*
(* (pow (/ d_m h) (/ 1.0 2.0)) (pow (/ d_m l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0)) (/ h l))))
-2e-214)
(* (/ (* (* D_m M_m) (* D_m M_m)) (* (* (sqrt (/ l h)) l) d_m)) -0.125)
(/ d_m (sqrt (* l h)))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (((pow((d_m / h), (1.0 / 2.0)) * pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -2e-214) {
tmp = (((D_m * M_m) * (D_m * M_m)) / ((sqrt((l / h)) * l) * d_m)) * -0.125;
} else {
tmp = d_m / sqrt((l * h));
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (((((d_m / h) ** (1.0d0 / 2.0d0)) * ((d_m / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m_1) / (2.0d0 * d_m)) ** 2.0d0)) * (h / l)))) <= (-2d-214)) then
tmp = (((d_m_1 * m_m) * (d_m_1 * m_m)) / ((sqrt((l / h)) * l) * d_m)) * (-0.125d0)
else
tmp = d_m / sqrt((l * h))
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (((Math.pow((d_m / h), (1.0 / 2.0)) * Math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -2e-214) {
tmp = (((D_m * M_m) * (D_m * M_m)) / ((Math.sqrt((l / h)) * l) * d_m)) * -0.125;
} else {
tmp = d_m / Math.sqrt((l * h));
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if ((math.pow((d_m / h), (1.0 / 2.0)) * math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -2e-214: tmp = (((D_m * M_m) * (D_m * M_m)) / ((math.sqrt((l / h)) * l) * d_m)) * -0.125 else: tmp = d_m / math.sqrt((l * h)) return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (Float64(Float64((Float64(d_m / h) ^ Float64(1.0 / 2.0)) * (Float64(d_m / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d_m)) ^ 2.0)) * Float64(h / l)))) <= -2e-214) tmp = Float64(Float64(Float64(Float64(D_m * M_m) * Float64(D_m * M_m)) / Float64(Float64(sqrt(Float64(l / h)) * l) * d_m)) * -0.125); else tmp = Float64(d_m / sqrt(Float64(l * h))); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (((((d_m / h) ^ (1.0 / 2.0)) * ((d_m / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d_m)) ^ 2.0)) * (h / l)))) <= -2e-214)
tmp = (((D_m * M_m) * (D_m * M_m)) / ((sqrt((l / h)) * l) * d_m)) * -0.125;
else
tmp = d_m / sqrt((l * h));
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[N[(N[(N[Power[N[(d$95$m / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d$95$m / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-214], N[(N[(N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -2 \cdot 10^{-214}:\\
\;\;\;\;\frac{\left(D\_m \cdot M\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{\left(\sqrt{\frac{\ell}{h}} \cdot \ell\right) \cdot d\_m} \cdot -0.125\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.99999999999999983e-214Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in h around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6422.6
Applied rewrites22.6%
if -1.99999999999999983e-214 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(if (<= h -9e+222)
(* (* (/ (sqrt (/ h (* (* d_m d_m) l))) h) d_m) d_m)
(if (<= h -5e-292)
(/ (- (* (/ (sqrt (- h)) (sqrt (- l))) d_m)) h)
(if (<= h 1.08e+46)
(/ d_m (sqrt (* l h)))
(* (/ (* (fabs d_m) (sqrt (/ l h))) l) 1.0)))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -9e+222) {
tmp = ((sqrt((h / ((d_m * d_m) * l))) / h) * d_m) * d_m;
} else if (h <= -5e-292) {
tmp = -((sqrt(-h) / sqrt(-l)) * d_m) / h;
} else if (h <= 1.08e+46) {
tmp = d_m / sqrt((l * h));
} else {
tmp = ((fabs(d_m) * sqrt((l / h))) / l) * 1.0;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (h <= (-9d+222)) then
tmp = ((sqrt((h / ((d_m * d_m) * l))) / h) * d_m) * d_m
else if (h <= (-5d-292)) then
tmp = -((sqrt(-h) / sqrt(-l)) * d_m) / h
else if (h <= 1.08d+46) then
tmp = d_m / sqrt((l * h))
else
tmp = ((abs(d_m) * sqrt((l / h))) / l) * 1.0d0
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -9e+222) {
tmp = ((Math.sqrt((h / ((d_m * d_m) * l))) / h) * d_m) * d_m;
} else if (h <= -5e-292) {
tmp = -((Math.sqrt(-h) / Math.sqrt(-l)) * d_m) / h;
} else if (h <= 1.08e+46) {
tmp = d_m / Math.sqrt((l * h));
} else {
tmp = ((Math.abs(d_m) * Math.sqrt((l / h))) / l) * 1.0;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if h <= -9e+222: tmp = ((math.sqrt((h / ((d_m * d_m) * l))) / h) * d_m) * d_m elif h <= -5e-292: tmp = -((math.sqrt(-h) / math.sqrt(-l)) * d_m) / h elif h <= 1.08e+46: tmp = d_m / math.sqrt((l * h)) else: tmp = ((math.fabs(d_m) * math.sqrt((l / h))) / l) * 1.0 return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (h <= -9e+222) tmp = Float64(Float64(Float64(sqrt(Float64(h / Float64(Float64(d_m * d_m) * l))) / h) * d_m) * d_m); elseif (h <= -5e-292) tmp = Float64(Float64(-Float64(Float64(sqrt(Float64(-h)) / sqrt(Float64(-l))) * d_m)) / h); elseif (h <= 1.08e+46) tmp = Float64(d_m / sqrt(Float64(l * h))); else tmp = Float64(Float64(Float64(abs(d_m) * sqrt(Float64(l / h))) / l) * 1.0); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (h <= -9e+222)
tmp = ((sqrt((h / ((d_m * d_m) * l))) / h) * d_m) * d_m;
elseif (h <= -5e-292)
tmp = -((sqrt(-h) / sqrt(-l)) * d_m) / h;
elseif (h <= 1.08e+46)
tmp = d_m / sqrt((l * h));
else
tmp = ((abs(d_m) * sqrt((l / h))) / l) * 1.0;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, -9e+222], N[(N[(N[(N[Sqrt[N[(h / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / h), $MachinePrecision] * d$95$m), $MachinePrecision] * d$95$m), $MachinePrecision], If[LessEqual[h, -5e-292], N[((-N[(N[(N[Sqrt[(-h)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * d$95$m), $MachinePrecision]) / h), $MachinePrecision], If[LessEqual[h, 1.08e+46], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Abs[d$95$m], $MachinePrecision] * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -9 \cdot 10^{+222}:\\
\;\;\;\;\left(\frac{\sqrt{\frac{h}{\left(d\_m \cdot d\_m\right) \cdot \ell}}}{h} \cdot d\_m\right) \cdot d\_m\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-292}:\\
\;\;\;\;\frac{-\frac{\sqrt{-h}}{\sqrt{-\ell}} \cdot d\_m}{h}\\
\mathbf{elif}\;h \leq 1.08 \cdot 10^{+46}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|d\_m\right| \cdot \sqrt{\frac{\ell}{h}}}{\ell} \cdot 1\\
\end{array}
\end{array}
if h < -8.99999999999999978e222Initial program 36.1%
Taylor expanded in d around inf
Applied rewrites18.9%
Taylor expanded in h around 0
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6417.9
Applied rewrites17.9%
if -8.99999999999999978e222 < h < -4.99999999999999981e-292Initial program 36.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites21.1%
Taylor expanded in d around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
mult-flipN/A
sqrt-unprodN/A
lower-*.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6425.6
Applied rewrites25.6%
lift-/.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6422.7
Applied rewrites22.7%
if -4.99999999999999981e-292 < h < 1.07999999999999994e46Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 1.07999999999999994e46 < h Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Taylor expanded in d around inf
Applied rewrites32.9%
Taylor expanded in l around 0
lower-/.f64N/A
associate-/l*N/A
sqrt-prodN/A
pow2N/A
rem-sqrt-square-revN/A
lower-*.f64N/A
lift-fabs.f64N/A
lower-sqrt.f64N/A
lower-/.f6421.9
Applied rewrites21.9%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(if (<= h -2e+196)
(* d_m (/ (sqrt (/ h l)) h))
(if (<= h -5e-292)
(/ (- (* (/ (sqrt (- h)) (sqrt (- l))) d_m)) h)
(if (<= h 5e+34)
(/ d_m (sqrt (* l h)))
(* (/ (* (fabs d_m) (sqrt (/ l h))) l) 1.0)))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -2e+196) {
tmp = d_m * (sqrt((h / l)) / h);
} else if (h <= -5e-292) {
tmp = -((sqrt(-h) / sqrt(-l)) * d_m) / h;
} else if (h <= 5e+34) {
tmp = d_m / sqrt((l * h));
} else {
tmp = ((fabs(d_m) * sqrt((l / h))) / l) * 1.0;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (h <= (-2d+196)) then
tmp = d_m * (sqrt((h / l)) / h)
else if (h <= (-5d-292)) then
tmp = -((sqrt(-h) / sqrt(-l)) * d_m) / h
else if (h <= 5d+34) then
tmp = d_m / sqrt((l * h))
else
tmp = ((abs(d_m) * sqrt((l / h))) / l) * 1.0d0
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -2e+196) {
tmp = d_m * (Math.sqrt((h / l)) / h);
} else if (h <= -5e-292) {
tmp = -((Math.sqrt(-h) / Math.sqrt(-l)) * d_m) / h;
} else if (h <= 5e+34) {
tmp = d_m / Math.sqrt((l * h));
} else {
tmp = ((Math.abs(d_m) * Math.sqrt((l / h))) / l) * 1.0;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if h <= -2e+196: tmp = d_m * (math.sqrt((h / l)) / h) elif h <= -5e-292: tmp = -((math.sqrt(-h) / math.sqrt(-l)) * d_m) / h elif h <= 5e+34: tmp = d_m / math.sqrt((l * h)) else: tmp = ((math.fabs(d_m) * math.sqrt((l / h))) / l) * 1.0 return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (h <= -2e+196) tmp = Float64(d_m * Float64(sqrt(Float64(h / l)) / h)); elseif (h <= -5e-292) tmp = Float64(Float64(-Float64(Float64(sqrt(Float64(-h)) / sqrt(Float64(-l))) * d_m)) / h); elseif (h <= 5e+34) tmp = Float64(d_m / sqrt(Float64(l * h))); else tmp = Float64(Float64(Float64(abs(d_m) * sqrt(Float64(l / h))) / l) * 1.0); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (h <= -2e+196)
tmp = d_m * (sqrt((h / l)) / h);
elseif (h <= -5e-292)
tmp = -((sqrt(-h) / sqrt(-l)) * d_m) / h;
elseif (h <= 5e+34)
tmp = d_m / sqrt((l * h));
else
tmp = ((abs(d_m) * sqrt((l / h))) / l) * 1.0;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, -2e+196], N[(d$95$m * N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-292], N[((-N[(N[(N[Sqrt[(-h)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * d$95$m), $MachinePrecision]) / h), $MachinePrecision], If[LessEqual[h, 5e+34], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Abs[d$95$m], $MachinePrecision] * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2 \cdot 10^{+196}:\\
\;\;\;\;d\_m \cdot \frac{\sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-292}:\\
\;\;\;\;\frac{-\frac{\sqrt{-h}}{\sqrt{-\ell}} \cdot d\_m}{h}\\
\mathbf{elif}\;h \leq 5 \cdot 10^{+34}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|d\_m\right| \cdot \sqrt{\frac{\ell}{h}}}{\ell} \cdot 1\\
\end{array}
\end{array}
if h < -1.9999999999999999e196Initial program 36.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites21.1%
Taylor expanded in d around 0
associate-/l*N/A
lower-*.f64N/A
mult-flipN/A
sqrt-unprodN/A
lower-/.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6426.0
Applied rewrites26.0%
if -1.9999999999999999e196 < h < -4.99999999999999981e-292Initial program 36.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites21.1%
Taylor expanded in d around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
mult-flipN/A
sqrt-unprodN/A
lower-*.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6425.6
Applied rewrites25.6%
lift-/.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6422.7
Applied rewrites22.7%
if -4.99999999999999981e-292 < h < 4.9999999999999998e34Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 4.9999999999999998e34 < h Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Taylor expanded in d around inf
Applied rewrites32.9%
Taylor expanded in l around 0
lower-/.f64N/A
associate-/l*N/A
sqrt-prodN/A
pow2N/A
rem-sqrt-square-revN/A
lower-*.f64N/A
lift-fabs.f64N/A
lower-sqrt.f64N/A
lower-/.f6421.9
Applied rewrites21.9%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(if (<= h -2e+196)
(* d_m (/ (sqrt (/ h l)) h))
(if (<= h 1.08e+46)
(/ d_m (sqrt (* l h)))
(* (/ (* (fabs d_m) (sqrt (/ l h))) l) 1.0))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -2e+196) {
tmp = d_m * (sqrt((h / l)) / h);
} else if (h <= 1.08e+46) {
tmp = d_m / sqrt((l * h));
} else {
tmp = ((fabs(d_m) * sqrt((l / h))) / l) * 1.0;
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (h <= (-2d+196)) then
tmp = d_m * (sqrt((h / l)) / h)
else if (h <= 1.08d+46) then
tmp = d_m / sqrt((l * h))
else
tmp = ((abs(d_m) * sqrt((l / h))) / l) * 1.0d0
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -2e+196) {
tmp = d_m * (Math.sqrt((h / l)) / h);
} else if (h <= 1.08e+46) {
tmp = d_m / Math.sqrt((l * h));
} else {
tmp = ((Math.abs(d_m) * Math.sqrt((l / h))) / l) * 1.0;
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if h <= -2e+196: tmp = d_m * (math.sqrt((h / l)) / h) elif h <= 1.08e+46: tmp = d_m / math.sqrt((l * h)) else: tmp = ((math.fabs(d_m) * math.sqrt((l / h))) / l) * 1.0 return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (h <= -2e+196) tmp = Float64(d_m * Float64(sqrt(Float64(h / l)) / h)); elseif (h <= 1.08e+46) tmp = Float64(d_m / sqrt(Float64(l * h))); else tmp = Float64(Float64(Float64(abs(d_m) * sqrt(Float64(l / h))) / l) * 1.0); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (h <= -2e+196)
tmp = d_m * (sqrt((h / l)) / h);
elseif (h <= 1.08e+46)
tmp = d_m / sqrt((l * h));
else
tmp = ((abs(d_m) * sqrt((l / h))) / l) * 1.0;
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, -2e+196], N[(d$95$m * N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.08e+46], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Abs[d$95$m], $MachinePrecision] * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2 \cdot 10^{+196}:\\
\;\;\;\;d\_m \cdot \frac{\sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;h \leq 1.08 \cdot 10^{+46}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|d\_m\right| \cdot \sqrt{\frac{\ell}{h}}}{\ell} \cdot 1\\
\end{array}
\end{array}
if h < -1.9999999999999999e196Initial program 36.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites21.1%
Taylor expanded in d around 0
associate-/l*N/A
lower-*.f64N/A
mult-flipN/A
sqrt-unprodN/A
lower-/.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6426.0
Applied rewrites26.0%
if -1.9999999999999999e196 < h < 1.07999999999999994e46Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 1.07999999999999994e46 < h Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Taylor expanded in d around inf
Applied rewrites32.9%
Taylor expanded in l around 0
lower-/.f64N/A
associate-/l*N/A
sqrt-prodN/A
pow2N/A
rem-sqrt-square-revN/A
lower-*.f64N/A
lift-fabs.f64N/A
lower-sqrt.f64N/A
lower-/.f6421.9
Applied rewrites21.9%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(if (<= h -2e+196)
(* d_m (/ (sqrt (/ h l)) h))
(if (<= h 7e-9)
(/ d_m (sqrt (* l h)))
(- (/ d_m (- (* (sqrt (/ l h)) h)))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -2e+196) {
tmp = d_m * (sqrt((h / l)) / h);
} else if (h <= 7e-9) {
tmp = d_m / sqrt((l * h));
} else {
tmp = -(d_m / -(sqrt((l / h)) * h));
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (h <= (-2d+196)) then
tmp = d_m * (sqrt((h / l)) / h)
else if (h <= 7d-9) then
tmp = d_m / sqrt((l * h))
else
tmp = -(d_m / -(sqrt((l / h)) * h))
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= -2e+196) {
tmp = d_m * (Math.sqrt((h / l)) / h);
} else if (h <= 7e-9) {
tmp = d_m / Math.sqrt((l * h));
} else {
tmp = -(d_m / -(Math.sqrt((l / h)) * h));
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if h <= -2e+196: tmp = d_m * (math.sqrt((h / l)) / h) elif h <= 7e-9: tmp = d_m / math.sqrt((l * h)) else: tmp = -(d_m / -(math.sqrt((l / h)) * h)) return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (h <= -2e+196) tmp = Float64(d_m * Float64(sqrt(Float64(h / l)) / h)); elseif (h <= 7e-9) tmp = Float64(d_m / sqrt(Float64(l * h))); else tmp = Float64(-Float64(d_m / Float64(-Float64(sqrt(Float64(l / h)) * h)))); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (h <= -2e+196)
tmp = d_m * (sqrt((h / l)) / h);
elseif (h <= 7e-9)
tmp = d_m / sqrt((l * h));
else
tmp = -(d_m / -(sqrt((l / h)) * h));
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, -2e+196], N[(d$95$m * N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 7e-9], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[(d$95$m / (-N[(N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision] * h), $MachinePrecision])), $MachinePrecision])]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2 \cdot 10^{+196}:\\
\;\;\;\;d\_m \cdot \frac{\sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;h \leq 7 \cdot 10^{-9}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;-\frac{d\_m}{-\sqrt{\frac{\ell}{h}} \cdot h}\\
\end{array}
\end{array}
if h < -1.9999999999999999e196Initial program 36.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites21.1%
Taylor expanded in d around 0
associate-/l*N/A
lower-*.f64N/A
mult-flipN/A
sqrt-unprodN/A
lower-/.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6426.0
Applied rewrites26.0%
if -1.9999999999999999e196 < h < 6.9999999999999998e-9Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 6.9999999999999998e-9 < h Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Taylor expanded in d around -inf
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
*-commutativeN/A
mult-flipN/A
lower-neg.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites10.1%
Taylor expanded in h around -inf
mul-1-negN/A
sqrt-prodN/A
*-commutativeN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6425.6
Applied rewrites25.6%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (/ h l))))
(if (<= h -2e+196)
(* d_m (/ t_0 h))
(if (<= h 2.5e+62) (/ d_m (sqrt (* l h))) (/ d_m (* t_0 l))))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((h / l));
double tmp;
if (h <= -2e+196) {
tmp = d_m * (t_0 / h);
} else if (h <= 2.5e+62) {
tmp = d_m / sqrt((l * h));
} else {
tmp = d_m / (t_0 * l);
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((h / l))
if (h <= (-2d+196)) then
tmp = d_m * (t_0 / h)
else if (h <= 2.5d+62) then
tmp = d_m / sqrt((l * h))
else
tmp = d_m / (t_0 * l)
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((h / l));
double tmp;
if (h <= -2e+196) {
tmp = d_m * (t_0 / h);
} else if (h <= 2.5e+62) {
tmp = d_m / Math.sqrt((l * h));
} else {
tmp = d_m / (t_0 * l);
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): t_0 = math.sqrt((h / l)) tmp = 0 if h <= -2e+196: tmp = d_m * (t_0 / h) elif h <= 2.5e+62: tmp = d_m / math.sqrt((l * h)) else: tmp = d_m / (t_0 * l) return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) t_0 = sqrt(Float64(h / l)) tmp = 0.0 if (h <= -2e+196) tmp = Float64(d_m * Float64(t_0 / h)); elseif (h <= 2.5e+62) tmp = Float64(d_m / sqrt(Float64(l * h))); else tmp = Float64(d_m / Float64(t_0 * l)); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
t_0 = sqrt((h / l));
tmp = 0.0;
if (h <= -2e+196)
tmp = d_m * (t_0 / h);
elseif (h <= 2.5e+62)
tmp = d_m / sqrt((l * h));
else
tmp = d_m / (t_0 * l);
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -2e+196], N[(d$95$m * N[(t$95$0 / h), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.5e+62], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d$95$m / N[(t$95$0 * l), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;h \leq -2 \cdot 10^{+196}:\\
\;\;\;\;d\_m \cdot \frac{t\_0}{h}\\
\mathbf{elif}\;h \leq 2.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{t\_0 \cdot \ell}\\
\end{array}
\end{array}
if h < -1.9999999999999999e196Initial program 36.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites21.1%
Taylor expanded in d around 0
associate-/l*N/A
lower-*.f64N/A
mult-flipN/A
sqrt-unprodN/A
lower-/.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6426.0
Applied rewrites26.0%
if -1.9999999999999999e196 < h < 2.50000000000000014e62Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 2.50000000000000014e62 < h Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
Taylor expanded in l around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6423.0
Applied rewrites23.0%
d_m = (fabs.f64 d) M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d_m h l M_m D_m) :precision binary64 (if (<= h 2.5e+62) (/ d_m (sqrt (* l h))) (/ d_m (* (sqrt (/ h l)) l))))
d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= 2.5e+62) {
tmp = d_m / sqrt((l * h));
} else {
tmp = d_m / (sqrt((h / l)) * l);
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (h <= 2.5d+62) then
tmp = d_m / sqrt((l * h))
else
tmp = d_m / (sqrt((h / l)) * l)
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (h <= 2.5e+62) {
tmp = d_m / Math.sqrt((l * h));
} else {
tmp = d_m / (Math.sqrt((h / l)) * l);
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if h <= 2.5e+62: tmp = d_m / math.sqrt((l * h)) else: tmp = d_m / (math.sqrt((h / l)) * l) return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (h <= 2.5e+62) tmp = Float64(d_m / sqrt(Float64(l * h))); else tmp = Float64(d_m / Float64(sqrt(Float64(h / l)) * l)); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (h <= 2.5e+62)
tmp = d_m / sqrt((l * h));
else
tmp = d_m / (sqrt((h / l)) * l);
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, 2.5e+62], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d$95$m / N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 2.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\frac{h}{\ell}} \cdot \ell}\\
\end{array}
\end{array}
if h < 2.50000000000000014e62Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
if 2.50000000000000014e62 < h Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
Taylor expanded in l around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
mult-flipN/A
lower-sqrt.f64N/A
lift-/.f6423.0
Applied rewrites23.0%
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
:precision binary64
(if (<=
(*
(* (pow (/ d_m h) (/ 1.0 2.0)) (pow (/ d_m l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0)) (/ h l))))
-2e-214)
(- (/ d_m (sqrt (* h l))))
(/ d_m (sqrt (* l h)))))d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (((pow((d_m / h), (1.0 / 2.0)) * pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -2e-214) {
tmp = -(d_m / sqrt((h * l)));
} else {
tmp = d_m / sqrt((l * h));
}
return tmp;
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (((((d_m / h) ** (1.0d0 / 2.0d0)) * ((d_m / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m_1) / (2.0d0 * d_m)) ** 2.0d0)) * (h / l)))) <= (-2d-214)) then
tmp = -(d_m / sqrt((h * l)))
else
tmp = d_m / sqrt((l * h))
end if
code = tmp
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
double tmp;
if (((Math.pow((d_m / h), (1.0 / 2.0)) * Math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -2e-214) {
tmp = -(d_m / Math.sqrt((h * l)));
} else {
tmp = d_m / Math.sqrt((l * h));
}
return tmp;
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): tmp = 0 if ((math.pow((d_m / h), (1.0 / 2.0)) * math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -2e-214: tmp = -(d_m / math.sqrt((h * l))) else: tmp = d_m / math.sqrt((l * h)) return tmp
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) tmp = 0.0 if (Float64(Float64((Float64(d_m / h) ^ Float64(1.0 / 2.0)) * (Float64(d_m / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d_m)) ^ 2.0)) * Float64(h / l)))) <= -2e-214) tmp = Float64(-Float64(d_m / sqrt(Float64(h * l)))); else tmp = Float64(d_m / sqrt(Float64(l * h))); end return tmp end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp_2 = code(d_m, h, l, M_m, D_m)
tmp = 0.0;
if (((((d_m / h) ^ (1.0 / 2.0)) * ((d_m / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d_m)) ^ 2.0)) * (h / l)))) <= -2e-214)
tmp = -(d_m / sqrt((h * l)));
else
tmp = d_m / sqrt((l * h));
end
tmp_2 = tmp;
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[N[(N[(N[Power[N[(d$95$m / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d$95$m / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-214], (-N[(d$95$m / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -2 \cdot 10^{-214}:\\
\;\;\;\;-\frac{d\_m}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.99999999999999983e-214Initial program 36.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.9
Applied rewrites55.9%
Taylor expanded in d around -inf
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
*-commutativeN/A
mult-flipN/A
lower-neg.f64N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites10.1%
if -1.99999999999999983e-214 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
d_m = (fabs.f64 d) M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d_m h l M_m D_m) :precision binary64 (/ d_m (sqrt (* l h))))
d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
return d_m / sqrt((l * h));
}
d_m = private
M_m = private
D_m = private
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
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(d_m, h, l, m_m, d_m_1)
use fmin_fmax_functions
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m_1
code = d_m / sqrt((l * h))
end function
d_m = Math.abs(d);
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d_m < h && h < l && l < M_m && M_m < D_m;
public static double code(double d_m, double h, double l, double M_m, double D_m) {
return d_m / Math.sqrt((l * h));
}
d_m = math.fabs(d) M_m = math.fabs(M) D_m = math.fabs(D) [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m]) def code(d_m, h, l, M_m, D_m): return d_m / math.sqrt((l * h))
d_m = abs(d) M_m = abs(M) D_m = abs(D) d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m]) function code(d_m, h, l, M_m, D_m) return Float64(d_m / sqrt(Float64(l * h))) end
d_m = abs(d);
M_m = abs(M);
D_m = abs(D);
d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
function tmp = code(d_m, h, l, M_m, D_m)
tmp = d_m / sqrt((l * h));
end
d_m = N[Abs[d], $MachinePrecision] M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\frac{d\_m}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 36.1%
Taylor expanded in h around inf
Applied rewrites27.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
pow2N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites26.7%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lift-*.f6442.7
Applied rewrites42.7%
herbie shell --seed 2025135
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))