
(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 17 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)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h)))
(t_1 (pow (/ (* M D) (* 2.0 d_m)) 2.0))
(t_2 (- 1.0 (* (* (/ 1.0 2.0) t_1) (/ h l)))))
(if (<= h -1e+185)
(fma (/ (* (* (* M (* D M)) D) h) (* (* t_0 l) d_m)) -0.125 (/ d_m t_0))
(if (<= h -2e+132)
(* (sqrt (* (/ d_m l) (/ d_m h))) t_2)
(if (<= h 8.8e-277)
(* (/ (fabs d_m) t_0) (- 1.0 (* (* 0.5 t_1) (/ h l))))
(* (/ d_m (* (sqrt l) (sqrt h))) t_2))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = pow(((M * D) / (2.0 * d_m)), 2.0);
double t_2 = 1.0 - (((1.0 / 2.0) * t_1) * (h / l));
double tmp;
if (h <= -1e+185) {
tmp = fma(((((M * (D * M)) * D) * h) / ((t_0 * l) * d_m)), -0.125, (d_m / t_0));
} else if (h <= -2e+132) {
tmp = sqrt(((d_m / l) * (d_m / h))) * t_2;
} else if (h <= 8.8e-277) {
tmp = (fabs(d_m) / t_0) * (1.0 - ((0.5 * t_1) * (h / l)));
} else {
tmp = (d_m / (sqrt(l) * sqrt(h))) * t_2;
}
return tmp;
}
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = Float64(Float64(M * D) / Float64(2.0 * d_m)) ^ 2.0 t_2 = Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * t_1) * Float64(h / l))) tmp = 0.0 if (h <= -1e+185) tmp = fma(Float64(Float64(Float64(Float64(M * Float64(D * M)) * D) * h) / Float64(Float64(t_0 * l) * d_m)), -0.125, Float64(d_m / t_0)); elseif (h <= -2e+132) tmp = Float64(sqrt(Float64(Float64(d_m / l) * Float64(d_m / h))) * t_2); elseif (h <= 8.8e-277) tmp = Float64(Float64(abs(d_m) / t_0) * Float64(1.0 - Float64(Float64(0.5 * t_1) * Float64(h / l)))); else tmp = Float64(Float64(d_m / Float64(sqrt(l) * sqrt(h))) * t_2); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e+185], N[(N[(N[(N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] * h), $MachinePrecision] / N[(N[(t$95$0 * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e+132], N[(N[Sqrt[N[(N[(d$95$m / l), $MachinePrecision] * N[(d$95$m / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[h, 8.8e-277], N[(N[(N[Abs[d$95$m], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := {\left(\frac{M \cdot D}{2 \cdot d\_m}\right)}^{2}\\
t_2 := 1 - \left(\frac{1}{2} \cdot t\_1\right) \cdot \frac{h}{\ell}\\
\mathbf{if}\;h \leq -1 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(M \cdot \left(D \cdot M\right)\right) \cdot D\right) \cdot h}{\left(t\_0 \cdot \ell\right) \cdot d\_m}, -0.125, \frac{d\_m}{t\_0}\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{+132}:\\
\;\;\;\;\sqrt{\frac{d\_m}{\ell} \cdot \frac{d\_m}{h}} \cdot t\_2\\
\mathbf{elif}\;h \leq 8.8 \cdot 10^{-277}:\\
\;\;\;\;\frac{\left|d\_m\right|}{t\_0} \cdot \left(1 - \left(0.5 \cdot t\_1\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}} \cdot t\_2\\
\end{array}
\end{array}
if h < -9.9999999999999998e184Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in h around 0
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.5%
if -9.9999999999999998e184 < h < -1.99999999999999998e132Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
sqrt-unprodN/A
*-commutativeN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6455.6
Applied rewrites55.6%
if -1.99999999999999998e132 < h < 8.79999999999999983e-277Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in d around 0
pow1/2N/A
times-fracN/A
metadata-evalN/A
pow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.3%
lift-/.f64N/A
metadata-eval69.3
Applied rewrites69.3%
Taylor expanded in d around 0
sqrt-unprodN/A
frac-timesN/A
pow2N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
sqrt-prodN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
sqrt-prodN/A
lift-sqrt.f64N/A
lift-*.f6469.5
Applied rewrites69.5%
if 8.79999999999999983e-277 < h Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
*-commutativeN/A
sqrt-unprodN/A
sqrt-divN/A
sqrt-divN/A
frac-timesN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
sqr-powN/A
unpow1N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6439.8
Applied rewrites39.8%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))) (t_1 (pow (/ (* M D) (* 2.0 d_m)) 2.0)))
(if (<= h -5e+237)
(fma (/ (* (* (* M (* D M)) D) h) (* (* t_0 l) d_m)) -0.125 (/ d_m t_0))
(if (<= h 8.8e-277)
(* (/ (fabs d_m) t_0) (- 1.0 (* (* 0.5 t_1) (/ h l))))
(*
(/ d_m (* (sqrt l) (sqrt h)))
(- 1.0 (* (* (/ 1.0 2.0) t_1) (/ h l))))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = pow(((M * D) / (2.0 * d_m)), 2.0);
double tmp;
if (h <= -5e+237) {
tmp = fma(((((M * (D * M)) * D) * h) / ((t_0 * l) * d_m)), -0.125, (d_m / t_0));
} else if (h <= 8.8e-277) {
tmp = (fabs(d_m) / t_0) * (1.0 - ((0.5 * t_1) * (h / l)));
} else {
tmp = (d_m / (sqrt(l) * sqrt(h))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l)));
}
return tmp;
}
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = Float64(Float64(M * D) / Float64(2.0 * d_m)) ^ 2.0 tmp = 0.0 if (h <= -5e+237) tmp = fma(Float64(Float64(Float64(Float64(M * Float64(D * M)) * D) * h) / Float64(Float64(t_0 * l) * d_m)), -0.125, Float64(d_m / t_0)); elseif (h <= 8.8e-277) tmp = Float64(Float64(abs(d_m) / t_0) * Float64(1.0 - Float64(Float64(0.5 * t_1) * Float64(h / l)))); else tmp = Float64(Float64(d_m / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * t_1) * Float64(h / l)))); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[h, -5e+237], N[(N[(N[(N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] * h), $MachinePrecision] / N[(N[(t$95$0 * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 8.8e-277], N[(N[(N[Abs[d$95$m], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := {\left(\frac{M \cdot D}{2 \cdot d\_m}\right)}^{2}\\
\mathbf{if}\;h \leq -5 \cdot 10^{+237}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(M \cdot \left(D \cdot M\right)\right) \cdot D\right) \cdot h}{\left(t\_0 \cdot \ell\right) \cdot d\_m}, -0.125, \frac{d\_m}{t\_0}\right)\\
\mathbf{elif}\;h \leq 8.8 \cdot 10^{-277}:\\
\;\;\;\;\frac{\left|d\_m\right|}{t\_0} \cdot \left(1 - \left(0.5 \cdot t\_1\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - \left(\frac{1}{2} \cdot t\_1\right) \cdot \frac{h}{\ell}\right)\\
\end{array}
\end{array}
if h < -5.0000000000000002e237Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in h around 0
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.5%
if -5.0000000000000002e237 < h < 8.79999999999999983e-277Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in d around 0
pow1/2N/A
times-fracN/A
metadata-evalN/A
pow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.3%
lift-/.f64N/A
metadata-eval69.3
Applied rewrites69.3%
Taylor expanded in d around 0
sqrt-unprodN/A
frac-timesN/A
pow2N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
sqrt-prodN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
sqrt-prodN/A
lift-sqrt.f64N/A
lift-*.f6469.5
Applied rewrites69.5%
if 8.79999999999999983e-277 < h Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
*-commutativeN/A
sqrt-unprodN/A
sqrt-divN/A
sqrt-divN/A
frac-timesN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
sqr-powN/A
unpow1N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6439.8
Applied rewrites39.8%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h)))
(t_1 (* M (/ D (+ d_m d_m))))
(t_2 (* (* M (* D M)) D)))
(if (<= h -5e+237)
(fma (/ (* t_2 h) (* (* t_0 l) d_m)) -0.125 (/ d_m t_0))
(if (<= h 2.9e+116)
(*
(/ (fabs d_m) t_0)
(- 1.0 (* (* 0.5 (pow (/ (* M D) (* 2.0 d_m)) 2.0)) (/ h l))))
(if (<= h 1.65e+236)
(*
(sqrt (/ d_m h))
(* (sqrt (/ d_m l)) (- 1.0 (* (* (* t_1 t_1) 0.5) (/ h l)))))
(* (/ t_2 (* (* l d_m) (sqrt (* (/ 1.0 h) l)))) -0.125))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = M * (D / (d_m + d_m));
double t_2 = (M * (D * M)) * D;
double tmp;
if (h <= -5e+237) {
tmp = fma(((t_2 * h) / ((t_0 * l) * d_m)), -0.125, (d_m / t_0));
} else if (h <= 2.9e+116) {
tmp = (fabs(d_m) / t_0) * (1.0 - ((0.5 * pow(((M * D) / (2.0 * d_m)), 2.0)) * (h / l)));
} else if (h <= 1.65e+236) {
tmp = sqrt((d_m / h)) * (sqrt((d_m / l)) * (1.0 - (((t_1 * t_1) * 0.5) * (h / l))));
} else {
tmp = (t_2 / ((l * d_m) * sqrt(((1.0 / h) * l)))) * -0.125;
}
return tmp;
}
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = Float64(M * Float64(D / Float64(d_m + d_m))) t_2 = Float64(Float64(M * Float64(D * M)) * D) tmp = 0.0 if (h <= -5e+237) tmp = fma(Float64(Float64(t_2 * h) / Float64(Float64(t_0 * l) * d_m)), -0.125, Float64(d_m / t_0)); elseif (h <= 2.9e+116) tmp = Float64(Float64(abs(d_m) / t_0) * Float64(1.0 - Float64(Float64(0.5 * (Float64(Float64(M * D) / Float64(2.0 * d_m)) ^ 2.0)) * Float64(h / l)))); elseif (h <= 1.65e+236) tmp = Float64(sqrt(Float64(d_m / h)) * Float64(sqrt(Float64(d_m / l)) * Float64(1.0 - Float64(Float64(Float64(t_1 * t_1) * 0.5) * Float64(h / l))))); else tmp = Float64(Float64(t_2 / Float64(Float64(l * d_m) * sqrt(Float64(Float64(1.0 / h) * l)))) * -0.125); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D / N[(d$95$m + d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]}, If[LessEqual[h, -5e+237], N[(N[(N[(t$95$2 * h), $MachinePrecision] / N[(N[(t$95$0 * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.9e+116], N[(N[(N[Abs[d$95$m], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.65e+236], N[(N[Sqrt[N[(d$95$m / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d$95$m / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.5), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 / N[(N[(l * d$95$m), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := M \cdot \frac{D}{d\_m + d\_m}\\
t_2 := \left(M \cdot \left(D \cdot M\right)\right) \cdot D\\
\mathbf{if}\;h \leq -5 \cdot 10^{+237}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_2 \cdot h}{\left(t\_0 \cdot \ell\right) \cdot d\_m}, -0.125, \frac{d\_m}{t\_0}\right)\\
\mathbf{elif}\;h \leq 2.9 \cdot 10^{+116}:\\
\;\;\;\;\frac{\left|d\_m\right|}{t\_0} \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{elif}\;h \leq 1.65 \cdot 10^{+236}:\\
\;\;\;\;\sqrt{\frac{d\_m}{h}} \cdot \left(\sqrt{\frac{d\_m}{\ell}} \cdot \left(1 - \left(\left(t\_1 \cdot t\_1\right) \cdot 0.5\right) \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\\
\end{array}
\end{array}
if h < -5.0000000000000002e237Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in h around 0
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.5%
if -5.0000000000000002e237 < h < 2.9000000000000001e116Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in d around 0
pow1/2N/A
times-fracN/A
metadata-evalN/A
pow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.3%
lift-/.f64N/A
metadata-eval69.3
Applied rewrites69.3%
Taylor expanded in d around 0
sqrt-unprodN/A
frac-timesN/A
pow2N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
sqrt-prodN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
pow2N/A
rem-sqrt-square-revN/A
lower-fabs.f64N/A
*-commutativeN/A
sqrt-prodN/A
lift-sqrt.f64N/A
lift-*.f6469.5
Applied rewrites69.5%
if 2.9000000000000001e116 < h < 1.6499999999999999e236Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Applied rewrites33.2%
if 1.6499999999999999e236 < h Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in h around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites21.6%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (/ d_m (* (sqrt l) (sqrt h)))) (t_1 (* M (/ D (+ d_m d_m)))))
(if (<= l -2e+243)
(sqrt (* (/ d_m l) (/ d_m h)))
(if (<= l 5e+61)
(*
(/ (fabs d_m) (sqrt (* l h)))
(- 1.0 (* (* (* t_1 t_1) 0.5) (/ h l))))
(fma
(* (* (/ (* (* (* t_0 h) M) M) (* (* d_m d_m) l)) -0.125) D)
D
t_0)))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = d_m / (sqrt(l) * sqrt(h));
double t_1 = M * (D / (d_m + d_m));
double tmp;
if (l <= -2e+243) {
tmp = sqrt(((d_m / l) * (d_m / h)));
} else if (l <= 5e+61) {
tmp = (fabs(d_m) / sqrt((l * h))) * (1.0 - (((t_1 * t_1) * 0.5) * (h / l)));
} else {
tmp = fma(((((((t_0 * h) * M) * M) / ((d_m * d_m) * l)) * -0.125) * D), D, t_0);
}
return tmp;
}
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = Float64(d_m / Float64(sqrt(l) * sqrt(h))) t_1 = Float64(M * Float64(D / Float64(d_m + d_m))) tmp = 0.0 if (l <= -2e+243) tmp = sqrt(Float64(Float64(d_m / l) * Float64(d_m / h))); elseif (l <= 5e+61) tmp = Float64(Float64(abs(d_m) / sqrt(Float64(l * h))) * Float64(1.0 - Float64(Float64(Float64(t_1 * t_1) * 0.5) * Float64(h / l)))); else tmp = fma(Float64(Float64(Float64(Float64(Float64(Float64(t_0 * h) * M) * M) / Float64(Float64(d_m * d_m) * l)) * -0.125) * D), D, t_0); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D / N[(d$95$m + d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e+243], N[Sqrt[N[(N[(d$95$m / l), $MachinePrecision] * N[(d$95$m / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 5e+61], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.5), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t$95$0 * h), $MachinePrecision] * M), $MachinePrecision] * M), $MachinePrecision] / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D), $MachinePrecision] * D + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\\
t_1 := M \cdot \frac{D}{d\_m + d\_m}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{+243}:\\
\;\;\;\;\sqrt{\frac{d\_m}{\ell} \cdot \frac{d\_m}{h}}\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+61}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \left(1 - \left(\left(t\_1 \cdot t\_1\right) \cdot 0.5\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{\left(\left(t\_0 \cdot h\right) \cdot M\right) \cdot M}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125\right) \cdot D, D, t\_0\right)\\
\end{array}
\end{array}
if l < -2.0000000000000001e243Initial program 35.8%
Applied rewrites24.5%
Taylor expanded in h around 0
Applied rewrites43.7%
lift-fabs.f64N/A
lift-/.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
frac-timesN/A
sqrt-divN/A
sqrt-divN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if -2.0000000000000001e243 < l < 5.00000000000000018e61Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Applied rewrites69.3%
if 5.00000000000000018e61 < l Initial program 35.8%
Taylor expanded in l around inf
Applied rewrites26.2%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h)))
(t_1 (* M (/ D (+ d_m d_m))))
(t_2 (* (* M (* D M)) D)))
(if (<= h -5e+192)
(fma (/ (* t_2 h) (* (* t_0 l) d_m)) -0.125 (/ d_m t_0))
(if (<= h 4.35e+210)
(* (/ (fabs d_m) t_0) (- 1.0 (* (* (* t_1 t_1) 0.5) (/ h l))))
(* (/ t_2 (* (* l d_m) (sqrt (* (/ 1.0 h) l)))) -0.125)))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = M * (D / (d_m + d_m));
double t_2 = (M * (D * M)) * D;
double tmp;
if (h <= -5e+192) {
tmp = fma(((t_2 * h) / ((t_0 * l) * d_m)), -0.125, (d_m / t_0));
} else if (h <= 4.35e+210) {
tmp = (fabs(d_m) / t_0) * (1.0 - (((t_1 * t_1) * 0.5) * (h / l)));
} else {
tmp = (t_2 / ((l * d_m) * sqrt(((1.0 / h) * l)))) * -0.125;
}
return tmp;
}
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = Float64(M * Float64(D / Float64(d_m + d_m))) t_2 = Float64(Float64(M * Float64(D * M)) * D) tmp = 0.0 if (h <= -5e+192) tmp = fma(Float64(Float64(t_2 * h) / Float64(Float64(t_0 * l) * d_m)), -0.125, Float64(d_m / t_0)); elseif (h <= 4.35e+210) tmp = Float64(Float64(abs(d_m) / t_0) * Float64(1.0 - Float64(Float64(Float64(t_1 * t_1) * 0.5) * Float64(h / l)))); else tmp = Float64(Float64(t_2 / Float64(Float64(l * d_m) * sqrt(Float64(Float64(1.0 / h) * l)))) * -0.125); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D / N[(d$95$m + d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]}, If[LessEqual[h, -5e+192], N[(N[(N[(t$95$2 * h), $MachinePrecision] / N[(N[(t$95$0 * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125 + N[(d$95$m / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4.35e+210], N[(N[(N[Abs[d$95$m], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.5), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 / N[(N[(l * d$95$m), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := M \cdot \frac{D}{d\_m + d\_m}\\
t_2 := \left(M \cdot \left(D \cdot M\right)\right) \cdot D\\
\mathbf{if}\;h \leq -5 \cdot 10^{+192}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_2 \cdot h}{\left(t\_0 \cdot \ell\right) \cdot d\_m}, -0.125, \frac{d\_m}{t\_0}\right)\\
\mathbf{elif}\;h \leq 4.35 \cdot 10^{+210}:\\
\;\;\;\;\frac{\left|d\_m\right|}{t\_0} \cdot \left(1 - \left(\left(t\_1 \cdot t\_1\right) \cdot 0.5\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\\
\end{array}
\end{array}
if h < -5.00000000000000033e192Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in h around 0
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.5%
if -5.00000000000000033e192 < h < 4.35000000000000017e210Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Applied rewrites69.3%
if 4.35000000000000017e210 < h Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in h around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites21.6%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))) (t_1 (/ d_m t_0)))
(if (<= (* M D) 5e-151)
t_1
(if (<= (* M D) 1e+126)
(fma (/ (* (* (* M (* D M)) D) h) (* (* t_0 l) d_m)) -0.125 t_1)
(if (<= (* M D) 2e+188)
(sqrt (* (/ d_m l) (/ d_m h)))
(/ (* (/ (* (* (* M M) h) (* D D)) (* t_0 d_m)) -0.125) l))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = d_m / t_0;
double tmp;
if ((M * D) <= 5e-151) {
tmp = t_1;
} else if ((M * D) <= 1e+126) {
tmp = fma(((((M * (D * M)) * D) * h) / ((t_0 * l) * d_m)), -0.125, t_1);
} else if ((M * D) <= 2e+188) {
tmp = sqrt(((d_m / l) * (d_m / h)));
} else {
tmp = (((((M * M) * h) * (D * D)) / (t_0 * d_m)) * -0.125) / l;
}
return tmp;
}
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = Float64(d_m / t_0) tmp = 0.0 if (Float64(M * D) <= 5e-151) tmp = t_1; elseif (Float64(M * D) <= 1e+126) tmp = fma(Float64(Float64(Float64(Float64(M * Float64(D * M)) * D) * h) / Float64(Float64(t_0 * l) * d_m)), -0.125, t_1); elseif (Float64(M * D) <= 2e+188) tmp = sqrt(Float64(Float64(d_m / l) * Float64(d_m / h))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(M * M) * h) * Float64(D * D)) / Float64(t_0 * d_m)) * -0.125) / l); end return tmp end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := 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 * D), $MachinePrecision], 5e-151], t$95$1, If[LessEqual[N[(M * D), $MachinePrecision], 1e+126], N[(N[(N[(N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] * h), $MachinePrecision] / N[(N[(t$95$0 * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125 + t$95$1), $MachinePrecision], If[LessEqual[N[(M * D), $MachinePrecision], 2e+188], N[Sqrt[N[(N[(d$95$m / l), $MachinePrecision] * N[(d$95$m / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]]]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \frac{d\_m}{t\_0}\\
\mathbf{if}\;M \cdot D \leq 5 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;M \cdot D \leq 10^{+126}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\left(M \cdot \left(D \cdot M\right)\right) \cdot D\right) \cdot h}{\left(t\_0 \cdot \ell\right) \cdot d\_m}, -0.125, t\_1\right)\\
\mathbf{elif}\;M \cdot D \leq 2 \cdot 10^{+188}:\\
\;\;\;\;\sqrt{\frac{d\_m}{\ell} \cdot \frac{d\_m}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{t\_0 \cdot d\_m} \cdot -0.125}{\ell}\\
\end{array}
\end{array}
if (*.f64 M D) < 5.00000000000000003e-151Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 5.00000000000000003e-151 < (*.f64 M D) < 9.99999999999999925e125Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in h around 0
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.5%
if 9.99999999999999925e125 < (*.f64 M D) < 2e188Initial program 35.8%
Applied rewrites24.5%
Taylor expanded in h around 0
Applied rewrites43.7%
lift-fabs.f64N/A
lift-/.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
frac-timesN/A
sqrt-divN/A
sqrt-divN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if 2e188 < (*.f64 M D) Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6430.1
Applied rewrites30.1%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M 4.1e-116)
(/ d_m t_0)
(/ (* (/ (* (* (* M M) h) (* D D)) (* t_0 d_m)) -0.125) l))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (M <= 4.1e-116) {
tmp = d_m / t_0;
} else {
tmp = (((((M * M) * h) * (D * D)) / (t_0 * d_m)) * -0.125) / l;
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (m <= 4.1d-116) then
tmp = d_m / t_0
else
tmp = (((((m * m) * h) * (d * d)) / (t_0 * d_m)) * (-0.125d0)) / l
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (M <= 4.1e-116) {
tmp = d_m / t_0;
} else {
tmp = (((((M * M) * h) * (D * D)) / (t_0 * d_m)) * -0.125) / l;
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if M <= 4.1e-116: tmp = d_m / t_0 else: tmp = (((((M * M) * h) * (D * D)) / (t_0 * d_m)) * -0.125) / l return tmp
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M <= 4.1e-116) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(M * M) * h) * Float64(D * D)) / Float64(t_0 * d_m)) * -0.125) / l); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if (M <= 4.1e-116) tmp = d_m / t_0; else tmp = (((((M * M) * h) * (D * D)) / (t_0 * d_m)) * -0.125) / l; end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 4.1e-116], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M \leq 4.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{t\_0 \cdot d\_m} \cdot -0.125}{\ell}\\
\end{array}
\end{array}
if M < 4.0999999999999999e-116Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 4.0999999999999999e-116 < M Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6430.1
Applied rewrites30.1%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= M 1.06e-69)
(/ d_m t_0)
(* (/ (* (* (* M M) h) (* D D)) (* (* l d_m) t_0)) -0.125))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (M <= 1.06e-69) {
tmp = d_m / t_0;
} else {
tmp = ((((M * M) * h) * (D * D)) / ((l * d_m) * t_0)) * -0.125;
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (m <= 1.06d-69) then
tmp = d_m / t_0
else
tmp = ((((m * m) * h) * (d * d)) / ((l * d_m) * t_0)) * (-0.125d0)
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (M <= 1.06e-69) {
tmp = d_m / t_0;
} else {
tmp = ((((M * M) * h) * (D * D)) / ((l * d_m) * t_0)) * -0.125;
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if M <= 1.06e-69: tmp = d_m / t_0 else: tmp = ((((M * M) * h) * (D * D)) / ((l * d_m) * t_0)) * -0.125 return tmp
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (M <= 1.06e-69) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(Float64(Float64(M * M) * h) * Float64(D * D)) / Float64(Float64(l * d_m) * t_0)) * -0.125); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if (M <= 1.06e-69) tmp = d_m / t_0; else tmp = ((((M * M) * h) * (D * D)) / ((l * d_m) * t_0)) * -0.125; end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 1.06e-69], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(M * M), $MachinePrecision] * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M \leq 1.06 \cdot 10^{-69}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(\ell \cdot d\_m\right) \cdot t\_0} \cdot -0.125\\
\end{array}
\end{array}
if M < 1.05999999999999997e-69Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 1.05999999999999997e-69 < M Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites29.3%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= (* M D) 2e+19)
(/ d_m t_0)
(* (* (/ (* (* M (* D M)) D) (* (* t_0 l) d_m)) -0.125) h))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if ((M * D) <= 2e+19) {
tmp = d_m / t_0;
} else {
tmp = ((((M * (D * M)) * D) / ((t_0 * l) * d_m)) * -0.125) * h;
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if ((m * d) <= 2d+19) then
tmp = d_m / t_0
else
tmp = ((((m * (d * m)) * d) / ((t_0 * l) * d_m)) * (-0.125d0)) * h
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if ((M * D) <= 2e+19) {
tmp = d_m / t_0;
} else {
tmp = ((((M * (D * M)) * D) / ((t_0 * l) * d_m)) * -0.125) * h;
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if (M * D) <= 2e+19: tmp = d_m / t_0 else: tmp = ((((M * (D * M)) * D) / ((t_0 * l) * d_m)) * -0.125) * h return tmp
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (Float64(M * D) <= 2e+19) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(Float64(Float64(Float64(M * Float64(D * M)) * D) / Float64(Float64(t_0 * l) * d_m)) * -0.125) * h); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if ((M * D) <= 2e+19) tmp = d_m / t_0; else tmp = ((((M * (D * M)) * D) / ((t_0 * l) * d_m)) * -0.125) * h; end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(M * D), $MachinePrecision], 2e+19], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] / N[(N[(t$95$0 * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M \cdot D \leq 2 \cdot 10^{+19}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\left(M \cdot \left(D \cdot M\right)\right) \cdot D}{\left(t\_0 \cdot \ell\right) \cdot d\_m} \cdot -0.125\right) \cdot h\\
\end{array}
\end{array}
if (*.f64 M D) < 2e19Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 2e19 < (*.f64 M D) Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites35.5%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(if (<= l -2e-227)
(/ (- d_m) (* (sqrt (* (/ 1.0 l) h)) l))
(if (<= l -5e-301)
(* (- d_m) (sqrt (/ 1.0 (* l h))))
(if (<= l 6.5e-192)
(* (sqrt (* h d_m)) (/ (* (- d_m) (sqrt (/ 1.0 (* l d_m)))) h))
(/ d_m (* (sqrt l) (sqrt h)))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (sqrt(((1.0 / l) * h)) * l);
} else if (l <= -5e-301) {
tmp = -d_m * sqrt((1.0 / (l * h)));
} else if (l <= 6.5e-192) {
tmp = sqrt((h * d_m)) * ((-d_m * sqrt((1.0 / (l * d_m)))) / h);
} else {
tmp = d_m / (sqrt(l) * sqrt(h));
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: tmp
if (l <= (-2d-227)) then
tmp = -d_m / (sqrt(((1.0d0 / l) * h)) * l)
else if (l <= (-5d-301)) then
tmp = -d_m * sqrt((1.0d0 / (l * h)))
else if (l <= 6.5d-192) then
tmp = sqrt((h * d_m)) * ((-d_m * sqrt((1.0d0 / (l * d_m)))) / h)
else
tmp = d_m / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (Math.sqrt(((1.0 / l) * h)) * l);
} else if (l <= -5e-301) {
tmp = -d_m * Math.sqrt((1.0 / (l * h)));
} else if (l <= 6.5e-192) {
tmp = Math.sqrt((h * d_m)) * ((-d_m * Math.sqrt((1.0 / (l * d_m)))) / h);
} else {
tmp = d_m / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): tmp = 0 if l <= -2e-227: tmp = -d_m / (math.sqrt(((1.0 / l) * h)) * l) elif l <= -5e-301: tmp = -d_m * math.sqrt((1.0 / (l * h))) elif l <= 6.5e-192: tmp = math.sqrt((h * d_m)) * ((-d_m * math.sqrt((1.0 / (l * d_m)))) / h) else: tmp = d_m / (math.sqrt(l) * math.sqrt(h)) return tmp
d_m = abs(d) function code(d_m, h, l, M, D) tmp = 0.0 if (l <= -2e-227) tmp = Float64(Float64(-d_m) / Float64(sqrt(Float64(Float64(1.0 / l) * h)) * l)); elseif (l <= -5e-301) tmp = Float64(Float64(-d_m) * sqrt(Float64(1.0 / Float64(l * h)))); elseif (l <= 6.5e-192) tmp = Float64(sqrt(Float64(h * d_m)) * Float64(Float64(Float64(-d_m) * sqrt(Float64(1.0 / Float64(l * d_m)))) / h)); else tmp = Float64(d_m / Float64(sqrt(l) * sqrt(h))); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) tmp = 0.0; if (l <= -2e-227) tmp = -d_m / (sqrt(((1.0 / l) * h)) * l); elseif (l <= -5e-301) tmp = -d_m * sqrt((1.0 / (l * h))); elseif (l <= 6.5e-192) tmp = sqrt((h * d_m)) * ((-d_m * sqrt((1.0 / (l * d_m)))) / h); else tmp = d_m / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision] code[d$95$m_, h_, l_, M_, D_] := If[LessEqual[l, -2e-227], N[((-d$95$m) / N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * h), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-301], N[((-d$95$m) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.5e-192], N[(N[Sqrt[N[(h * d$95$m), $MachinePrecision]], $MachinePrecision] * N[(N[((-d$95$m) * N[Sqrt[N[(1.0 / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision], N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-227}:\\
\;\;\;\;\frac{-d\_m}{\sqrt{\frac{1}{\ell} \cdot h} \cdot \ell}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-301}:\\
\;\;\;\;\left(-d\_m\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 6.5 \cdot 10^{-192}:\\
\;\;\;\;\sqrt{h \cdot d\_m} \cdot \frac{\left(-d\_m\right) \cdot \sqrt{\frac{1}{\ell \cdot d\_m}}}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.99999999999999989e-227Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6424.1
Applied rewrites24.1%
if -1.99999999999999989e-227 < l < -5.00000000000000013e-301Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in d around -inf
pow1/2N/A
times-fracN/A
metadata-evalN/A
pow-prod-downN/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
rem-square-sqrtN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
Applied rewrites10.2%
if -5.00000000000000013e-301 < l < 6.49999999999999966e-192Initial program 35.8%
Taylor expanded in h around 0
lower-/.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6421.9
Applied rewrites21.9%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
sqrt-unprodN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-/.f64N/A
lift-sqrt.f64N/A
lift-/.f6418.0
Applied rewrites18.0%
Taylor expanded in d around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f647.2
Applied rewrites7.2%
if 6.49999999999999966e-192 < l Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6425.4
Applied rewrites25.4%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(if (<= l -2e-227)
(/ (- d_m) (* (sqrt (* (/ 1.0 l) h)) l))
(if (<= l 4.6e-235)
(/ (- (* (/ (fabs d_m) (sqrt (* l h))) h)) h)
(/ d_m (* (sqrt l) (sqrt h))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (sqrt(((1.0 / l) * h)) * l);
} else if (l <= 4.6e-235) {
tmp = -((fabs(d_m) / sqrt((l * h))) * h) / h;
} else {
tmp = d_m / (sqrt(l) * sqrt(h));
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: tmp
if (l <= (-2d-227)) then
tmp = -d_m / (sqrt(((1.0d0 / l) * h)) * l)
else if (l <= 4.6d-235) then
tmp = -((abs(d_m) / sqrt((l * h))) * h) / h
else
tmp = d_m / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (Math.sqrt(((1.0 / l) * h)) * l);
} else if (l <= 4.6e-235) {
tmp = -((Math.abs(d_m) / Math.sqrt((l * h))) * h) / h;
} else {
tmp = d_m / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): tmp = 0 if l <= -2e-227: tmp = -d_m / (math.sqrt(((1.0 / l) * h)) * l) elif l <= 4.6e-235: tmp = -((math.fabs(d_m) / math.sqrt((l * h))) * h) / h else: tmp = d_m / (math.sqrt(l) * math.sqrt(h)) return tmp
d_m = abs(d) function code(d_m, h, l, M, D) tmp = 0.0 if (l <= -2e-227) tmp = Float64(Float64(-d_m) / Float64(sqrt(Float64(Float64(1.0 / l) * h)) * l)); elseif (l <= 4.6e-235) tmp = Float64(Float64(-Float64(Float64(abs(d_m) / sqrt(Float64(l * h))) * h)) / h); else tmp = Float64(d_m / Float64(sqrt(l) * sqrt(h))); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) tmp = 0.0; if (l <= -2e-227) tmp = -d_m / (sqrt(((1.0 / l) * h)) * l); elseif (l <= 4.6e-235) tmp = -((abs(d_m) / sqrt((l * h))) * h) / h; else tmp = d_m / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision] code[d$95$m_, h_, l_, M_, D_] := If[LessEqual[l, -2e-227], N[((-d$95$m) / N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * h), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.6e-235], N[((-N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision]) / h), $MachinePrecision], N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-227}:\\
\;\;\;\;\frac{-d\_m}{\sqrt{\frac{1}{\ell} \cdot h} \cdot \ell}\\
\mathbf{elif}\;\ell \leq 4.6 \cdot 10^{-235}:\\
\;\;\;\;\frac{-\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot h}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.99999999999999989e-227Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6424.1
Applied rewrites24.1%
if -1.99999999999999989e-227 < l < 4.59999999999999995e-235Initial program 35.8%
Taylor expanded in h around 0
lower-/.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6421.9
Applied rewrites21.9%
Taylor expanded in h around -inf
mul-1-negN/A
pow2N/A
times-fracN/A
sqrt-unprodN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites11.9%
if 4.59999999999999995e-235 < l Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6425.4
Applied rewrites25.4%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(if (<= l -2e-227)
(/ (- d_m) (* (sqrt (* (/ 1.0 l) h)) l))
(if (<= l 4.6e-235)
(* (- d_m) (sqrt (/ 1.0 (* l h))))
(/ d_m (* (sqrt l) (sqrt h))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (sqrt(((1.0 / l) * h)) * l);
} else if (l <= 4.6e-235) {
tmp = -d_m * sqrt((1.0 / (l * h)));
} else {
tmp = d_m / (sqrt(l) * sqrt(h));
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: tmp
if (l <= (-2d-227)) then
tmp = -d_m / (sqrt(((1.0d0 / l) * h)) * l)
else if (l <= 4.6d-235) then
tmp = -d_m * sqrt((1.0d0 / (l * h)))
else
tmp = d_m / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (Math.sqrt(((1.0 / l) * h)) * l);
} else if (l <= 4.6e-235) {
tmp = -d_m * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d_m / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): tmp = 0 if l <= -2e-227: tmp = -d_m / (math.sqrt(((1.0 / l) * h)) * l) elif l <= 4.6e-235: tmp = -d_m * math.sqrt((1.0 / (l * h))) else: tmp = d_m / (math.sqrt(l) * math.sqrt(h)) return tmp
d_m = abs(d) function code(d_m, h, l, M, D) tmp = 0.0 if (l <= -2e-227) tmp = Float64(Float64(-d_m) / Float64(sqrt(Float64(Float64(1.0 / l) * h)) * l)); elseif (l <= 4.6e-235) tmp = Float64(Float64(-d_m) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d_m / Float64(sqrt(l) * sqrt(h))); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) tmp = 0.0; if (l <= -2e-227) tmp = -d_m / (sqrt(((1.0 / l) * h)) * l); elseif (l <= 4.6e-235) tmp = -d_m * sqrt((1.0 / (l * h))); else tmp = d_m / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision] code[d$95$m_, h_, l_, M_, D_] := If[LessEqual[l, -2e-227], N[((-d$95$m) / N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * h), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.6e-235], N[((-d$95$m) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-227}:\\
\;\;\;\;\frac{-d\_m}{\sqrt{\frac{1}{\ell} \cdot h} \cdot \ell}\\
\mathbf{elif}\;\ell \leq 4.6 \cdot 10^{-235}:\\
\;\;\;\;\left(-d\_m\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.99999999999999989e-227Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6424.1
Applied rewrites24.1%
if -1.99999999999999989e-227 < l < 4.59999999999999995e-235Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in d around -inf
pow1/2N/A
times-fracN/A
metadata-evalN/A
pow-prod-downN/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
rem-square-sqrtN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
Applied rewrites10.2%
if 4.59999999999999995e-235 < l Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6425.4
Applied rewrites25.4%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(if (<= l -2e-227)
(/ (- d_m) (* (sqrt (/ h l)) l))
(if (<= l 4.6e-235)
(* (- d_m) (sqrt (/ 1.0 (* l h))))
(/ d_m (* (sqrt l) (sqrt h))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (sqrt((h / l)) * l);
} else if (l <= 4.6e-235) {
tmp = -d_m * sqrt((1.0 / (l * h)));
} else {
tmp = d_m / (sqrt(l) * sqrt(h));
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: tmp
if (l <= (-2d-227)) then
tmp = -d_m / (sqrt((h / l)) * l)
else if (l <= 4.6d-235) then
tmp = -d_m * sqrt((1.0d0 / (l * h)))
else
tmp = d_m / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-227) {
tmp = -d_m / (Math.sqrt((h / l)) * l);
} else if (l <= 4.6e-235) {
tmp = -d_m * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d_m / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): tmp = 0 if l <= -2e-227: tmp = -d_m / (math.sqrt((h / l)) * l) elif l <= 4.6e-235: tmp = -d_m * math.sqrt((1.0 / (l * h))) else: tmp = d_m / (math.sqrt(l) * math.sqrt(h)) return tmp
d_m = abs(d) function code(d_m, h, l, M, D) tmp = 0.0 if (l <= -2e-227) tmp = Float64(Float64(-d_m) / Float64(sqrt(Float64(h / l)) * l)); elseif (l <= 4.6e-235) tmp = Float64(Float64(-d_m) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d_m / Float64(sqrt(l) * sqrt(h))); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) tmp = 0.0; if (l <= -2e-227) tmp = -d_m / (sqrt((h / l)) * l); elseif (l <= 4.6e-235) tmp = -d_m * sqrt((1.0 / (l * h))); else tmp = d_m / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision] code[d$95$m_, h_, l_, M_, D_] := If[LessEqual[l, -2e-227], N[((-d$95$m) / N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.6e-235], N[((-d$95$m) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-227}:\\
\;\;\;\;\frac{-d\_m}{\sqrt{\frac{h}{\ell}} \cdot \ell}\\
\mathbf{elif}\;\ell \leq 4.6 \cdot 10^{-235}:\\
\;\;\;\;\left(-d\_m\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.99999999999999989e-227Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6424.1
Applied rewrites24.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-/.f6424.1
Applied rewrites24.1%
if -1.99999999999999989e-227 < l < 4.59999999999999995e-235Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in d around -inf
pow1/2N/A
times-fracN/A
metadata-evalN/A
pow-prod-downN/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
rem-square-sqrtN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
Applied rewrites10.2%
if 4.59999999999999995e-235 < l Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6425.4
Applied rewrites25.4%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(if (<= (* M D) 4.5e-35)
(/ d_m (sqrt (* l h)))
(if (<= (* M D) 8e+189)
(sqrt (* (/ d_m l) (/ d_m h)))
(* (- d_m) (sqrt (/ 1.0 (* l h)))))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double tmp;
if ((M * D) <= 4.5e-35) {
tmp = d_m / sqrt((l * h));
} else if ((M * D) <= 8e+189) {
tmp = sqrt(((d_m / l) * (d_m / h)));
} else {
tmp = -d_m * sqrt((1.0 / (l * h)));
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: tmp
if ((m * d) <= 4.5d-35) then
tmp = d_m / sqrt((l * h))
else if ((m * d) <= 8d+189) then
tmp = sqrt(((d_m / l) * (d_m / h)))
else
tmp = -d_m * sqrt((1.0d0 / (l * h)))
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double tmp;
if ((M * D) <= 4.5e-35) {
tmp = d_m / Math.sqrt((l * h));
} else if ((M * D) <= 8e+189) {
tmp = Math.sqrt(((d_m / l) * (d_m / h)));
} else {
tmp = -d_m * Math.sqrt((1.0 / (l * h)));
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): tmp = 0 if (M * D) <= 4.5e-35: tmp = d_m / math.sqrt((l * h)) elif (M * D) <= 8e+189: tmp = math.sqrt(((d_m / l) * (d_m / h))) else: tmp = -d_m * math.sqrt((1.0 / (l * h))) return tmp
d_m = abs(d) function code(d_m, h, l, M, D) tmp = 0.0 if (Float64(M * D) <= 4.5e-35) tmp = Float64(d_m / sqrt(Float64(l * h))); elseif (Float64(M * D) <= 8e+189) tmp = sqrt(Float64(Float64(d_m / l) * Float64(d_m / h))); else tmp = Float64(Float64(-d_m) * sqrt(Float64(1.0 / Float64(l * h)))); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) tmp = 0.0; if ((M * D) <= 4.5e-35) tmp = d_m / sqrt((l * h)); elseif ((M * D) <= 8e+189) tmp = sqrt(((d_m / l) * (d_m / h))); else tmp = -d_m * sqrt((1.0 / (l * h))); end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision] code[d$95$m_, h_, l_, M_, D_] := If[LessEqual[N[(M * D), $MachinePrecision], 4.5e-35], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * D), $MachinePrecision], 8e+189], N[Sqrt[N[(N[(d$95$m / l), $MachinePrecision] * N[(d$95$m / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[((-d$95$m) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 4.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;M \cdot D \leq 8 \cdot 10^{+189}:\\
\;\;\;\;\sqrt{\frac{d\_m}{\ell} \cdot \frac{d\_m}{h}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\_m\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\end{array}
\end{array}
if (*.f64 M D) < 4.5000000000000001e-35Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 4.5000000000000001e-35 < (*.f64 M D) < 8.0000000000000002e189Initial program 35.8%
Applied rewrites24.5%
Taylor expanded in h around 0
Applied rewrites43.7%
lift-fabs.f64N/A
lift-/.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
frac-timesN/A
sqrt-divN/A
sqrt-divN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if 8.0000000000000002e189 < (*.f64 M D) Initial program 35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
frac-timesN/A
unpow2N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6443.2
Applied rewrites43.2%
Taylor expanded in d around -inf
pow1/2N/A
times-fracN/A
metadata-evalN/A
pow-prod-downN/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
rem-square-sqrtN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
sqrt-divN/A
metadata-evalN/A
sqrt-unprodN/A
Applied rewrites10.2%
d_m = (fabs.f64 d)
(FPCore (d_m h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= (* M D) 4.5e-35)
(/ d_m t_0)
(if (<= (* M D) 8e+189) (sqrt (* (/ d_m l) (/ d_m h))) (/ (- d_m) t_0)))))d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if ((M * D) <= 4.5e-35) {
tmp = d_m / t_0;
} else if ((M * D) <= 8e+189) {
tmp = sqrt(((d_m / l) * (d_m / h)));
} else {
tmp = -d_m / t_0;
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if ((m * d) <= 4.5d-35) then
tmp = d_m / t_0
else if ((m * d) <= 8d+189) then
tmp = sqrt(((d_m / l) * (d_m / h)))
else
tmp = -d_m / t_0
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if ((M * D) <= 4.5e-35) {
tmp = d_m / t_0;
} else if ((M * D) <= 8e+189) {
tmp = Math.sqrt(((d_m / l) * (d_m / h)));
} else {
tmp = -d_m / t_0;
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if (M * D) <= 4.5e-35: tmp = d_m / t_0 elif (M * D) <= 8e+189: tmp = math.sqrt(((d_m / l) * (d_m / h))) else: tmp = -d_m / t_0 return tmp
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (Float64(M * D) <= 4.5e-35) tmp = Float64(d_m / t_0); elseif (Float64(M * D) <= 8e+189) tmp = sqrt(Float64(Float64(d_m / l) * Float64(d_m / h))); else tmp = Float64(Float64(-d_m) / t_0); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if ((M * D) <= 4.5e-35) tmp = d_m / t_0; elseif ((M * D) <= 8e+189) tmp = sqrt(((d_m / l) * (d_m / h))); else tmp = -d_m / t_0; end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(M * D), $MachinePrecision], 4.5e-35], N[(d$95$m / t$95$0), $MachinePrecision], If[LessEqual[N[(M * D), $MachinePrecision], 8e+189], N[Sqrt[N[(N[(d$95$m / l), $MachinePrecision] * N[(d$95$m / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[((-d$95$m) / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M \cdot D \leq 4.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{elif}\;M \cdot D \leq 8 \cdot 10^{+189}:\\
\;\;\;\;\sqrt{\frac{d\_m}{\ell} \cdot \frac{d\_m}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-d\_m}{t\_0}\\
\end{array}
\end{array}
if (*.f64 M D) < 4.5000000000000001e-35Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 4.5000000000000001e-35 < (*.f64 M D) < 8.0000000000000002e189Initial program 35.8%
Applied rewrites24.5%
Taylor expanded in h around 0
Applied rewrites43.7%
lift-fabs.f64N/A
lift-/.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
frac-timesN/A
sqrt-divN/A
sqrt-divN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if 8.0000000000000002e189 < (*.f64 M D) Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6424.1
Applied rewrites24.1%
Taylor expanded in l around 0
sqrt-prodN/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
sqrt-prodN/A
lift-sqrt.f64N/A
lift-*.f649.9
Applied rewrites9.9%
d_m = (fabs.f64 d) (FPCore (d_m h l M D) :precision binary64 (let* ((t_0 (sqrt (* l h)))) (if (<= (* M D) 4.4e+172) (/ d_m t_0) (/ (- d_m) t_0))))
d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if ((M * D) <= 4.4e+172) {
tmp = d_m / t_0;
} else {
tmp = -d_m / t_0;
}
return tmp;
}
d_m = private
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, d)
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
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if ((m * d) <= 4.4d+172) then
tmp = d_m / t_0
else
tmp = -d_m / t_0
end if
code = tmp
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if ((M * D) <= 4.4e+172) {
tmp = d_m / t_0;
} else {
tmp = -d_m / t_0;
}
return tmp;
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if (M * D) <= 4.4e+172: tmp = d_m / t_0 else: tmp = -d_m / t_0 return tmp
d_m = abs(d) function code(d_m, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (Float64(M * D) <= 4.4e+172) tmp = Float64(d_m / t_0); else tmp = Float64(Float64(-d_m) / t_0); end return tmp end
d_m = abs(d); function tmp_2 = code(d_m, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if ((M * D) <= 4.4e+172) tmp = d_m / t_0; else tmp = -d_m / t_0; end tmp_2 = tmp; end
d_m = N[Abs[d], $MachinePrecision]
code[d$95$m_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(M * D), $MachinePrecision], 4.4e+172], N[(d$95$m / t$95$0), $MachinePrecision], N[((-d$95$m) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;M \cdot D \leq 4.4 \cdot 10^{+172}:\\
\;\;\;\;\frac{d\_m}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-d\_m}{t\_0}\\
\end{array}
\end{array}
if (*.f64 M D) < 4.4000000000000002e172Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 4.4000000000000002e172 < (*.f64 M D) Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f6424.1
Applied rewrites24.1%
Taylor expanded in l around 0
sqrt-prodN/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
sqrt-prodN/A
lift-sqrt.f64N/A
lift-*.f649.9
Applied rewrites9.9%
d_m = (fabs.f64 d) (FPCore (d_m h l M D) :precision binary64 (/ d_m (sqrt (* l h))))
d_m = fabs(d);
double code(double d_m, double h, double l, double M, double D) {
return d_m / sqrt((l * h));
}
d_m = private
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, d)
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
real(8), intent (in) :: d
code = d_m / sqrt((l * h))
end function
d_m = Math.abs(d);
public static double code(double d_m, double h, double l, double M, double D) {
return d_m / Math.sqrt((l * h));
}
d_m = math.fabs(d) def code(d_m, h, l, M, D): return d_m / math.sqrt((l * h))
d_m = abs(d) function code(d_m, h, l, M, D) return Float64(d_m / sqrt(Float64(l * h))) end
d_m = abs(d); function tmp = code(d_m, h, l, M, D) tmp = d_m / sqrt((l * h)); end
d_m = N[Abs[d], $MachinePrecision] code[d$95$m_, h_, l_, M_, D_] := N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
d_m = \left|d\right|
\\
\frac{d\_m}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 35.8%
Taylor expanded in h around inf
Applied rewrites21.1%
Taylor expanded in l around inf
lower-/.f64N/A
Applied rewrites25.5%
Taylor expanded in d around inf
sqrt-prodN/A
lower-/.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
herbie shell --seed 2025138
(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)))))