
(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}
Sampling outcomes in binary64 precision:
Herbie found 16 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}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (/ (* M D) (* 2.0 d)) 2.0))
(t_1 (- 1.0 (* (* (/ 1.0 2.0) t_0) (/ h l))))
(t_2 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) t_1)))
(if (<= t_2 4e+264)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* (* 0.5 t_0) (/ h l))))
(if (<= t_2 INFINITY)
(* (* (- d) (pow (* h l) -0.5)) t_1)
(/ (* (* (pow (/ h l) 1.5) (/ (* (* D M) (* D M)) d)) -0.125) h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * D) / (2.0 * d)), 2.0);
double t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l));
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * t_1;
double tmp;
if (t_2 <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (-d * pow((h * l), -0.5)) * t_1;
} else {
tmp = ((pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow(((M * D) / (2.0 * d)), 2.0);
double t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l));
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * t_1;
double tmp;
if (t_2 <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (-d * Math.pow((h * l), -0.5)) * t_1;
} else {
tmp = ((Math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow(((M * D) / (2.0 * d)), 2.0) t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l)) t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * t_1 tmp = 0 if t_2 <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l))) elif t_2 <= math.inf: tmp = (-d * math.pow((h * l), -0.5)) * t_1 else: tmp = ((math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0 t_1 = Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * t_0) * Float64(h / l))) t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * t_1) tmp = 0.0 if (t_2 <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(0.5 * t_0) * Float64(h / l)))); elseif (t_2 <= Inf) tmp = Float64(Float64(Float64(-d) * (Float64(h * l) ^ -0.5)) * t_1); else tmp = Float64(Float64(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(Float64(D * M) * Float64(D * M)) / d)) * -0.125) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * D) / (2.0 * d)) ^ 2.0; t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l)); t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * t_1; tmp = 0.0; if (t_2 <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l))); elseif (t_2 <= Inf) tmp = (-d * ((h * l) ^ -0.5)) * t_1; else tmp = ((((h / l) ^ 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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] * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / h), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\
t_1 := 1 - \left(\frac{1}{2} \cdot t\_0\right) \cdot \frac{h}{\ell}\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(0.5 \cdot t\_0\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\left(\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 85.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
metadata-eval85.9
Applied rewrites85.9%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 50.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6450.8
Applied rewrites50.8%
Taylor expanded in h around -inf
*-commutativeN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
associate-*l*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
inv-powN/A
*-commutativeN/A
sqrt-pow1N/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval65.6
Applied rewrites65.6%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites26.5%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-divN/A
sqrt-pow1N/A
lower-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f6442.1
Applied rewrites42.1%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6442.1
Applied rewrites42.1%
Final simplification74.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ M 2.0) (/ D d)))
(t_1 (pow (/ (* M D) (* 2.0 d)) 2.0))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) t_1) (/ h l))))))
(if (<= t_2 4e+264)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* (* 0.5 t_1) (/ h l))))
(if (<= t_2 INFINITY)
(*
(* (- d) (sqrt (pow (* h l) -1.0)))
(- 1.0 (* (* (/ 1.0 2.0) (* t_0 t_0)) (/ h l))))
(/ (* (* (pow (/ h l) 1.5) (/ (* (* D M) (* D M)) d)) -0.125) h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M / 2.0) * (D / d);
double t_1 = pow(((M * D) / (2.0 * d)), 2.0);
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l)));
double tmp;
if (t_2 <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (-d * sqrt(pow((h * l), -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l)));
} else {
tmp = ((pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (M / 2.0) * (D / d);
double t_1 = Math.pow(((M * D) / (2.0 * d)), 2.0);
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l)));
double tmp;
if (t_2 <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l)));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (-d * Math.sqrt(Math.pow((h * l), -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l)));
} else {
tmp = ((Math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M / 2.0) * (D / d) t_1 = math.pow(((M * D) / (2.0 * d)), 2.0) t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l))) tmp = 0 if t_2 <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l))) elif t_2 <= math.inf: tmp = (-d * math.sqrt(math.pow((h * l), -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l))) else: tmp = ((math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M / 2.0) * Float64(D / d)) t_1 = Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0 t_2 = 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) * t_1) * Float64(h / l)))) tmp = 0.0 if (t_2 <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(0.5 * t_1) * Float64(h / l)))); elseif (t_2 <= Inf) tmp = Float64(Float64(Float64(-d) * sqrt((Float64(h * l) ^ -1.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * Float64(t_0 * t_0)) * Float64(h / l)))); else tmp = Float64(Float64(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(Float64(D * M) * Float64(D * M)) / d)) * -0.125) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M / 2.0) * (D / d); t_1 = ((M * D) / (2.0 * d)) ^ 2.0; t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l))); tmp = 0.0; if (t_2 <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l))); elseif (t_2 <= Inf) tmp = (-d * sqrt(((h * l) ^ -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l))); else tmp = ((((h / l) ^ 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = 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] * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[((-d) * N[Sqrt[N[Power[N[(h * l), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / h), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M}{2} \cdot \frac{D}{d}\\
t_1 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\
t_2 := \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 t\_1\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_2 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(0.5 \cdot t\_1\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 85.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
metadata-eval85.9
Applied rewrites85.9%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 50.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6450.8
Applied rewrites50.8%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
unpow2N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6450.8
Applied rewrites50.8%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
associate-*l*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-*.f6465.5
Applied rewrites65.5%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites26.5%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-divN/A
sqrt-pow1N/A
lower-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f6442.1
Applied rewrites42.1%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6442.1
Applied rewrites42.1%
Final simplification74.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (/ (* M D) (* 2.0 d)) 2.0))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) t_0) (/ h l))))))
(if (<= t_1 4e+264)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* (* 0.5 t_0) (/ h l))))
(if (<= t_1 INFINITY)
(* (- (pow (* h l) -0.5)) d)
(/ (* (* (pow (/ h l) 1.5) (/ (* (* D M) (* D M)) d)) -0.125) h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * D) / (2.0 * d)), 2.0);
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_0) * (h / l)));
double tmp;
if (t_1 <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = -pow((h * l), -0.5) * d;
} else {
tmp = ((pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow(((M * D) / (2.0 * d)), 2.0);
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_0) * (h / l)));
double tmp;
if (t_1 <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = -Math.pow((h * l), -0.5) * d;
} else {
tmp = ((Math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow(((M * D) / (2.0 * d)), 2.0) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_0) * (h / l))) tmp = 0 if t_1 <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l))) elif t_1 <= math.inf: tmp = -math.pow((h * l), -0.5) * d else: tmp = ((math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0 t_1 = 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) * t_0) * Float64(h / l)))) tmp = 0.0 if (t_1 <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(0.5 * t_0) * Float64(h / l)))); elseif (t_1 <= Inf) tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d); else tmp = Float64(Float64(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(Float64(D * M) * Float64(D * M)) / d)) * -0.125) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * D) / (2.0 * d)) ^ 2.0; t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_0) * (h / l))); tmp = 0.0; if (t_1 <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l))); elseif (t_1 <= Inf) tmp = -((h * l) ^ -0.5) * d; else tmp = ((((h / l) ^ 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = 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] * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / h), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\
t_1 := \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 t\_0\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(0.5 \cdot t\_0\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 85.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
metadata-eval85.9
Applied rewrites85.9%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 50.8%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
inv-powN/A
*-commutativeN/A
sqrt-pow1N/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval64.9
Applied rewrites64.9%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites26.5%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-divN/A
sqrt-pow1N/A
lower-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f6442.1
Applied rewrites42.1%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6442.1
Applied rewrites42.1%
Final simplification74.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (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))))))
(if (<= t_0 4e+264)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(-
1.0
(* (* (* 0.5 (/ D d)) (/ M 2.0)) (* (* (/ D d) (/ M 2.0)) (/ h l)))))
(if (<= t_0 INFINITY)
(* (- (pow (* h l) -0.5)) d)
(/ (* (* (pow (/ h l) 1.5) (/ (* (* D M) (* D M)) d)) -0.125) h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (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 tmp;
if (t_0 <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = -pow((h * l), -0.5) * d;
} else {
tmp = ((pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (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)));
double tmp;
if (t_0 <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = -Math.pow((h * l), -0.5) * d;
} else {
tmp = ((Math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (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))) tmp = 0 if t_0 <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l)))) elif t_0 <= math.inf: tmp = -math.pow((h * l), -0.5) * d else: tmp = ((math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h return tmp
function code(d, h, l, M, D) t_0 = 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)))) tmp = 0.0 if (t_0 <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(D / d)) * Float64(M / 2.0)) * Float64(Float64(Float64(D / d) * Float64(M / 2.0)) * Float64(h / l))))); elseif (t_0 <= Inf) tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d); else tmp = Float64(Float64(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(Float64(D * M) * Float64(D * M)) / d)) * -0.125) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((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))); tmp = 0.0; if (t_0 <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l)))); elseif (t_0 <= Inf) tmp = -((h * l) ^ -0.5) * d; else tmp = ((((h / l) ^ 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / h), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \frac{D}{d}\right) \cdot \frac{M}{2}\right) \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 85.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
metadata-eval85.9
Applied rewrites85.9%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites84.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f6486.3
Applied rewrites86.3%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 50.8%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
inv-powN/A
*-commutativeN/A
sqrt-pow1N/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval64.9
Applied rewrites64.9%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites26.5%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-divN/A
sqrt-pow1N/A
lower-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f6442.1
Applied rewrites42.1%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6442.1
Applied rewrites42.1%
Final simplification74.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (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)))))
(t_1 (* (sqrt (/ d l)) (sqrt (/ d h)))))
(if (<= t_0 -2e-143)
(* t_1 (fma (/ -0.125 (* d d)) (/ (* (* (* D M) (* D M)) h) l) 1.0))
(if (<= t_0 4e+264) (* t_1 1.0) (* (- (pow (* h l) -0.5)) d)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (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 t_1 = sqrt((d / l)) * sqrt((d / h));
double tmp;
if (t_0 <= -2e-143) {
tmp = t_1 * fma((-0.125 / (d * d)), ((((D * M) * (D * M)) * h) / l), 1.0);
} else if (t_0 <= 4e+264) {
tmp = t_1 * 1.0;
} else {
tmp = -pow((h * l), -0.5) * d;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = 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)))) t_1 = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) tmp = 0.0 if (t_0 <= -2e-143) tmp = Float64(t_1 * fma(Float64(-0.125 / Float64(d * d)), Float64(Float64(Float64(Float64(D * M) * Float64(D * M)) * h) / l), 1.0)); elseif (t_0 <= 4e+264) tmp = Float64(t_1 * 1.0); else tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-143], N[(t$95$1 * N[(N[(-0.125 / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], N[(t$95$1 * 1.0), $MachinePrecision], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
t_1 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-143}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\frac{-0.125}{d \cdot d}, \frac{\left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right) \cdot h}{\ell}, 1\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;t\_1 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-143Initial program 81.2%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6481.2
Applied rewrites81.2%
Taylor expanded in d around inf
+-commutativeN/A
Applied rewrites59.8%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6459.8
Applied rewrites59.8%
if -1.9999999999999999e-143 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 89.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6489.1
Applied rewrites89.1%
Taylor expanded in d around inf
Applied rewrites88.7%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 19.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
inv-powN/A
*-commutativeN/A
sqrt-pow1N/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval32.5
Applied rewrites32.5%
Final simplification62.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (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)))))
(t_1 (* (sqrt (/ d l)) (sqrt (/ d h)))))
(if (<= t_0 -2e-143)
(* t_1 (fma (/ -0.125 (* d d)) (/ (* (* (* D M) (* D M)) h) l) 1.0))
(if (<= t_0 4e+264) (* t_1 1.0) (* (- (sqrt (/ 1.0 (* h l)))) d)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (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 t_1 = sqrt((d / l)) * sqrt((d / h));
double tmp;
if (t_0 <= -2e-143) {
tmp = t_1 * fma((-0.125 / (d * d)), ((((D * M) * (D * M)) * h) / l), 1.0);
} else if (t_0 <= 4e+264) {
tmp = t_1 * 1.0;
} else {
tmp = -sqrt((1.0 / (h * l))) * d;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = 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)))) t_1 = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) tmp = 0.0 if (t_0 <= -2e-143) tmp = Float64(t_1 * fma(Float64(-0.125 / Float64(d * d)), Float64(Float64(Float64(Float64(D * M) * Float64(D * M)) * h) / l), 1.0)); elseif (t_0 <= 4e+264) tmp = Float64(t_1 * 1.0); else tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-143], N[(t$95$1 * N[(N[(-0.125 / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], N[(t$95$1 * 1.0), $MachinePrecision], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
t_1 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-143}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\frac{-0.125}{d \cdot d}, \frac{\left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right) \cdot h}{\ell}, 1\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;t\_1 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-143Initial program 81.2%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6481.2
Applied rewrites81.2%
Taylor expanded in d around inf
+-commutativeN/A
Applied rewrites59.8%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6459.8
Applied rewrites59.8%
if -1.9999999999999999e-143 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 89.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6489.1
Applied rewrites89.1%
Taylor expanded in d around inf
Applied rewrites88.7%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 19.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-*.f6432.5
Applied rewrites32.5%
lift-*.f64N/A
lift-pow.f64N/A
inv-powN/A
lower-/.f64N/A
lift-*.f6432.5
Applied rewrites32.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (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))))))
(if (<= t_0 -100.0)
(*
(sqrt (* (/ d l) (/ d h)))
(* (/ (* (* (* M D) (* M D)) h) (* (* d d) l)) -0.125))
(if (<= t_0 4e+264)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
(* (- (sqrt (/ 1.0 (* h l)))) d)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (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 tmp;
if (t_0 <= -100.0) {
tmp = sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125);
} else if (t_0 <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
} else {
tmp = -sqrt((1.0 / (h * l))) * d;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: t_0
real(8) :: tmp
t_0 = (((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)))
if (t_0 <= (-100.0d0)) then
tmp = sqrt(((d / l) * (d / h))) * (((((m * d_1) * (m * d_1)) * h) / ((d * d) * l)) * (-0.125d0))
else if (t_0 <= 4d+264) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
else
tmp = -sqrt((1.0d0 / (h * l))) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (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)));
double tmp;
if (t_0 <= -100.0) {
tmp = Math.sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125);
} else if (t_0 <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
} else {
tmp = -Math.sqrt((1.0 / (h * l))) * d;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (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))) tmp = 0 if t_0 <= -100.0: tmp = math.sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125) elif t_0 <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0 else: tmp = -math.sqrt((1.0 / (h * l))) * d return tmp
function code(d, h, l, M, D) t_0 = 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)))) tmp = 0.0 if (t_0 <= -100.0) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) * h) / Float64(Float64(d * d) * l)) * -0.125)); elseif (t_0 <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0); else tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((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))); tmp = 0.0; if (t_0 <= -100.0) tmp = sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125); elseif (t_0 <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0; else tmp = -sqrt((1.0 / (h * l))) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -100.0], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
\mathbf{if}\;t\_0 \leq -100:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -100Initial program 81.0%
Taylor expanded in d around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
*-commutativeN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.8
Applied rewrites61.8%
Applied rewrites53.8%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6453.8
Applied rewrites53.8%
if -100 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 88.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6488.9
Applied rewrites88.9%
Taylor expanded in d around inf
Applied rewrites85.5%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 19.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-*.f6432.5
Applied rewrites32.5%
lift-*.f64N/A
lift-pow.f64N/A
inv-powN/A
lower-/.f64N/A
lift-*.f6432.5
Applied rewrites32.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (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))))))
(if (<= t_0 -2e+222)
(*
(sqrt (* (/ d l) (/ d h)))
(* (* (* D D) (* (* M M) (/ h (* (* d d) l)))) -0.125))
(if (<= t_0 4e+264)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
(* (- (sqrt (/ 1.0 (* h l)))) d)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (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 tmp;
if (t_0 <= -2e+222) {
tmp = sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125);
} else if (t_0 <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
} else {
tmp = -sqrt((1.0 / (h * l))) * d;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: t_0
real(8) :: tmp
t_0 = (((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)))
if (t_0 <= (-2d+222)) then
tmp = sqrt(((d / l) * (d / h))) * (((d_1 * d_1) * ((m * m) * (h / ((d * d) * l)))) * (-0.125d0))
else if (t_0 <= 4d+264) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
else
tmp = -sqrt((1.0d0 / (h * l))) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (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)));
double tmp;
if (t_0 <= -2e+222) {
tmp = Math.sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125);
} else if (t_0 <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
} else {
tmp = -Math.sqrt((1.0 / (h * l))) * d;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (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))) tmp = 0 if t_0 <= -2e+222: tmp = math.sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125) elif t_0 <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0 else: tmp = -math.sqrt((1.0 / (h * l))) * d return tmp
function code(d, h, l, M, D) t_0 = 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)))) tmp = 0.0 if (t_0 <= -2e+222) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(Float64(Float64(D * D) * Float64(Float64(M * M) * Float64(h / Float64(Float64(d * d) * l)))) * -0.125)); elseif (t_0 <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0); else tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((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))); tmp = 0.0; if (t_0 <= -2e+222) tmp = sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125); elseif (t_0 <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0; else tmp = -sqrt((1.0 / (h * l))) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -2e+222], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[(h / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+222}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot -0.125\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000001e222Initial program 78.6%
Taylor expanded in d around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
*-commutativeN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6459.5
Applied rewrites59.5%
Applied rewrites50.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6443.6
Applied rewrites43.6%
if -2.0000000000000001e222 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 89.6%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6489.6
Applied rewrites89.6%
Taylor expanded in d around inf
Applied rewrites79.6%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 19.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-*.f6432.5
Applied rewrites32.5%
lift-*.f64N/A
lift-pow.f64N/A
inv-powN/A
lower-/.f64N/A
lift-*.f6432.5
Applied rewrites32.5%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (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))))
4e+264)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(-
1.0
(* (* (* 0.5 (/ D d)) (/ M 2.0)) (* (* (/ D d) (/ M 2.0)) (/ h l)))))
(* (- (pow (* h l) -0.5)) d)))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((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)))) <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))));
} else {
tmp = -pow((h * l), -0.5) * d;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: tmp
if (((((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)))) <= 4d+264) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((0.5d0 * (d_1 / d)) * (m / 2.0d0)) * (((d_1 / d) * (m / 2.0d0)) * (h / l))))
else
tmp = -((h * l) ** (-0.5d0)) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((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)))) <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))));
} else {
tmp = -Math.pow((h * l), -0.5) * d;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((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)))) <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l)))) else: tmp = -math.pow((h * l), -0.5) * d return tmp
function code(d, h, l, M, D) tmp = 0.0 if (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)))) <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(D / d)) * Float64(M / 2.0)) * Float64(Float64(Float64(D / d) * Float64(M / 2.0)) * Float64(h / l))))); else tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((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)))) <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l)))); else tmp = -((h * l) ^ -0.5) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[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], 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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) \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \frac{D}{d}\right) \cdot \frac{M}{2}\right) \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 85.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
metadata-eval85.9
Applied rewrites85.9%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites84.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f6486.3
Applied rewrites86.3%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 19.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
inv-powN/A
*-commutativeN/A
sqrt-pow1N/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval32.5
Applied rewrites32.5%
Final simplification68.9%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (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))))
4e+264)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(-
1.0
(* (* (* 0.5 (* (/ D d) (/ M 2.0))) (* (/ D d) (* M 0.5))) (/ h l))))
(* (- (pow (* h l) -0.5)) d)))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((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)))) <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l)));
} else {
tmp = -pow((h * l), -0.5) * d;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: tmp
if (((((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)))) <= 4d+264) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((0.5d0 * ((d_1 / d) * (m / 2.0d0))) * ((d_1 / d) * (m * 0.5d0))) * (h / l)))
else
tmp = -((h * l) ** (-0.5d0)) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((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)))) <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l)));
} else {
tmp = -Math.pow((h * l), -0.5) * d;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((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)))) <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l))) else: tmp = -math.pow((h * l), -0.5) * d return tmp
function code(d, h, l, M, D) tmp = 0.0 if (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)))) <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(Float64(D / d) * Float64(M / 2.0))) * Float64(Float64(D / d) * Float64(M * 0.5))) * Float64(h / l)))); else tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((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)))) <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l))); else tmp = -((h * l) ^ -0.5) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[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], 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(0.5 * N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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) \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right) \cdot \left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 85.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
metadata-eval85.9
Applied rewrites85.9%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites84.2%
Taylor expanded in M around 0
*-commutativeN/A
lower-*.f6484.2
Applied rewrites84.2%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 19.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
inv-powN/A
*-commutativeN/A
sqrt-pow1N/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval32.5
Applied rewrites32.5%
Final simplification67.4%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (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))))
4e+264)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (* (* (/ (* M D) d) 0.25) (* (/ D d) (/ M 2.0))) (/ h l))))
(* (- (pow (* h l) -0.5)) d)))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((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)))) <= 4e+264) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l)));
} else {
tmp = -pow((h * l), -0.5) * d;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: tmp
if (((((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)))) <= 4d+264) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((((m * d_1) / d) * 0.25d0) * ((d_1 / d) * (m / 2.0d0))) * (h / l)))
else
tmp = -((h * l) ** (-0.5d0)) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((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)))) <= 4e+264) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l)));
} else {
tmp = -Math.pow((h * l), -0.5) * d;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((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)))) <= 4e+264: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l))) else: tmp = -math.pow((h * l), -0.5) * d return tmp
function code(d, h, l, M, D) tmp = 0.0 if (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)))) <= 4e+264) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(Float64(D / d) * Float64(M / 2.0))) * Float64(h / l)))); else tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((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)))) <= 4e+264) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l))); else tmp = -((h * l) ^ -0.5) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[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], 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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) \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264Initial program 85.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f6485.9
Applied rewrites85.9%
lift-/.f64N/A
metadata-eval85.9
Applied rewrites85.9%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6484.2
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites84.2%
Taylor expanded in d around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6484.2
Applied rewrites84.2%
if 4.00000000000000018e264 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 19.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6418.5
Applied rewrites18.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
inv-powN/A
*-commutativeN/A
sqrt-pow1N/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval32.5
Applied rewrites32.5%
Final simplification67.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* h l)))))
(if (<= h -5e-311)
(* (- t_0) d)
(if (<= h 1.8e-141) (* t_0 d) (/ (* (sqrt (/ h l)) d) h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double tmp;
if (h <= -5e-311) {
tmp = -t_0 * d;
} else if (h <= 1.8e-141) {
tmp = t_0 * d;
} else {
tmp = (sqrt((h / l)) * d) / h;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 / (h * l)))
if (h <= (-5d-311)) then
tmp = -t_0 * d
else if (h <= 1.8d-141) then
tmp = t_0 * d
else
tmp = (sqrt((h / l)) * d) / h
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (h * l)));
double tmp;
if (h <= -5e-311) {
tmp = -t_0 * d;
} else if (h <= 1.8e-141) {
tmp = t_0 * d;
} else {
tmp = (Math.sqrt((h / l)) * d) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (h * l))) tmp = 0 if h <= -5e-311: tmp = -t_0 * d elif h <= 1.8e-141: tmp = t_0 * d else: tmp = (math.sqrt((h / l)) * d) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) tmp = 0.0 if (h <= -5e-311) tmp = Float64(Float64(-t_0) * d); elseif (h <= 1.8e-141) tmp = Float64(t_0 * d); else tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (h * l))); tmp = 0.0; if (h <= -5e-311) tmp = -t_0 * d; elseif (h <= 1.8e-141) tmp = t_0 * d; else tmp = (sqrt((h / l)) * d) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -5e-311], N[((-t$95$0) * d), $MachinePrecision], If[LessEqual[h, 1.8e-141], N[(t$95$0 * d), $MachinePrecision], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(-t\_0\right) \cdot d\\
\mathbf{elif}\;h \leq 1.8 \cdot 10^{-141}:\\
\;\;\;\;t\_0 \cdot d\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
\end{array}
\end{array}
if h < -5.00000000000023e-311Initial program 65.2%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6410.5
Applied rewrites10.5%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6410.5
Applied rewrites10.5%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-*.f6447.8
Applied rewrites47.8%
lift-*.f64N/A
lift-pow.f64N/A
inv-powN/A
lower-/.f64N/A
lift-*.f6447.8
Applied rewrites47.8%
if -5.00000000000023e-311 < h < 1.80000000000000007e-141Initial program 65.7%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6461.2
Applied rewrites61.2%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6461.2
Applied rewrites61.2%
if 1.80000000000000007e-141 < h Initial program 63.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites49.1%
Taylor expanded in d around inf
*-commutativeN/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f6441.8
Applied rewrites41.8%
(FPCore (d h l M D) :precision binary64 (if (<= l 7.6e-296) (* (- (sqrt (/ 1.0 (* h l)))) d) (* (/ 1.0 (* (sqrt h) (sqrt l))) d)))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 7.6e-296) {
tmp = -sqrt((1.0 / (h * l))) * d;
} else {
tmp = (1.0 / (sqrt(h) * sqrt(l))) * d;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: tmp
if (l <= 7.6d-296) then
tmp = -sqrt((1.0d0 / (h * l))) * d
else
tmp = (1.0d0 / (sqrt(h) * sqrt(l))) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 7.6e-296) {
tmp = -Math.sqrt((1.0 / (h * l))) * d;
} else {
tmp = (1.0 / (Math.sqrt(h) * Math.sqrt(l))) * d;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 7.6e-296: tmp = -math.sqrt((1.0 / (h * l))) * d else: tmp = (1.0 / (math.sqrt(h) * math.sqrt(l))) * d return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 7.6e-296) tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d); else tmp = Float64(Float64(1.0 / Float64(sqrt(h) * sqrt(l))) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 7.6e-296) tmp = -sqrt((1.0 / (h * l))) * d; else tmp = (1.0 / (sqrt(h) * sqrt(l))) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 7.6e-296], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7.6 \cdot 10^{-296}:\\
\;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d\\
\end{array}
\end{array}
if l < 7.6000000000000004e-296Initial program 65.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6410.2
Applied rewrites10.2%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6410.2
Applied rewrites10.2%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-*.f6447.3
Applied rewrites47.3%
lift-*.f64N/A
lift-pow.f64N/A
inv-powN/A
lower-/.f64N/A
lift-*.f6447.3
Applied rewrites47.3%
if 7.6000000000000004e-296 < l Initial program 63.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
lift-pow.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6453.7
Applied rewrites53.7%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.2e-212) (* (- (sqrt (/ 1.0 (* h l)))) d) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.2e-212) {
tmp = -sqrt((1.0 / (h * l))) * d;
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: tmp
if (l <= 3.2d-212) then
tmp = -sqrt((1.0d0 / (h * l))) * d
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.2e-212) {
tmp = -Math.sqrt((1.0 / (h * l))) * d;
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.2e-212: tmp = -math.sqrt((1.0 / (h * l))) * d else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.2e-212) tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.2e-212) tmp = -sqrt((1.0 / (h * l))) * d; else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.2e-212], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.2 \cdot 10^{-212}:\\
\;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if l < 3.1999999999999999e-212Initial program 67.9%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6411.3
Applied rewrites11.3%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in h around -inf
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-*.f6445.0
Applied rewrites45.0%
lift-*.f64N/A
lift-pow.f64N/A
inv-powN/A
lower-/.f64N/A
lift-*.f6445.0
Applied rewrites45.0%
if 3.1999999999999999e-212 < l Initial program 59.8%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
lift-pow.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f6439.9
Applied rewrites39.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-*.f6440.1
Applied rewrites40.1%
Final simplification42.9%
(FPCore (d h l M D) :precision binary64 (* (sqrt (/ 1.0 (* h l))) d))
double code(double d, double h, double l, double M, double D) {
return sqrt((1.0 / (h * l))) * d;
}
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 = sqrt((1.0d0 / (h * l))) * d
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt((1.0 / (h * l))) * d;
}
def code(d, h, l, M, D): return math.sqrt((1.0 / (h * l))) * d
function code(d, h, l, M, D) return Float64(sqrt(Float64(1.0 / Float64(h * l))) * d) end
function tmp = code(d, h, l, M, D) tmp = sqrt((1.0 / (h * l))) * d; end
code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{h \cdot \ell}} \cdot d
\end{array}
Initial program 64.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-pow.f64N/A
unpow-1N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((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 / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 64.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-pow.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f6423.7
Applied rewrites23.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
Final simplification23.8%
herbie shell --seed 2025054
(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)))))