
(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)));
}
real(8) function code(d, h, l, m, d_1)
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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
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 (* 0.5 (* M D))) (t_1 (/ (* M D) (* d 2.0))))
(if (<= l -2e-310)
(*
(* (sqrt (/ d h)) (* (sqrt (- d)) (pow (/ -1.0 l) 0.5)))
(+ 1.0 (* (/ t_1 l) (/ (/ t_0 (* d 2.0)) (/ -1.0 h)))))
(if (<= l 9.2e+187)
(*
(* (* (/ 1.0 (sqrt h)) (sqrt d)) (pow (/ d l) (/ 1.0 2.0)))
(+ 1.0 (* (/ h l) (* (pow t_1 2.0) (/ -1.0 2.0)))))
(/
(*
(- 1.0 (/ (* t_0 (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (M * D) / (d * 2.0);
double tmp;
if (l <= -2e-310) {
tmp = (sqrt((d / h)) * (sqrt(-d) * pow((-1.0 / l), 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))));
} else if (l <= 9.2e+187) {
tmp = (((1.0 / sqrt(h)) * sqrt(d)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(t_1, 2.0) * (-1.0 / 2.0))));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * (m * d_1)
t_1 = (m * d_1) / (d * 2.0d0)
if (l <= (-2d-310)) then
tmp = (sqrt((d / h)) * (sqrt(-d) * (((-1.0d0) / l) ** 0.5d0))) * (1.0d0 + ((t_1 / l) * ((t_0 / (d * 2.0d0)) / ((-1.0d0) / h))))
else if (l <= 9.2d+187) then
tmp = (((1.0d0 / sqrt(h)) * sqrt(d)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 + ((h / l) * ((t_1 ** 2.0d0) * ((-1.0d0) / 2.0d0))))
else
tmp = ((1.0d0 - ((t_0 * (h * (m * d_1))) / (d * (l * (d * 4.0d0))))) * (d / sqrt(h))) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (M * D) / (d * 2.0);
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt((d / h)) * (Math.sqrt(-d) * Math.pow((-1.0 / l), 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))));
} else if (l <= 9.2e+187) {
tmp = (((1.0 / Math.sqrt(h)) * Math.sqrt(d)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(t_1, 2.0) * (-1.0 / 2.0))));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (M * D) t_1 = (M * D) / (d * 2.0) tmp = 0 if l <= -2e-310: tmp = (math.sqrt((d / h)) * (math.sqrt(-d) * math.pow((-1.0 / l), 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)))) elif l <= 9.2e+187: tmp = (((1.0 / math.sqrt(h)) * math.sqrt(d)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(t_1, 2.0) * (-1.0 / 2.0)))) else: tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(M * D)) t_1 = Float64(Float64(M * D) / Float64(d * 2.0)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) * (Float64(-1.0 / l) ^ 0.5))) * Float64(1.0 + Float64(Float64(t_1 / l) * Float64(Float64(t_0 / Float64(d * 2.0)) / Float64(-1.0 / h))))); elseif (l <= 9.2e+187) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(h)) * sqrt(d)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((t_1 ^ 2.0) * Float64(-1.0 / 2.0))))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(t_0 * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (M * D); t_1 = (M * D) / (d * 2.0); tmp = 0.0; if (l <= -2e-310) tmp = (sqrt((d / h)) * (sqrt(-d) * ((-1.0 / l) ^ 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)))); elseif (l <= 9.2e+187) tmp = (((1.0 / sqrt(h)) * sqrt(d)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((t_1 ^ 2.0) * (-1.0 / 2.0)))); else tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] * N[Power[N[(-1.0 / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(t$95$1 / l), $MachinePrecision] * N[(N[(t$95$0 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.2e+187], N[(N[(N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(t$95$0 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(M \cdot D\right)\\
t_1 := \frac{M \cdot D}{d \cdot 2}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{-d} \cdot {\left(\frac{-1}{\ell}\right)}^{0.5}\right)\right) \cdot \left(1 + \frac{t\_1}{\ell} \cdot \frac{\frac{t\_0}{d \cdot 2}}{\frac{-1}{h}}\right)\\
\mathbf{elif}\;\ell \leq 9.2 \cdot 10^{+187}:\\
\;\;\;\;\left(\left(\frac{1}{\sqrt{h}} \cdot \sqrt{d}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({t\_1}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{t\_0 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.5
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6475.5
Applied rewrites75.5%
lift-sqrt.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-pow.f64N/A
lower-/.f6484.5
Applied rewrites84.5%
if -1.999999999999994e-310 < l < 9.20000000000000015e187Initial program 71.8%
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6482.6
Applied rewrites82.6%
if 9.20000000000000015e187 < l Initial program 24.0%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f640.0
Applied rewrites0.0%
Applied rewrites24.0%
Applied rewrites69.3%
Final simplification82.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* M D)))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_1 (- INFINITY))
(*
h
(/
(* (sqrt (/ 1.0 (* h (* l (* l l))))) (* (* -0.125 (* D D)) (* M M)))
d))
(if (<= t_1 -5e-179)
(*
(- 1.0 (/ (* (* M D) (* h t_0)) (* l (* d (* d 4.0)))))
(sqrt (/ (* d d) (* l h))))
(if (<= t_1 INFINITY)
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(/
(*
(- 1.0 (/ (* t_0 (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
} else if (t_1 <= -5e-179) {
tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * sqrt(((d * d) / (l * h)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = h * ((Math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
} else if (t_1 <= -5e-179) {
tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * Math.sqrt(((d * d) / (l * h)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (M * D) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) tmp = 0 if t_1 <= -math.inf: tmp = h * ((math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d) elif t_1 <= -5e-179: tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * math.sqrt(((d * d) / (l * h))) elif t_1 <= math.inf: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) else: tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(M * D)) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(h * Float64(Float64(sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(l * l))))) * Float64(Float64(-0.125 * Float64(D * D)) * Float64(M * M))) / d)); elseif (t_1 <= -5e-179) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(M * D) * Float64(h * t_0)) / Float64(l * Float64(d * Float64(d * 4.0))))) * sqrt(Float64(Float64(d * d) / Float64(l * h)))); elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(t_0 * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (M * D); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))); tmp = 0.0; if (t_1 <= -Inf) tmp = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d); elseif (t_1 <= -5e-179) tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * sqrt(((d * d) / (l * h))); elseif (t_1 <= Inf) tmp = sqrt((d / l)) / sqrt((h / d)); else tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(h * N[(N[(N[Sqrt[N[(1.0 / N[(h * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-179], N[(N[(1.0 - N[(N[(N[(M * D), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(t$95$0 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(M \cdot D\right)\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;h \cdot \frac{\sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}} \cdot \left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)\right)}{d}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-179}:\\
\;\;\;\;\left(1 - \frac{\left(M \cdot D\right) \cdot \left(h \cdot t\_0\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right) \cdot \sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{t\_0 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\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)))) < -inf.0Initial program 74.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in h around inf
Applied rewrites49.0%
Taylor expanded in d around 0
Applied rewrites71.7%
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)))) < -4.9999999999999998e-179Initial program 98.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6452.0
Applied rewrites52.0%
Applied rewrites36.3%
if -4.9999999999999998e-179 < (*.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 83.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
Applied rewrites84.1%
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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites36.5%
Final simplification68.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* M D)))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_1 (- INFINITY))
(*
h
(/
(* (sqrt (/ 1.0 (* h (* l (* l l))))) (* (* -0.125 (* D D)) (* M M)))
d))
(if (<= t_1 -5e-179)
(*
(- 1.0 (/ (* (* M D) (* h t_0)) (* l (* d (* d 4.0)))))
(sqrt (/ (* d d) (* l h))))
(if (<= t_1 INFINITY)
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(*
(- 1.0 (/ (* t_0 (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt (* l h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
} else if (t_1 <= -5e-179) {
tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * sqrt(((d * d) / (l * h)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else {
tmp = (1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt((l * h)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = h * ((Math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
} else if (t_1 <= -5e-179) {
tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * Math.sqrt(((d * d) / (l * h)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else {
tmp = (1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt((l * h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (M * D) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) tmp = 0 if t_1 <= -math.inf: tmp = h * ((math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d) elif t_1 <= -5e-179: tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * math.sqrt(((d * d) / (l * h))) elif t_1 <= math.inf: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) else: tmp = (1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt((l * h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(M * D)) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(h * Float64(Float64(sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(l * l))))) * Float64(Float64(-0.125 * Float64(D * D)) * Float64(M * M))) / d)); elseif (t_1 <= -5e-179) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(M * D) * Float64(h * t_0)) / Float64(l * Float64(d * Float64(d * 4.0))))) * sqrt(Float64(Float64(d * d) / Float64(l * h)))); elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); else tmp = Float64(Float64(1.0 - Float64(Float64(t_0 * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (M * D); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))); tmp = 0.0; if (t_1 <= -Inf) tmp = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d); elseif (t_1 <= -5e-179) tmp = (1.0 - (((M * D) * (h * t_0)) / (l * (d * (d * 4.0))))) * sqrt(((d * d) / (l * h))); elseif (t_1 <= Inf) tmp = sqrt((d / l)) / sqrt((h / d)); else tmp = (1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt((l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(h * N[(N[(N[Sqrt[N[(1.0 / N[(h * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-179], N[(N[(1.0 - N[(N[(N[(M * D), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(t$95$0 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(M \cdot D\right)\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;h \cdot \frac{\sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}} \cdot \left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)\right)}{d}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-179}:\\
\;\;\;\;\left(1 - \frac{\left(M \cdot D\right) \cdot \left(h \cdot t\_0\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right) \cdot \sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{t\_0 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -inf.0Initial program 74.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in h around inf
Applied rewrites49.0%
Taylor expanded in d around 0
Applied rewrites71.7%
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)))) < -4.9999999999999998e-179Initial program 98.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6452.0
Applied rewrites52.0%
Applied rewrites36.3%
if -4.9999999999999998e-179 < (*.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 83.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
Applied rewrites84.1%
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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites28.3%
Final simplification67.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_1 -5e-179)
(*
(* (sqrt (/ d h)) t_0)
(fma (/ (* M D) (* l (* d 2.0))) (* (* 0.25 (/ (* M D) d)) (- h)) 1.0))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(*
(- 1.0 (/ (* (* 0.5 (* M D)) (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -5e-179) {
tmp = (sqrt((d / h)) * t_0) * fma(((M * D) / (l * (d * 2.0))), ((0.25 * ((M * D) / d)) * -h), 1.0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= -5e-179) tmp = Float64(Float64(sqrt(Float64(d / h)) * t_0) * fma(Float64(Float64(M * D) / Float64(l * Float64(d * 2.0))), Float64(Float64(0.25 * Float64(Float64(M * D) / d)) * Float64(-h)), 1.0)); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(M * D)) * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-179], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * (-h)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-179}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t\_0\right) \cdot \mathsf{fma}\left(\frac{M \cdot D}{\ell \cdot \left(d \cdot 2\right)}, \left(0.25 \cdot \frac{M \cdot D}{d}\right) \cdot \left(-h\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.5 \cdot \left(M \cdot D\right)\right) \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\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.9999999999999998e-179Initial program 78.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites86.5%
lift-/.f64N/A
metadata-eval86.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6486.5
Applied rewrites86.5%
lift-/.f64N/A
metadata-eval86.5
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6486.5
Applied rewrites86.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites82.9%
if -4.9999999999999998e-179 < (*.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 83.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
Applied rewrites84.1%
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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites36.5%
Final simplification75.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_1 -5e-179)
(*
(* (sqrt (/ d h)) t_0)
(fma (* (* 0.25 (/ (* M D) d)) (/ (* M D) (* l (* (- d) 2.0)))) h 1.0))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(*
(- 1.0 (/ (* (* 0.5 (* M D)) (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -5e-179) {
tmp = (sqrt((d / h)) * t_0) * fma(((0.25 * ((M * D) / d)) * ((M * D) / (l * (-d * 2.0)))), h, 1.0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= -5e-179) tmp = Float64(Float64(sqrt(Float64(d / h)) * t_0) * fma(Float64(Float64(0.25 * Float64(Float64(M * D) / d)) * Float64(Float64(M * D) / Float64(l * Float64(Float64(-d) * 2.0)))), h, 1.0)); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(M * D)) * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-179], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(N[(N[(0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(l * N[((-d) * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-179}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t\_0\right) \cdot \mathsf{fma}\left(\left(0.25 \cdot \frac{M \cdot D}{d}\right) \cdot \frac{M \cdot D}{\ell \cdot \left(\left(-d\right) \cdot 2\right)}, h, 1\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.5 \cdot \left(M \cdot D\right)\right) \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\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.9999999999999998e-179Initial program 78.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites86.5%
lift-/.f64N/A
metadata-eval86.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6486.5
Applied rewrites86.5%
lift-/.f64N/A
metadata-eval86.5
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6486.5
Applied rewrites86.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
associate-*r*N/A
Applied rewrites79.8%
if -4.9999999999999998e-179 < (*.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 83.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
Applied rewrites84.1%
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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites36.5%
Final simplification73.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))))
(t_2 (* 0.5 (* M D)))
(t_3 (* d (* l (* d 4.0)))))
(if (<= t_1 -5e-179)
(* t_0 (* (sqrt (/ d h)) (- 1.0 (* (* M D) (/ (* h t_2) t_3)))))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(* (- 1.0 (/ (* t_2 (* h (* M D))) t_3)) (/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double t_2 = 0.5 * (M * D);
double t_3 = d * (l * (d * 4.0));
double tmp;
if (t_1 <= -5e-179) {
tmp = t_0 * (sqrt((d / h)) * (1.0 - ((M * D) * ((h * t_2) / t_3))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = ((1.0 - ((t_2 * (h * (M * D))) / t_3)) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
double t_2 = 0.5 * (M * D);
double t_3 = d * (l * (d * 4.0));
double tmp;
if (t_1 <= -5e-179) {
tmp = t_0 * (Math.sqrt((d / h)) * (1.0 - ((M * D) * ((h * t_2) / t_3))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_0 / Math.sqrt((h / d));
} else {
tmp = ((1.0 - ((t_2 * (h * (M * D))) / t_3)) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) t_2 = 0.5 * (M * D) t_3 = d * (l * (d * 4.0)) tmp = 0 if t_1 <= -5e-179: tmp = t_0 * (math.sqrt((d / h)) * (1.0 - ((M * D) * ((h * t_2) / t_3)))) elif t_1 <= math.inf: tmp = t_0 / math.sqrt((h / d)) else: tmp = ((1.0 - ((t_2 * (h * (M * D))) / t_3)) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) t_2 = Float64(0.5 * Float64(M * D)) t_3 = Float64(d * Float64(l * Float64(d * 4.0))) tmp = 0.0 if (t_1 <= -5e-179) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(1.0 - Float64(Float64(M * D) * Float64(Float64(h * t_2) / t_3))))); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(t_2 * Float64(h * Float64(M * D))) / t_3)) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))); t_2 = 0.5 * (M * D); t_3 = d * (l * (d * 4.0)); tmp = 0.0; if (t_1 <= -5e-179) tmp = t_0 * (sqrt((d / h)) * (1.0 - ((M * D) * ((h * t_2) / t_3)))); elseif (t_1 <= Inf) tmp = t_0 / sqrt((h / d)); else tmp = ((1.0 - ((t_2 * (h * (M * D))) / t_3)) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-179], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(M * D), $MachinePrecision] * N[(N[(h * t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(t$95$2 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
t_2 := 0.5 \cdot \left(M \cdot D\right)\\
t_3 := d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-179}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - \left(M \cdot D\right) \cdot \frac{h \cdot t\_2}{t\_3}\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{t\_2 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{t\_3}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\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.9999999999999998e-179Initial program 78.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6442.3
Applied rewrites42.3%
Applied rewrites60.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.1
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6466.9
Applied rewrites66.9%
if -4.9999999999999998e-179 < (*.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 83.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
Applied rewrites84.1%
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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites36.5%
Final simplification69.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (* 0.5 (* M D)))
(t_2
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))))
(t_3 (* d (* l (* d 4.0)))))
(if (<= t_2 -5e-179)
(* t_0 (* (sqrt (/ d h)) (- 1.0 (* t_1 (* h (/ (* M D) t_3))))))
(if (<= t_2 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(* (- 1.0 (/ (* t_1 (* h (* M D))) t_3)) (/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 0.5 * (M * D);
double t_2 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double t_3 = d * (l * (d * 4.0));
double tmp;
if (t_2 <= -5e-179) {
tmp = t_0 * (sqrt((d / h)) * (1.0 - (t_1 * (h * ((M * D) / t_3)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = ((1.0 - ((t_1 * (h * (M * D))) / t_3)) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = 0.5 * (M * D);
double t_2 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
double t_3 = d * (l * (d * 4.0));
double tmp;
if (t_2 <= -5e-179) {
tmp = t_0 * (Math.sqrt((d / h)) * (1.0 - (t_1 * (h * ((M * D) / t_3)))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_0 / Math.sqrt((h / d));
} else {
tmp = ((1.0 - ((t_1 * (h * (M * D))) / t_3)) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = 0.5 * (M * D) t_2 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) t_3 = d * (l * (d * 4.0)) tmp = 0 if t_2 <= -5e-179: tmp = t_0 * (math.sqrt((d / h)) * (1.0 - (t_1 * (h * ((M * D) / t_3))))) elif t_2 <= math.inf: tmp = t_0 / math.sqrt((h / d)) else: tmp = ((1.0 - ((t_1 * (h * (M * D))) / t_3)) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(0.5 * Float64(M * D)) t_2 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) t_3 = Float64(d * Float64(l * Float64(d * 4.0))) tmp = 0.0 if (t_2 <= -5e-179) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(1.0 - Float64(t_1 * Float64(h * Float64(Float64(M * D) / t_3)))))); elseif (t_2 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(t_1 * Float64(h * Float64(M * D))) / t_3)) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = 0.5 * (M * D); t_2 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))); t_3 = d * (l * (d * 4.0)); tmp = 0.0; if (t_2 <= -5e-179) tmp = t_0 * (sqrt((d / h)) * (1.0 - (t_1 * (h * ((M * D) / t_3))))); elseif (t_2 <= Inf) tmp = t_0 / sqrt((h / d)); else tmp = ((1.0 - ((t_1 * (h * (M * D))) / t_3)) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-179], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(t$95$1 * N[(h * N[(N[(M * D), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(t$95$1 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 0.5 \cdot \left(M \cdot D\right)\\
t_2 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
t_3 := d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-179}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - t\_1 \cdot \left(h \cdot \frac{M \cdot D}{t\_3}\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{t\_1 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{t\_3}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\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.9999999999999998e-179Initial program 78.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6442.3
Applied rewrites42.3%
Applied rewrites60.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*l*N/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lower-/.f6459.5
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
Applied rewrites66.3%
if -4.9999999999999998e-179 < (*.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 83.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
Applied rewrites84.1%
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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites36.5%
Final simplification69.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_0 -5e+75)
(*
h
(/
(* (sqrt (/ 1.0 (* h (* l (* l l))))) (* (* -0.125 (* D D)) (* M M)))
d))
(if (<= t_0 INFINITY)
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(*
(- 1.0 (/ (* (* 0.5 (* M D)) (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_0 <= -5e+75) {
tmp = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
} else if (t_0 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else {
tmp = (1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt((l * h)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_0 <= -5e+75) {
tmp = h * ((Math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else {
tmp = (1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt((l * h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) tmp = 0 if t_0 <= -5e+75: tmp = h * ((math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d) elif t_0 <= math.inf: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) else: tmp = (1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt((l * h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_0 <= -5e+75) tmp = Float64(h * Float64(Float64(sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(l * l))))) * Float64(Float64(-0.125 * Float64(D * D)) * Float64(M * M))) / d)); elseif (t_0 <= Inf) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(M * D)) * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))); tmp = 0.0; if (t_0 <= -5e+75) tmp = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d); elseif (t_0 <= Inf) tmp = sqrt((d / l)) / sqrt((h / d)); else tmp = (1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt((l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+75], N[(h * N[(N[(N[Sqrt[N[(1.0 / N[(h * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+75}:\\
\;\;\;\;h \cdot \frac{\sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}} \cdot \left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)\right)}{d}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(0.5 \cdot \left(M \cdot D\right)\right) \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.0000000000000002e75Initial program 77.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6457.0
Applied rewrites57.0%
Taylor expanded in h around inf
Applied rewrites44.5%
Taylor expanded in d around 0
Applied rewrites64.4%
if -5.0000000000000002e75 < (*.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 84.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6458.6
Applied rewrites58.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.1
Applied rewrites43.1%
Applied rewrites79.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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites28.3%
Final simplification65.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
h
(/
(*
(sqrt (/ 1.0 (* h (* l (* l l)))))
(* (* -0.125 (* D D)) (* M M)))
d)))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_1 -5e+75)
t_0
(if (<= t_1 INFINITY) (/ (sqrt (/ d l)) (sqrt (/ h d))) t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -5e+75) {
tmp = t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = h * ((Math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d);
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -5e+75) {
tmp = t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else {
tmp = t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = h * ((math.sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) tmp = 0 if t_1 <= -5e+75: tmp = t_0 elif t_1 <= math.inf: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) else: tmp = t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(h * Float64(Float64(sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(l * l))))) * Float64(Float64(-0.125 * Float64(D * D)) * Float64(M * M))) / d)) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= -5e+75) tmp = t_0; elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); else tmp = t_0; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = h * ((sqrt((1.0 / (h * (l * (l * l))))) * ((-0.125 * (D * D)) * (M * M))) / d); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))); tmp = 0.0; if (t_1 <= -5e+75) tmp = t_0; elseif (t_1 <= Inf) tmp = sqrt((d / l)) / sqrt((h / d)); else tmp = t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(h * N[(N[(N[Sqrt[N[(1.0 / N[(h * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+75], t$95$0, If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := h \cdot \frac{\sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}} \cdot \left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)\right)}{d}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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)))) < -5.0000000000000002e75 or +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 48.9%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in h around inf
Applied rewrites35.4%
Taylor expanded in d around 0
Applied rewrites49.8%
if -5.0000000000000002e75 < (*.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 84.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6458.6
Applied rewrites58.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.1
Applied rewrites43.1%
Applied rewrites79.6%
Final simplification64.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l)))))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_1 -5e-179)
(* t_0 (* (* D (/ (* D (* M M)) d)) 0.125))
(if (<= t_1 INFINITY)
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(* (* D D) (* t_0 (/ (* -0.125 (* M M)) d)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -5e-179) {
tmp = t_0 * ((D * ((D * (M * M)) / d)) * 0.125);
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else {
tmp = (D * D) * (t_0 * ((-0.125 * (M * M)) / d));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_1 <= -5e-179) {
tmp = t_0 * ((D * ((D * (M * M)) / d)) * 0.125);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else {
tmp = (D * D) * (t_0 * ((-0.125 * (M * M)) / d));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) tmp = 0 if t_1 <= -5e-179: tmp = t_0 * ((D * ((D * (M * M)) / d)) * 0.125) elif t_1 <= math.inf: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) else: tmp = (D * D) * (t_0 * ((-0.125 * (M * M)) / d)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= -5e-179) tmp = Float64(t_0 * Float64(Float64(D * Float64(Float64(D * Float64(M * M)) / d)) * 0.125)); elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); else tmp = Float64(Float64(D * D) * Float64(t_0 * Float64(Float64(-0.125 * Float64(M * M)) / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / (l * (l * l)))); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))); tmp = 0.0; if (t_1 <= -5e-179) tmp = t_0 * ((D * ((D * (M * M)) / d)) * 0.125); elseif (t_1 <= Inf) tmp = sqrt((d / l)) / sqrt((h / d)); else tmp = (D * D) * (t_0 * ((-0.125 * (M * M)) / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-179], N[(t$95$0 * N[(N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(D * D), $MachinePrecision] * N[(t$95$0 * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-179}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot 0.125\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\left(D \cdot D\right) \cdot \left(t\_0 \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\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.9999999999999998e-179Initial program 78.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f648.3
Applied rewrites8.3%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
distribute-frac-negN/A
Applied rewrites33.6%
if -4.9999999999999998e-179 < (*.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 83.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
Applied rewrites84.1%
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 M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f649.2
Applied rewrites9.2%
Taylor expanded in d around 0
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites19.8%
Final simplification54.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* M D) (* d 2.0))))
(if (<=
(*
(+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
INFINITY)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* (/ t_0 l) (* h (* 0.25 (/ (* M D) d))))))
(/
(*
(- 1.0 (/ (* (* 0.5 (* M D)) (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / (d * 2.0);
double tmp;
if (((1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= ((double) INFINITY)) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((t_0 / l) * (h * (0.25 * ((M * D) / d)))));
} else {
tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / (d * 2.0);
double tmp;
if (((1.0 + ((h / l) * (Math.pow(t_0, 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= Double.POSITIVE_INFINITY) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - ((t_0 / l) * (h * (0.25 * ((M * D) / d)))));
} else {
tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M * D) / (d * 2.0) tmp = 0 if ((1.0 + ((h / l) * (math.pow(t_0, 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= math.inf: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - ((t_0 / l) * (h * (0.25 * ((M * D) / d))))) else: tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / Float64(d * 2.0)) tmp = 0.0 if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= Inf) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(t_0 / l) * Float64(h * Float64(0.25 * Float64(Float64(M * D) / d)))))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(M * D)) * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * D) / (d * 2.0); tmp = 0.0; if (((1.0 + ((h / l) * ((t_0 ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= Inf) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((t_0 / l) * (h * (0.25 * ((M * D) / d))))); else tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(t$95$0 / l), $MachinePrecision] * N[(h * N[(0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d \cdot 2}\\
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq \infty:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{t\_0}{\ell} \cdot \left(h \cdot \left(0.25 \cdot \frac{M \cdot D}{d}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.5 \cdot \left(M \cdot D\right)\right) \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\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)))) < +inf.0Initial program 81.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites85.0%
lift-/.f64N/A
metadata-eval85.0
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6485.0
Applied rewrites85.0%
lift-/.f64N/A
metadata-eval85.0
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6485.0
Applied rewrites85.0%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
lower-*.f6485.0
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6485.0
Applied rewrites85.0%
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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites36.5%
Final simplification76.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* M D) (* d 2.0))))
(if (<=
(*
(+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
INFINITY)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* (/ t_0 l) (* 0.25 (* D (* M (/ h d)))))))
(/
(*
(- 1.0 (/ (* (* 0.5 (* M D)) (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / (d * 2.0);
double tmp;
if (((1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= ((double) INFINITY)) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((t_0 / l) * (0.25 * (D * (M * (h / d))))));
} else {
tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / (d * 2.0);
double tmp;
if (((1.0 + ((h / l) * (Math.pow(t_0, 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= Double.POSITIVE_INFINITY) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - ((t_0 / l) * (0.25 * (D * (M * (h / d))))));
} else {
tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M * D) / (d * 2.0) tmp = 0 if ((1.0 + ((h / l) * (math.pow(t_0, 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= math.inf: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - ((t_0 / l) * (0.25 * (D * (M * (h / d)))))) else: tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / Float64(d * 2.0)) tmp = 0.0 if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= Inf) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(t_0 / l) * Float64(0.25 * Float64(D * Float64(M * Float64(h / d))))))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(M * D)) * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * D) / (d * 2.0); tmp = 0.0; if (((1.0 + ((h / l) * ((t_0 ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= Inf) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((t_0 / l) * (0.25 * (D * (M * (h / d)))))); else tmp = ((1.0 - (((0.5 * (M * D)) * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(t$95$0 / l), $MachinePrecision] * N[(0.25 * N[(D * N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d \cdot 2}\\
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq \infty:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{t\_0}{\ell} \cdot \left(0.25 \cdot \left(D \cdot \left(M \cdot \frac{h}{d}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.5 \cdot \left(M \cdot D\right)\right) \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\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)))) < +inf.0Initial program 81.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites85.0%
lift-/.f64N/A
metadata-eval85.0
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6485.0
Applied rewrites85.0%
lift-/.f64N/A
metadata-eval85.0
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6485.0
Applied rewrites85.0%
Taylor expanded in M around 0
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6483.9
Applied rewrites83.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%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f644.3
Applied rewrites4.3%
Applied rewrites7.0%
Applied rewrites36.5%
Final simplification75.2%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
-5e-179)
(* (sqrt (/ h (* l (* l l)))) (* (* D (/ (* D (* M M)) d)) 0.125))
(/ (sqrt (/ d l)) (sqrt (/ h d)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= -5e-179) {
tmp = sqrt((h / (l * (l * l)))) * ((D * ((D * (M * M)) / d)) * 0.125);
} else {
tmp = sqrt((d / l)) / sqrt((h / d));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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 (((1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))) <= (-5d-179)) then
tmp = sqrt((h / (l * (l * l)))) * ((d_1 * ((d_1 * (m * m)) / d)) * 0.125d0)
else
tmp = sqrt((d / l)) / sqrt((h / d))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= -5e-179) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((D * ((D * (M * M)) / d)) * 0.125);
} else {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= -5e-179: tmp = math.sqrt((h / (l * (l * l)))) * ((D * ((D * (M * M)) / d)) * 0.125) else: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= -5e-179) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(Float64(D * Float64(M * M)) / d)) * 0.125)); else tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= -5e-179) tmp = sqrt((h / (l * (l * l)))) * ((D * ((D * (M * M)) / d)) * 0.125); else tmp = sqrt((d / l)) / sqrt((h / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-179], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -5 \cdot 10^{-179}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot 0.125\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{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.9999999999999998e-179Initial program 78.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f648.3
Applied rewrites8.3%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
distribute-frac-negN/A
Applied rewrites33.6%
if -4.9999999999999998e-179 < (*.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 60.2%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6446.0
Applied rewrites46.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6436.3
Applied rewrites36.3%
Applied rewrites63.0%
Final simplification52.8%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
-5e-179)
(* h (* (- d) (sqrt (/ 1.0 (* h (* l (* h h)))))))
(/ (sqrt (/ d l)) (sqrt (/ h d)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= -5e-179) {
tmp = h * (-d * sqrt((1.0 / (h * (l * (h * h))))));
} else {
tmp = sqrt((d / l)) / sqrt((h / d));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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 (((1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))) <= (-5d-179)) then
tmp = h * (-d * sqrt((1.0d0 / (h * (l * (h * h))))))
else
tmp = sqrt((d / l)) / sqrt((h / d))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= -5e-179) {
tmp = h * (-d * Math.sqrt((1.0 / (h * (l * (h * h))))));
} else {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= -5e-179: tmp = h * (-d * math.sqrt((1.0 / (h * (l * (h * h)))))) else: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= -5e-179) tmp = Float64(h * Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(h * h))))))); else tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= -5e-179) tmp = h * (-d * sqrt((1.0 / (h * (l * (h * h)))))); else tmp = sqrt((d / l)) / sqrt((h / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-179], N[(h * N[((-d) * N[Sqrt[N[(1.0 / N[(h * N[(l * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -5 \cdot 10^{-179}:\\
\;\;\;\;h \cdot \left(\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{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.9999999999999998e-179Initial program 78.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
Taylor expanded in h around inf
Applied rewrites41.1%
Taylor expanded in l around -inf
Applied rewrites22.1%
if -4.9999999999999998e-179 < (*.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 60.2%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6446.0
Applied rewrites46.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6436.3
Applied rewrites36.3%
Applied rewrites63.0%
Final simplification48.8%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
-5e-179)
(* h (* (- d) (sqrt (/ 1.0 (* h (* l (* h h)))))))
(* (sqrt (/ d l)) (sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= -5e-179) {
tmp = h * (-d * sqrt((1.0 / (h * (l * (h * h))))));
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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 (((1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))) <= (-5d-179)) then
tmp = h * (-d * sqrt((1.0d0 / (h * (l * (h * h))))))
else
tmp = sqrt((d / l)) * sqrt((d / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= -5e-179) {
tmp = h * (-d * Math.sqrt((1.0 / (h * (l * (h * h))))));
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= -5e-179: tmp = h * (-d * math.sqrt((1.0 / (h * (l * (h * h)))))) else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= -5e-179) tmp = Float64(h * Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(h * h))))))); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= -5e-179) tmp = h * (-d * sqrt((1.0 / (h * (l * (h * h)))))); else tmp = sqrt((d / l)) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-179], N[(h * N[((-d) * N[Sqrt[N[(1.0 / N[(h * N[(l * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -5 \cdot 10^{-179}:\\
\;\;\;\;h \cdot \left(\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{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.9999999999999998e-179Initial program 78.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
Taylor expanded in h around inf
Applied rewrites41.1%
Taylor expanded in l around -inf
Applied rewrites22.1%
if -4.9999999999999998e-179 < (*.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 60.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6432.8
Applied rewrites32.8%
Applied rewrites50.2%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6462.4
Applied rewrites62.4%
Final simplification48.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* M D))) (t_1 (/ (* M D) (* d 2.0))))
(if (<= l -2e-310)
(*
(* (sqrt (/ d h)) (* (sqrt (- d)) (pow (/ -1.0 l) 0.5)))
(+ 1.0 (* (/ t_1 l) (/ (/ t_0 (* d 2.0)) (/ -1.0 h)))))
(if (<= l 3.8e+190)
(*
(+ 1.0 (* (/ h l) (* (pow t_1 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (/ (sqrt d) (sqrt h))))
(/
(*
(- 1.0 (/ (* t_0 (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (M * D) / (d * 2.0);
double tmp;
if (l <= -2e-310) {
tmp = (sqrt((d / h)) * (sqrt(-d) * pow((-1.0 / l), 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))));
} else if (l <= 3.8e+190) {
tmp = (1.0 + ((h / l) * (pow(t_1, 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * (sqrt(d) / sqrt(h)));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * (m * d_1)
t_1 = (m * d_1) / (d * 2.0d0)
if (l <= (-2d-310)) then
tmp = (sqrt((d / h)) * (sqrt(-d) * (((-1.0d0) / l) ** 0.5d0))) * (1.0d0 + ((t_1 / l) * ((t_0 / (d * 2.0d0)) / ((-1.0d0) / h))))
else if (l <= 3.8d+190) then
tmp = (1.0d0 + ((h / l) * ((t_1 ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * (sqrt(d) / sqrt(h)))
else
tmp = ((1.0d0 - ((t_0 * (h * (m * d_1))) / (d * (l * (d * 4.0d0))))) * (d / sqrt(h))) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = (M * D) / (d * 2.0);
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt((d / h)) * (Math.sqrt(-d) * Math.pow((-1.0 / l), 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))));
} else if (l <= 3.8e+190) {
tmp = (1.0 + ((h / l) * (Math.pow(t_1, 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * (Math.sqrt(d) / Math.sqrt(h)));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (M * D) t_1 = (M * D) / (d * 2.0) tmp = 0 if l <= -2e-310: tmp = (math.sqrt((d / h)) * (math.sqrt(-d) * math.pow((-1.0 / l), 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)))) elif l <= 3.8e+190: tmp = (1.0 + ((h / l) * (math.pow(t_1, 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * (math.sqrt(d) / math.sqrt(h))) else: tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(M * D)) t_1 = Float64(Float64(M * D) / Float64(d * 2.0)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) * (Float64(-1.0 / l) ^ 0.5))) * Float64(1.0 + Float64(Float64(t_1 / l) * Float64(Float64(t_0 / Float64(d * 2.0)) / Float64(-1.0 / h))))); elseif (l <= 3.8e+190) tmp = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((t_1 ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * Float64(sqrt(d) / sqrt(h)))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(t_0 * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (M * D); t_1 = (M * D) / (d * 2.0); tmp = 0.0; if (l <= -2e-310) tmp = (sqrt((d / h)) * (sqrt(-d) * ((-1.0 / l) ^ 0.5))) * (1.0 + ((t_1 / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)))); elseif (l <= 3.8e+190) tmp = (1.0 + ((h / l) * ((t_1 ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * (sqrt(d) / sqrt(h))); else tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] * N[Power[N[(-1.0 / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(t$95$1 / l), $MachinePrecision] * N[(N[(t$95$0 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e+190], N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(t$95$0 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(M \cdot D\right)\\
t_1 := \frac{M \cdot D}{d \cdot 2}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{-d} \cdot {\left(\frac{-1}{\ell}\right)}^{0.5}\right)\right) \cdot \left(1 + \frac{t\_1}{\ell} \cdot \frac{\frac{t\_0}{d \cdot 2}}{\frac{-1}{h}}\right)\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{+190}:\\
\;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({t\_1}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{t\_0 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.5
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6475.5
Applied rewrites75.5%
lift-sqrt.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-pow.f64N/A
lower-/.f6484.5
Applied rewrites84.5%
if -1.999999999999994e-310 < l < 3.79999999999999964e190Initial program 71.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6481.8
Applied rewrites81.8%
if 3.79999999999999964e190 < l Initial program 25.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f640.0
Applied rewrites0.0%
Applied rewrites25.1%
Applied rewrites72.4%
Final simplification82.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* M D)))
(t_1
(+
1.0
(* (/ (/ (* M D) (* d 2.0)) l) (/ (/ t_0 (* d 2.0)) (/ -1.0 h)))))
(t_2 (sqrt (/ d h))))
(if (<= l -2e-310)
(* (* t_2 (* (sqrt (- d)) (pow (/ -1.0 l) 0.5))) t_1)
(if (<= l 4.1e+105)
(* t_1 (* t_2 (/ (sqrt d) (sqrt l))))
(/
(*
(- 1.0 (/ (* t_0 (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)));
double t_2 = sqrt((d / h));
double tmp;
if (l <= -2e-310) {
tmp = (t_2 * (sqrt(-d) * pow((-1.0 / l), 0.5))) * t_1;
} else if (l <= 4.1e+105) {
tmp = t_1 * (t_2 * (sqrt(d) / sqrt(l)));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.5d0 * (m * d_1)
t_1 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((t_0 / (d * 2.0d0)) / ((-1.0d0) / h)))
t_2 = sqrt((d / h))
if (l <= (-2d-310)) then
tmp = (t_2 * (sqrt(-d) * (((-1.0d0) / l) ** 0.5d0))) * t_1
else if (l <= 4.1d+105) then
tmp = t_1 * (t_2 * (sqrt(d) / sqrt(l)))
else
tmp = ((1.0d0 - ((t_0 * (h * (m * d_1))) / (d * (l * (d * 4.0d0))))) * (d / sqrt(h))) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)));
double t_2 = Math.sqrt((d / h));
double tmp;
if (l <= -2e-310) {
tmp = (t_2 * (Math.sqrt(-d) * Math.pow((-1.0 / l), 0.5))) * t_1;
} else if (l <= 4.1e+105) {
tmp = t_1 * (t_2 * (Math.sqrt(d) / Math.sqrt(l)));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (M * D) t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))) t_2 = math.sqrt((d / h)) tmp = 0 if l <= -2e-310: tmp = (t_2 * (math.sqrt(-d) * math.pow((-1.0 / l), 0.5))) * t_1 elif l <= 4.1e+105: tmp = t_1 * (t_2 * (math.sqrt(d) / math.sqrt(l))) else: tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(M * D)) t_1 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(t_0 / Float64(d * 2.0)) / Float64(-1.0 / h)))) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(t_2 * Float64(sqrt(Float64(-d)) * (Float64(-1.0 / l) ^ 0.5))) * t_1); elseif (l <= 4.1e+105) tmp = Float64(t_1 * Float64(t_2 * Float64(sqrt(d) / sqrt(l)))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(t_0 * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (M * D); t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))); t_2 = sqrt((d / h)); tmp = 0.0; if (l <= -2e-310) tmp = (t_2 * (sqrt(-d) * ((-1.0 / l) ^ 0.5))) * t_1; elseif (l <= 4.1e+105) tmp = t_1 * (t_2 * (sqrt(d) / sqrt(l))); else tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t$95$0 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(t$95$2 * N[(N[Sqrt[(-d)], $MachinePrecision] * N[Power[N[(-1.0 / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, 4.1e+105], N[(t$95$1 * N[(t$95$2 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(t$95$0 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(M \cdot D\right)\\
t_1 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{t\_0}{d \cdot 2}}{\frac{-1}{h}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(t\_2 \cdot \left(\sqrt{-d} \cdot {\left(\frac{-1}{\ell}\right)}^{0.5}\right)\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq 4.1 \cdot 10^{+105}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{t\_0 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.5
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6475.5
Applied rewrites75.5%
lift-sqrt.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
div-invN/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-pow.f64N/A
lower-/.f6484.5
Applied rewrites84.5%
if -1.999999999999994e-310 < l < 4.1000000000000002e105Initial program 74.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites78.9%
lift-/.f64N/A
metadata-eval78.9
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6478.9
Applied rewrites78.9%
lift-/.f64N/A
metadata-eval78.9
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6478.9
Applied rewrites78.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow1/2N/A
lower-sqrt.f6480.8
Applied rewrites80.8%
if 4.1000000000000002e105 < l Initial program 36.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f640.0
Applied rewrites0.0%
Applied rewrites36.1%
Applied rewrites68.0%
Final simplification80.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* M D)))
(t_1
(+
1.0
(* (/ (/ (* M D) (* d 2.0)) l) (/ (/ t_0 (* d 2.0)) (/ -1.0 h)))))
(t_2 (sqrt (/ d h))))
(if (<= l -2e-310)
(* t_1 (* t_2 (/ (sqrt (- d)) (sqrt (- l)))))
(if (<= l 4.1e+105)
(* t_1 (* t_2 (/ (sqrt d) (sqrt l))))
(/
(*
(- 1.0 (/ (* t_0 (* h (* M D))) (* d (* l (* d 4.0)))))
(/ d (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)));
double t_2 = sqrt((d / h));
double tmp;
if (l <= -2e-310) {
tmp = t_1 * (t_2 * (sqrt(-d) / sqrt(-l)));
} else if (l <= 4.1e+105) {
tmp = t_1 * (t_2 * (sqrt(d) / sqrt(l)));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.5d0 * (m * d_1)
t_1 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((t_0 / (d * 2.0d0)) / ((-1.0d0) / h)))
t_2 = sqrt((d / h))
if (l <= (-2d-310)) then
tmp = t_1 * (t_2 * (sqrt(-d) / sqrt(-l)))
else if (l <= 4.1d+105) then
tmp = t_1 * (t_2 * (sqrt(d) / sqrt(l)))
else
tmp = ((1.0d0 - ((t_0 * (h * (m * d_1))) / (d * (l * (d * 4.0d0))))) * (d / sqrt(h))) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h)));
double t_2 = Math.sqrt((d / h));
double tmp;
if (l <= -2e-310) {
tmp = t_1 * (t_2 * (Math.sqrt(-d) / Math.sqrt(-l)));
} else if (l <= 4.1e+105) {
tmp = t_1 * (t_2 * (Math.sqrt(d) / Math.sqrt(l)));
} else {
tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (M * D) t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))) t_2 = math.sqrt((d / h)) tmp = 0 if l <= -2e-310: tmp = t_1 * (t_2 * (math.sqrt(-d) / math.sqrt(-l))) elif l <= 4.1e+105: tmp = t_1 * (t_2 * (math.sqrt(d) / math.sqrt(l))) else: tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(M * D)) t_1 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(t_0 / Float64(d * 2.0)) / Float64(-1.0 / h)))) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(t_1 * Float64(t_2 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); elseif (l <= 4.1e+105) tmp = Float64(t_1 * Float64(t_2 * Float64(sqrt(d) / sqrt(l)))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(t_0 * Float64(h * Float64(M * D))) / Float64(d * Float64(l * Float64(d * 4.0))))) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (M * D); t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((t_0 / (d * 2.0)) / (-1.0 / h))); t_2 = sqrt((d / h)); tmp = 0.0; if (l <= -2e-310) tmp = t_1 * (t_2 * (sqrt(-d) / sqrt(-l))); elseif (l <= 4.1e+105) tmp = t_1 * (t_2 * (sqrt(d) / sqrt(l))); else tmp = ((1.0 - ((t_0 * (h * (M * D))) / (d * (l * (d * 4.0))))) * (d / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t$95$0 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(t$95$1 * N[(t$95$2 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.1e+105], N[(t$95$1 * N[(t$95$2 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(t$95$0 * N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(M \cdot D\right)\\
t_1 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{t\_0}{d \cdot 2}}{\frac{-1}{h}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;\ell \leq 4.1 \cdot 10^{+105}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{t\_0 \cdot \left(h \cdot \left(M \cdot D\right)\right)}{d \cdot \left(\ell \cdot \left(d \cdot 4\right)\right)}\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.5
Applied rewrites75.5%
lift-/.f64N/A
metadata-eval75.5
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6475.5
Applied rewrites75.5%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-divN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f6484.4
Applied rewrites84.4%
if -1.999999999999994e-310 < l < 4.1000000000000002e105Initial program 74.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites78.9%
lift-/.f64N/A
metadata-eval78.9
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6478.9
Applied rewrites78.9%
lift-/.f64N/A
metadata-eval78.9
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6478.9
Applied rewrites78.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow1/2N/A
lower-sqrt.f6480.8
Applied rewrites80.8%
if 4.1000000000000002e105 < l Initial program 36.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f640.0
Applied rewrites0.0%
Applied rewrites36.1%
Applied rewrites68.0%
Final simplification80.7%
(FPCore (d h l M D) :precision binary64 (if (<= d 9e-256) (* (sqrt (/ d l)) (sqrt (/ d h))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 9e-256) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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 <= 9d-256) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 9e-256) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 9e-256: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 9e-256) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 9e-256) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 9e-256], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 9 \cdot 10^{-256}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < 9.0000000000000005e-256Initial program 66.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6467.5
Applied rewrites67.5%
Applied rewrites53.8%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6441.7
Applied rewrites41.7%
if 9.0000000000000005e-256 < d Initial program 67.1%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6450.1
Applied rewrites50.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.7
Applied rewrites45.7%
Applied rewrites46.5%
Applied rewrites51.5%
Final simplification46.3%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.5e-292) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.5e-292) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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.5d-292) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d / (sqrt(h) * sqrt(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.5e-292) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.5e-292: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.5e-292) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.5e-292) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.5e-292], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.5 \cdot 10^{-292}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.5e-292Initial program 70.1%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6451.9
Applied rewrites51.9%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6437.7
Applied rewrites37.7%
if 3.5e-292 < l Initial program 63.1%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6446.1
Applied rewrites46.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.0
Applied rewrites46.0%
Applied rewrites46.8%
Applied rewrites52.3%
Final simplification44.8%
(FPCore (d h l M D) :precision binary64 (if (<= l 2e-291) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2e-291) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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 <= 2d-291) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2e-291) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2e-291: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2e-291) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2e-291) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2e-291], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2 \cdot 10^{-291}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < 1.99999999999999992e-291Initial program 70.1%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6451.9
Applied rewrites51.9%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6437.7
Applied rewrites37.7%
if 1.99999999999999992e-291 < l Initial program 63.1%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6446.1
Applied rewrites46.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.0
Applied rewrites46.0%
Applied rewrites46.8%
Final simplification42.1%
(FPCore (d h l M D) :precision binary64 (if (<= d -7.4e-152) (sqrt (/ (* d d) (* l h))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -7.4e-152) {
tmp = sqrt(((d * d) / (l * h)));
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
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 <= (-7.4d-152)) then
tmp = sqrt(((d * d) / (l * h)))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -7.4e-152) {
tmp = Math.sqrt(((d * d) / (l * h)));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -7.4e-152: tmp = math.sqrt(((d * d) / (l * h))) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -7.4e-152) tmp = sqrt(Float64(Float64(d * d) / Float64(l * h))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -7.4e-152) tmp = sqrt(((d * d) / (l * h))); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -7.4e-152], N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -7.4 \cdot 10^{-152}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -7.3999999999999997e-152Initial program 75.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6458.9
Applied rewrites58.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f645.1
Applied rewrites5.1%
Applied rewrites30.6%
if -7.3999999999999997e-152 < d Initial program 61.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites38.6%
Final simplification35.8%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
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((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 66.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6449.0
Applied rewrites49.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6426.6
Applied rewrites26.6%
Applied rewrites26.9%
Final simplification26.9%
herbie shell --seed 2024226
(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)))))