
(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 24 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
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h)))))
(t_1 (sqrt (- d))))
(if (<= d -1.25e-297)
(* (* (/ t_1 (sqrt (- h))) (/ t_1 (sqrt (- l)))) t_0)
(* t_0 (* (* (sqrt (/ 1.0 h)) (sqrt d)) (/ 1.0 (sqrt (/ l d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double t_1 = sqrt(-d);
double tmp;
if (d <= -1.25e-297) {
tmp = ((t_1 / sqrt(-h)) * (t_1 / sqrt(-l))) * t_0;
} else {
tmp = t_0 * ((sqrt((1.0 / h)) * sqrt(d)) * (1.0 / sqrt((l / 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))
t_1 = sqrt(-d)
if (d <= (-1.25d-297)) then
tmp = ((t_1 / sqrt(-h)) * (t_1 / sqrt(-l))) * t_0
else
tmp = t_0 * ((sqrt((1.0d0 / h)) * sqrt(d)) * (1.0d0 / sqrt((l / d))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double t_1 = Math.sqrt(-d);
double tmp;
if (d <= -1.25e-297) {
tmp = ((t_1 / Math.sqrt(-h)) * (t_1 / Math.sqrt(-l))) * t_0;
} else {
tmp = t_0 * ((Math.sqrt((1.0 / h)) * Math.sqrt(d)) * (1.0 / Math.sqrt((l / d))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))) t_1 = math.sqrt(-d) tmp = 0 if d <= -1.25e-297: tmp = ((t_1 / math.sqrt(-h)) * (t_1 / math.sqrt(-l))) * t_0 else: tmp = t_0 * ((math.sqrt((1.0 / h)) * math.sqrt(d)) * (1.0 / math.sqrt((l / d)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (d <= -1.25e-297) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(t_1 / sqrt(Float64(-l)))) * t_0); else tmp = Float64(t_0 * Float64(Float64(sqrt(Float64(1.0 / h)) * sqrt(d)) * Float64(1.0 / sqrt(Float64(l / d))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))); t_1 = sqrt(-d); tmp = 0.0; if (d <= -1.25e-297) tmp = ((t_1 / sqrt(-h)) * (t_1 / sqrt(-l))) * t_0; else tmp = t_0 * ((sqrt((1.0 / h)) * sqrt(d)) * (1.0 / sqrt((l / d)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[d, -1.25e-297], N[(N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{-297}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-h}} \cdot \frac{t\_1}{\sqrt{-\ell}}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\sqrt{\frac{1}{h}} \cdot \sqrt{d}\right) \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right)\\
\end{array}
\end{array}
if d < -1.25e-297Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites73.7%
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.f6482.8
Applied rewrites82.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6491.6
Applied rewrites91.6%
if -1.25e-297 < d Initial program 71.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites74.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6475.6
Applied rewrites75.6%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6484.2
Applied rewrites84.2%
Final simplification88.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 1000000.0)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(-
1.0
(* h (/ (* (* M D) (* (* M D) 0.5)) (* (* d 2.0) (* l (* d 2.0))))))))
(if (<= t_1 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(* d (sqrt (sqrt (* t_0 t_0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= 1000000.0) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = d * sqrt(sqrt((t_0 * t_0)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= 1000000.0) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (d * Math.sqrt((h / l))) / h;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_0 * t_0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 / (h * l) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_1 <= 1000000.0: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0))))))) elif t_1 <= math.inf: tmp = (d * math.sqrt((h / l))) / h else: tmp = d * math.sqrt(math.sqrt((t_0 * t_0))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= 1000000.0) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(Float64(M * D) * 0.5)) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0)))))))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_0 * t_0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 / (h * l); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_1 <= 1000000.0) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0))))))); elseif (t_1 <= Inf) tmp = (d * sqrt((h / l))) / h; else tmp = d * sqrt(sqrt((t_0 * t_0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, If[LessEqual[t$95$1, 1000000.0], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq 1000000:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot 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)))) < 1e6Initial program 85.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites87.5%
Applied rewrites73.2%
if 1e6 < (*.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.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-*.f6461.0
Applied rewrites61.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6486.9
Applied rewrites86.9%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in 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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification67.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_1 (/ 1.0 (* h l))))
(if (<= t_0 -1e-90)
(*
(-
1.0
(* h (/ (* (* M D) (* D (* M 0.5))) (* (* d 2.0) (* l (* d 2.0))))))
(sqrt (/ (/ d h) (/ l d))))
(if (<= t_0 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(* d (sqrt (sqrt (* t_1 t_1))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= -1e-90) {
tmp = (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0)))))) * sqrt(((d / h) / (l / d)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = d * sqrt(sqrt((t_1 * t_1)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= -1e-90) {
tmp = (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0)))))) * Math.sqrt(((d / h) / (l / d)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (d * Math.sqrt((h / l))) / h;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_1 * t_1)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_1 = 1.0 / (h * l) tmp = 0 if t_0 <= -1e-90: tmp = (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0)))))) * math.sqrt(((d / h) / (l / d))) elif t_0 <= math.inf: tmp = (d * math.sqrt((h / l))) / h else: tmp = d * math.sqrt(math.sqrt((t_1 * t_1))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_1 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (t_0 <= -1e-90) tmp = Float64(Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(D * Float64(M * 0.5))) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0)))))) * sqrt(Float64(Float64(d / h) / Float64(l / d)))); elseif (t_0 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_1 * t_1)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_1 = 1.0 / (h * l); tmp = 0.0; if (t_0 <= -1e-90) tmp = (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0)))))) * sqrt(((d / h) / (l / d))); elseif (t_0 <= Inf) tmp = (d * sqrt((h / l))) / h; else tmp = d * sqrt(sqrt((t_1 * t_1))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-90], N[(N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-90}:\\
\;\;\;\;\left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(D \cdot \left(M \cdot 0.5\right)\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\\
\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)))) < -9.99999999999999995e-91Initial program 85.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites88.9%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6489.2
Applied rewrites89.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
metadata-evalN/A
associate-/r/N/A
remove-double-divN/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites89.2%
Applied rewrites65.6%
if -9.99999999999999995e-91 < (*.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.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-*.f6462.6
Applied rewrites62.6%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.7
Applied rewrites79.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)))) 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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification64.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_1 (/ 1.0 (* h l))))
(if (<= t_0 1000000.0)
(*
(sqrt (/ d l))
(*
(- 1.0 (/ (* (* D 0.125) (* D (* h (* M M)))) (* d (* d l))))
(sqrt (/ d h))))
(if (<= t_0 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(* d (sqrt (sqrt (* t_1 t_1))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= 1000000.0) {
tmp = sqrt((d / l)) * ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * sqrt((d / h)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = d * sqrt(sqrt((t_1 * t_1)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= 1000000.0) {
tmp = Math.sqrt((d / l)) * ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * Math.sqrt((d / h)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (d * Math.sqrt((h / l))) / h;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_1 * t_1)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_1 = 1.0 / (h * l) tmp = 0 if t_0 <= 1000000.0: tmp = math.sqrt((d / l)) * ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * math.sqrt((d / h))) elif t_0 <= math.inf: tmp = (d * math.sqrt((h / l))) / h else: tmp = d * math.sqrt(math.sqrt((t_1 * t_1))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_1 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (t_0 <= 1000000.0) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 - Float64(Float64(Float64(D * 0.125) * Float64(D * Float64(h * Float64(M * M)))) / Float64(d * Float64(d * l)))) * sqrt(Float64(d / h)))); elseif (t_0 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_1 * t_1)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_1 = 1.0 / (h * l); tmp = 0.0; if (t_0 <= 1000000.0) tmp = sqrt((d / l)) * ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * sqrt((d / h))); elseif (t_0 <= Inf) tmp = (d * sqrt((h / l))) / h; else tmp = d * sqrt(sqrt((t_1 * t_1))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1000000.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 - N[(N[(N[(D * 0.125), $MachinePrecision] * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 1000000:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 - \frac{\left(D \cdot 0.125\right) \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\\
\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)))) < 1e6Initial program 85.6%
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-*.f6462.4
Applied rewrites62.4%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-neg.f6439.5
Applied rewrites39.5%
Applied rewrites62.4%
if 1e6 < (*.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.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-*.f6461.0
Applied rewrites61.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6486.9
Applied rewrites86.9%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in 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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification61.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_1 (/ 1.0 (* h l))))
(if (<= t_0 -1e-90)
(*
(-
1.0
(* h (/ (* (* M D) (* (* M D) 0.5)) (* (* d 2.0) (* l (* d 2.0))))))
(sqrt (/ (* d d) (* h l))))
(if (<= t_0 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(* d (sqrt (sqrt (* t_1 t_1))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= -1e-90) {
tmp = (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))) * sqrt(((d * d) / (h * l)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = d * sqrt(sqrt((t_1 * t_1)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= -1e-90) {
tmp = (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))) * Math.sqrt(((d * d) / (h * l)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (d * Math.sqrt((h / l))) / h;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_1 * t_1)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_1 = 1.0 / (h * l) tmp = 0 if t_0 <= -1e-90: tmp = (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))) * math.sqrt(((d * d) / (h * l))) elif t_0 <= math.inf: tmp = (d * math.sqrt((h / l))) / h else: tmp = d * math.sqrt(math.sqrt((t_1 * t_1))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_1 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (t_0 <= -1e-90) tmp = Float64(Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(Float64(M * D) * 0.5)) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0)))))) * sqrt(Float64(Float64(d * d) / Float64(h * l)))); elseif (t_0 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_1 * t_1)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_1 = 1.0 / (h * l); tmp = 0.0; if (t_0 <= -1e-90) tmp = (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))) * sqrt(((d * d) / (h * l))); elseif (t_0 <= Inf) tmp = (d * sqrt((h / l))) / h; else tmp = d * sqrt(sqrt((t_1 * t_1))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-90], N[(N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-90}:\\
\;\;\;\;\left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\\
\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)))) < -9.99999999999999995e-91Initial program 85.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites88.9%
Applied rewrites52.4%
if -9.99999999999999995e-91 < (*.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.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-*.f6462.6
Applied rewrites62.6%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.7
Applied rewrites79.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)))) 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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification59.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_1 (/ 1.0 (* h l))))
(if (<= t_0 -1e-90)
(*
(- 1.0 (/ (* (* D 0.125) (* D (* h (* M M)))) (* d (* d l))))
(sqrt (* (/ d l) (/ d h))))
(if (<= t_0 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(* d (sqrt (sqrt (* t_1 t_1))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= -1e-90) {
tmp = (1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * sqrt(((d / l) * (d / h)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = d * sqrt(sqrt((t_1 * t_1)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= -1e-90) {
tmp = (1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * Math.sqrt(((d / l) * (d / h)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (d * Math.sqrt((h / l))) / h;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_1 * t_1)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_1 = 1.0 / (h * l) tmp = 0 if t_0 <= -1e-90: tmp = (1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * math.sqrt(((d / l) * (d / h))) elif t_0 <= math.inf: tmp = (d * math.sqrt((h / l))) / h else: tmp = d * math.sqrt(math.sqrt((t_1 * t_1))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_1 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (t_0 <= -1e-90) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(D * 0.125) * Float64(D * Float64(h * Float64(M * M)))) / Float64(d * Float64(d * l)))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (t_0 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_1 * t_1)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_1 = 1.0 / (h * l); tmp = 0.0; if (t_0 <= -1e-90) tmp = (1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * sqrt(((d / l) * (d / h))); elseif (t_0 <= Inf) tmp = (d * sqrt((h / l))) / h; else tmp = d * sqrt(sqrt((t_1 * t_1))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-90], N[(N[(1.0 - N[(N[(N[(D * 0.125), $MachinePrecision] * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-90}:\\
\;\;\;\;\left(1 - \frac{\left(D \cdot 0.125\right) \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\\
\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)))) < -9.99999999999999995e-91Initial program 85.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-*.f6461.2
Applied rewrites61.2%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-neg.f6437.7
Applied rewrites37.7%
Applied rewrites55.5%
if -9.99999999999999995e-91 < (*.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.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-*.f6462.6
Applied rewrites62.6%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.7
Applied rewrites79.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)))) 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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification60.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_1 (/ 1.0 (* h l))))
(if (<= t_0 -1e-90)
(*
(fma (- D) (/ (* (* h 0.125) (* D (* M M))) (* d (* d l))) 1.0)
(sqrt (/ (* d d) (* h l))))
(if (<= t_0 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(* d (sqrt (sqrt (* t_1 t_1))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = 1.0 / (h * l);
double tmp;
if (t_0 <= -1e-90) {
tmp = fma(-D, (((h * 0.125) * (D * (M * M))) / (d * (d * l))), 1.0) * sqrt(((d * d) / (h * l)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = d * sqrt(sqrt((t_1 * t_1)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_1 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (t_0 <= -1e-90) tmp = Float64(fma(Float64(-D), Float64(Float64(Float64(h * 0.125) * Float64(D * Float64(M * M))) / Float64(d * Float64(d * l))), 1.0) * sqrt(Float64(Float64(d * d) / Float64(h * l)))); elseif (t_0 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_1 * t_1)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-90], N[(N[((-D) * N[(N[(N[(h * 0.125), $MachinePrecision] * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-90}:\\
\;\;\;\;\mathsf{fma}\left(-D, \frac{\left(h \cdot 0.125\right) \cdot \left(D \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\\
\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)))) < -9.99999999999999995e-91Initial program 85.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-*.f6461.2
Applied rewrites61.2%
Applied rewrites46.4%
if -9.99999999999999995e-91 < (*.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.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-*.f6462.6
Applied rewrites62.6%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.7
Applied rewrites79.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)))) 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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification57.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 (- INFINITY))
(* (sqrt (/ h (* l (* l l)))) (* (/ (* M M) d) (* 0.125 (* D D))))
(if (<= t_1 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(* d (sqrt (sqrt (* t_0 t_0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = d * sqrt(sqrt((t_0 * t_0)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (d * Math.sqrt((h / l))) / h;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_0 * t_0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 / (h * l) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_1 <= -math.inf: tmp = math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D))) elif t_1 <= math.inf: tmp = (d * math.sqrt((h / l))) / h else: tmp = d * math.sqrt(math.sqrt((t_0 * t_0))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(Float64(M * M) / d) * Float64(0.125 * Float64(D * D)))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_0 * t_0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 / (h * l); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_1 <= -Inf) tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D))); elseif (t_1 <= Inf) tmp = (d * sqrt((h / l))) / h; else tmp = d * sqrt(sqrt((t_0 * t_0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0.125 \cdot \left(D \cdot D\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot 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)))) < -inf.0Initial program 84.4%
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-*.f6470.7
Applied rewrites70.7%
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
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
Applied rewrites41.8%
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)))) < +inf.0Initial program 84.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-*.f6457.0
Applied rewrites57.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites25.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6471.6
Applied rewrites71.6%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in 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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification53.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (sqrt (/ h l))))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_2 (/ 1.0 (* h l))))
(if (<= t_1 -4e-140)
(/ t_0 (- h))
(if (<= t_1 INFINITY) (/ t_0 h) (* d (sqrt (sqrt (* t_2 t_2))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * sqrt((h / l));
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_2 = 1.0 / (h * l);
double tmp;
if (t_1 <= -4e-140) {
tmp = t_0 / -h;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / h;
} else {
tmp = d * sqrt(sqrt((t_2 * t_2)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * Math.sqrt((h / l));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_2 = 1.0 / (h * l);
double tmp;
if (t_1 <= -4e-140) {
tmp = t_0 / -h;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_0 / h;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_2 * t_2)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * math.sqrt((h / l)) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_2 = 1.0 / (h * l) tmp = 0 if t_1 <= -4e-140: tmp = t_0 / -h elif t_1 <= math.inf: tmp = t_0 / h else: tmp = d * math.sqrt(math.sqrt((t_2 * t_2))) return tmp
function code(d, h, l, M, D) t_0 = Float64(d * sqrt(Float64(h / l))) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_2 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (t_1 <= -4e-140) tmp = Float64(t_0 / Float64(-h)); elseif (t_1 <= Inf) tmp = Float64(t_0 / h); else tmp = Float64(d * sqrt(sqrt(Float64(t_2 * t_2)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * sqrt((h / l)); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_2 = 1.0 / (h * l); tmp = 0.0; if (t_1 <= -4e-140) tmp = t_0 / -h; elseif (t_1 <= Inf) tmp = t_0 / h; else tmp = d * sqrt(sqrt((t_2 * t_2))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-140], N[(t$95$0 / (-h)), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / h), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$2 * t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{h}{\ell}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_2 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-140}:\\
\;\;\;\;\frac{t\_0}{-h}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_2 \cdot t\_2}}\\
\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)))) < -3.9999999999999999e-140Initial program 85.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-*.f6460.5
Applied rewrites60.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites27.3%
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
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
if -3.9999999999999999e-140 < (*.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.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.1
Applied rewrites63.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6480.4
Applied rewrites80.4%
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-*.f6412.2
Applied rewrites12.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6413.8
Applied rewrites13.8%
lift-*.f64N/A
lift-/.f6413.8
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6420.0
Applied rewrites20.0%
Final simplification50.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (sqrt (/ h l))))
(t_1 (/ t_0 (- h)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_2 -4e-140) t_1 (if (<= t_2 INFINITY) (/ t_0 h) t_1))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * sqrt((h / l));
double t_1 = t_0 / -h;
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_2 <= -4e-140) {
tmp = t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 / h;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * Math.sqrt((h / l));
double t_1 = t_0 / -h;
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_2 <= -4e-140) {
tmp = t_1;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_0 / h;
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * math.sqrt((h / l)) t_1 = t_0 / -h t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_2 <= -4e-140: tmp = t_1 elif t_2 <= math.inf: tmp = t_0 / h else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64(d * sqrt(Float64(h / l))) t_1 = Float64(t_0 / Float64(-h)) t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_2 <= -4e-140) tmp = t_1; elseif (t_2 <= Inf) tmp = Float64(t_0 / h); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * sqrt((h / l)); t_1 = t_0 / -h; t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_2 <= -4e-140) tmp = t_1; elseif (t_2 <= Inf) tmp = t_0 / h; else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / (-h)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(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]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-140], t$95$1, If[LessEqual[t$95$2, Infinity], N[(t$95$0 / h), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{h}{\ell}}\\
t_1 := \frac{t\_0}{-h}\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)))) < -3.9999999999999999e-140 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 58.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-*.f6444.9
Applied rewrites44.9%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites19.3%
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
mul-1-negN/A
lower-neg.f6422.7
Applied rewrites22.7%
if -3.9999999999999999e-140 < (*.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.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.1
Applied rewrites63.1%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites28.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6480.4
Applied rewrites80.4%
Final simplification49.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* (* M D) 0.5) (* d 2.0)))
(t_1 (/ (/ (* M D) (* d 2.0)) l))
(t_2 (+ 1.0 (* t_1 (/ t_0 (/ -1.0 h))))))
(if (<= h -3.2e+170)
(* t_2 (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))))
(if (<= h -5e-310)
(* (* d (sqrt (/ 1.0 (* h l)))) (+ (* t_1 (/ t_0 (/ 1.0 h))) -1.0))
(* t_2 (* (* (sqrt (/ 1.0 h)) (sqrt d)) (/ 1.0 (sqrt (/ l d)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = ((M * D) / (d * 2.0)) / l;
double t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)));
} else if (h <= -5e-310) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else {
tmp = t_2 * ((sqrt((1.0 / h)) * sqrt(d)) * (1.0 / sqrt((l / 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((m * d_1) * 0.5d0) / (d * 2.0d0)
t_1 = ((m * d_1) / (d * 2.0d0)) / l
t_2 = 1.0d0 + (t_1 * (t_0 / ((-1.0d0) / h)))
if (h <= (-3.2d+170)) then
tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)))
else if (h <= (-5d-310)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((t_1 * (t_0 / (1.0d0 / h))) + (-1.0d0))
else
tmp = t_2 * ((sqrt((1.0d0 / h)) * sqrt(d)) * (1.0d0 / sqrt((l / d))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = ((M * D) / (d * 2.0)) / l;
double t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_2 * ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l)));
} else if (h <= -5e-310) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else {
tmp = t_2 * ((Math.sqrt((1.0 / h)) * Math.sqrt(d)) * (1.0 / Math.sqrt((l / d))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = ((M * D) * 0.5) / (d * 2.0) t_1 = ((M * D) / (d * 2.0)) / l t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h))) tmp = 0 if h <= -3.2e+170: tmp = t_2 * ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) elif h <= -5e-310: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0) else: tmp = t_2 * ((math.sqrt((1.0 / h)) * math.sqrt(d)) * (1.0 / math.sqrt((l / d)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) t_1 = Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) t_2 = Float64(1.0 + Float64(t_1 * Float64(t_0 / Float64(-1.0 / h)))) tmp = 0.0 if (h <= -3.2e+170) tmp = Float64(t_2 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l)))); elseif (h <= -5e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(t_1 * Float64(t_0 / Float64(1.0 / h))) + -1.0)); else tmp = Float64(t_2 * Float64(Float64(sqrt(Float64(1.0 / h)) * sqrt(d)) * Float64(1.0 / sqrt(Float64(l / d))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * D) * 0.5) / (d * 2.0); t_1 = ((M * D) / (d * 2.0)) / l; t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h))); tmp = 0.0; if (h <= -3.2e+170) tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))); elseif (h <= -5e-310) tmp = (d * sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0); else tmp = t_2 * ((sqrt((1.0 / h)) * sqrt(d)) * (1.0 / sqrt((l / d)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(t$95$1 * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.2e+170], N[(t$95$2 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(t$95$0 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}\\
t_1 := \frac{\frac{M \cdot D}{d \cdot 2}}{\ell}\\
t_2 := 1 + t\_1 \cdot \frac{t\_0}{\frac{-1}{h}}\\
\mathbf{if}\;h \leq -3.2 \cdot 10^{+170}:\\
\;\;\;\;t\_2 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(t\_1 \cdot \frac{t\_0}{\frac{1}{h}} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(\left(\sqrt{\frac{1}{h}} \cdot \sqrt{d}\right) \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right)\\
\end{array}
\end{array}
if h < -3.19999999999999979e170Initial program 67.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites68.0%
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.f6490.0
Applied rewrites90.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6490.0
Applied rewrites90.0%
if -3.19999999999999979e170 < h < -4.999999999999985e-310Initial program 68.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites74.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f640.0
Applied rewrites0.0%
Taylor expanded in h 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.f6485.9
Applied rewrites85.9%
if -4.999999999999985e-310 < h Initial program 72.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites74.6%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6476.2
Applied rewrites76.2%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6484.9
Applied rewrites84.9%
Final simplification86.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* (* M D) 0.5) (* d 2.0)))
(t_1 (/ (/ (* M D) (* d 2.0)) l))
(t_2 (+ 1.0 (* t_1 (/ t_0 (/ -1.0 h))))))
(if (<= h -3.2e+170)
(* t_2 (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))))
(if (<= h -5e-310)
(* (* d (sqrt (/ 1.0 (* h l)))) (+ (* t_1 (/ t_0 (/ 1.0 h))) -1.0))
(* t_2 (* (/ 1.0 (sqrt (/ l d))) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = ((M * D) / (d * 2.0)) / l;
double t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)));
} else if (h <= -5e-310) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else {
tmp = t_2 * ((1.0 / sqrt((l / d))) * (sqrt(d) / sqrt(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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((m * d_1) * 0.5d0) / (d * 2.0d0)
t_1 = ((m * d_1) / (d * 2.0d0)) / l
t_2 = 1.0d0 + (t_1 * (t_0 / ((-1.0d0) / h)))
if (h <= (-3.2d+170)) then
tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)))
else if (h <= (-5d-310)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((t_1 * (t_0 / (1.0d0 / h))) + (-1.0d0))
else
tmp = t_2 * ((1.0d0 / sqrt((l / d))) * (sqrt(d) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = ((M * D) / (d * 2.0)) / l;
double t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_2 * ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l)));
} else if (h <= -5e-310) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else {
tmp = t_2 * ((1.0 / Math.sqrt((l / d))) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = ((M * D) * 0.5) / (d * 2.0) t_1 = ((M * D) / (d * 2.0)) / l t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h))) tmp = 0 if h <= -3.2e+170: tmp = t_2 * ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) elif h <= -5e-310: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0) else: tmp = t_2 * ((1.0 / math.sqrt((l / d))) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) t_1 = Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) t_2 = Float64(1.0 + Float64(t_1 * Float64(t_0 / Float64(-1.0 / h)))) tmp = 0.0 if (h <= -3.2e+170) tmp = Float64(t_2 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l)))); elseif (h <= -5e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(t_1 * Float64(t_0 / Float64(1.0 / h))) + -1.0)); else tmp = Float64(t_2 * Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * D) * 0.5) / (d * 2.0); t_1 = ((M * D) / (d * 2.0)) / l; t_2 = 1.0 + (t_1 * (t_0 / (-1.0 / h))); tmp = 0.0; if (h <= -3.2e+170) tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))); elseif (h <= -5e-310) tmp = (d * sqrt((1.0 / (h * l)))) * ((t_1 * (t_0 / (1.0 / h))) + -1.0); else tmp = t_2 * ((1.0 / sqrt((l / d))) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(t$95$1 * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.2e+170], N[(t$95$2 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(t$95$0 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}\\
t_1 := \frac{\frac{M \cdot D}{d \cdot 2}}{\ell}\\
t_2 := 1 + t\_1 \cdot \frac{t\_0}{\frac{-1}{h}}\\
\mathbf{if}\;h \leq -3.2 \cdot 10^{+170}:\\
\;\;\;\;t\_2 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(t\_1 \cdot \frac{t\_0}{\frac{1}{h}} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -3.19999999999999979e170Initial program 67.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites68.0%
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.f6490.0
Applied rewrites90.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6490.0
Applied rewrites90.0%
if -3.19999999999999979e170 < h < -4.999999999999985e-310Initial program 68.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites74.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f640.0
Applied rewrites0.0%
Taylor expanded in h 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.f6485.9
Applied rewrites85.9%
if -4.999999999999985e-310 < h Initial program 72.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites74.6%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6476.2
Applied rewrites76.2%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6484.9
Applied rewrites84.9%
Final simplification85.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* (* M D) 0.5) (* d 2.0)))
(t_1 (* d (sqrt (/ 1.0 (* h l)))))
(t_2 (/ (/ (* M D) (* d 2.0)) l))
(t_3 (+ 1.0 (* t_2 (/ t_0 (/ -1.0 h))))))
(if (<= h -3.2e+170)
(* t_3 (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))))
(if (<= h -5e-310)
(* t_1 (+ (* t_2 (/ t_0 (/ 1.0 h))) -1.0))
(if (<= h 5e+106)
(* t_3 t_1)
(*
(* (* (sqrt (/ 1.0 h)) (sqrt d)) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* t_2 (* D (* (/ (* h M) d) 0.25))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = d * sqrt((1.0 / (h * l)));
double t_2 = ((M * D) / (d * 2.0)) / l;
double t_3 = 1.0 + (t_2 * (t_0 / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_3 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)));
} else if (h <= -5e-310) {
tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0);
} else if (h <= 5e+106) {
tmp = t_3 * t_1;
} else {
tmp = ((sqrt((1.0 / h)) * sqrt(d)) * (1.0 / sqrt((l / d)))) * (1.0 - (t_2 * (D * (((h * M) / d) * 0.25))));
}
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) :: t_3
real(8) :: tmp
t_0 = ((m * d_1) * 0.5d0) / (d * 2.0d0)
t_1 = d * sqrt((1.0d0 / (h * l)))
t_2 = ((m * d_1) / (d * 2.0d0)) / l
t_3 = 1.0d0 + (t_2 * (t_0 / ((-1.0d0) / h)))
if (h <= (-3.2d+170)) then
tmp = t_3 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)))
else if (h <= (-5d-310)) then
tmp = t_1 * ((t_2 * (t_0 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 5d+106) then
tmp = t_3 * t_1
else
tmp = ((sqrt((1.0d0 / h)) * sqrt(d)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (t_2 * (d_1 * (((h * m) / d) * 0.25d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = d * Math.sqrt((1.0 / (h * l)));
double t_2 = ((M * D) / (d * 2.0)) / l;
double t_3 = 1.0 + (t_2 * (t_0 / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_3 * ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l)));
} else if (h <= -5e-310) {
tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0);
} else if (h <= 5e+106) {
tmp = t_3 * t_1;
} else {
tmp = ((Math.sqrt((1.0 / h)) * Math.sqrt(d)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (t_2 * (D * (((h * M) / d) * 0.25))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = ((M * D) * 0.5) / (d * 2.0) t_1 = d * math.sqrt((1.0 / (h * l))) t_2 = ((M * D) / (d * 2.0)) / l t_3 = 1.0 + (t_2 * (t_0 / (-1.0 / h))) tmp = 0 if h <= -3.2e+170: tmp = t_3 * ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) elif h <= -5e-310: tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0) elif h <= 5e+106: tmp = t_3 * t_1 else: tmp = ((math.sqrt((1.0 / h)) * math.sqrt(d)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (t_2 * (D * (((h * M) / d) * 0.25)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) t_1 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_2 = Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) t_3 = Float64(1.0 + Float64(t_2 * Float64(t_0 / Float64(-1.0 / h)))) tmp = 0.0 if (h <= -3.2e+170) tmp = Float64(t_3 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l)))); elseif (h <= -5e-310) tmp = Float64(t_1 * Float64(Float64(t_2 * Float64(t_0 / Float64(1.0 / h))) + -1.0)); elseif (h <= 5e+106) tmp = Float64(t_3 * t_1); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / h)) * sqrt(d)) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(t_2 * Float64(D * Float64(Float64(Float64(h * M) / d) * 0.25))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * D) * 0.5) / (d * 2.0); t_1 = d * sqrt((1.0 / (h * l))); t_2 = ((M * D) / (d * 2.0)) / l; t_3 = 1.0 + (t_2 * (t_0 / (-1.0 / h))); tmp = 0.0; if (h <= -3.2e+170) tmp = t_3 * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))); elseif (h <= -5e-310) tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0); elseif (h <= 5e+106) tmp = t_3 * t_1; else tmp = ((sqrt((1.0 / h)) * sqrt(d)) * (1.0 / sqrt((l / d)))) * (1.0 - (t_2 * (D * (((h * M) / d) * 0.25)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(t$95$2 * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.2e+170], N[(t$95$3 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(t$95$1 * N[(N[(t$95$2 * N[(t$95$0 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 5e+106], N[(t$95$3 * t$95$1), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(t$95$2 * N[(D * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}\\
t_1 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_2 := \frac{\frac{M \cdot D}{d \cdot 2}}{\ell}\\
t_3 := 1 + t\_2 \cdot \frac{t\_0}{\frac{-1}{h}}\\
\mathbf{if}\;h \leq -3.2 \cdot 10^{+170}:\\
\;\;\;\;t\_3 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{t\_0}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 5 \cdot 10^{+106}:\\
\;\;\;\;t\_3 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{\frac{1}{h}} \cdot \sqrt{d}\right) \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - t\_2 \cdot \left(D \cdot \left(\frac{h \cdot M}{d} \cdot 0.25\right)\right)\right)\\
\end{array}
\end{array}
if h < -3.19999999999999979e170Initial program 67.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites68.0%
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.f6490.0
Applied rewrites90.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6490.0
Applied rewrites90.0%
if -3.19999999999999979e170 < h < -4.999999999999985e-310Initial program 68.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites74.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f640.0
Applied rewrites0.0%
Taylor expanded in h 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.f6485.9
Applied rewrites85.9%
if -4.999999999999985e-310 < h < 4.9999999999999998e106Initial program 75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites78.9%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6480.2
Applied rewrites80.2%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6487.2
Applied rewrites87.2%
Taylor expanded in h around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6484.8
Applied rewrites84.8%
if 4.9999999999999998e106 < h Initial program 65.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites66.4%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6468.6
Applied rewrites68.6%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6480.5
Applied rewrites80.5%
Taylor expanded in M around 0
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6471.0
Applied rewrites71.0%
Final simplification83.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (/ (* M D) (* d 2.0)) l)))
(if (<= l -2.2e+228)
(*
(*
(- 1.0 (/ (* (* D 0.125) (* D (* h (* M M)))) (* d (* d l))))
(sqrt (* d (/ d (- h)))))
(sqrt (/ -1.0 l)))
(if (<= l -5e-311)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* t_0 (/ h (* (/ d (* M D)) 4.0)))))
(if (<= l 2.2e+94)
(*
(+ 1.0 (* t_0 (/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))
(* d (sqrt (/ 1.0 (* h l)))))
(/ (/ 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)) / l;
double tmp;
if (l <= -2.2e+228) {
tmp = ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * sqrt((d * (d / -h)))) * sqrt((-1.0 / l));
} else if (l <= -5e-311) {
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (t_0 * (h / ((d / (M * D)) * 4.0))));
} else if (l <= 2.2e+94) {
tmp = (1.0 + (t_0 * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * sqrt((1.0 / (h * l))));
} 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) :: t_0
real(8) :: tmp
t_0 = ((m * d_1) / (d * 2.0d0)) / l
if (l <= (-2.2d+228)) then
tmp = ((1.0d0 - (((d_1 * 0.125d0) * (d_1 * (h * (m * m)))) / (d * (d * l)))) * sqrt((d * (d / -h)))) * sqrt(((-1.0d0) / l))
else if (l <= (-5d-311)) then
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (t_0 * (h / ((d / (m * d_1)) * 4.0d0))))
else if (l <= 2.2d+94) then
tmp = (1.0d0 + (t_0 * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))) * (d * sqrt((1.0d0 / (h * l))))
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 t_0 = ((M * D) / (d * 2.0)) / l;
double tmp;
if (l <= -2.2e+228) {
tmp = ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * Math.sqrt((d * (d / -h)))) * Math.sqrt((-1.0 / l));
} else if (l <= -5e-311) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (t_0 * (h / ((d / (M * D)) * 4.0))));
} else if (l <= 2.2e+94) {
tmp = (1.0 + (t_0 * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * Math.sqrt((1.0 / (h * l))));
} else {
tmp = (d / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = ((M * D) / (d * 2.0)) / l tmp = 0 if l <= -2.2e+228: tmp = ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * math.sqrt((d * (d / -h)))) * math.sqrt((-1.0 / l)) elif l <= -5e-311: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (t_0 * (h / ((d / (M * D)) * 4.0)))) elif l <= 2.2e+94: tmp = (1.0 + (t_0 * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * math.sqrt((1.0 / (h * l)))) else: tmp = (d / math.sqrt(h)) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) tmp = 0.0 if (l <= -2.2e+228) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(D * 0.125) * Float64(D * Float64(h * Float64(M * M)))) / Float64(d * Float64(d * l)))) * sqrt(Float64(d * Float64(d / Float64(-h))))) * sqrt(Float64(-1.0 / l))); elseif (l <= -5e-311) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(t_0 * Float64(h / Float64(Float64(d / Float64(M * D)) * 4.0))))); elseif (l <= 2.2e+94) tmp = Float64(Float64(1.0 + Float64(t_0 * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) * Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); else tmp = Float64(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)) / l; tmp = 0.0; if (l <= -2.2e+228) tmp = ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / (d * (d * l)))) * sqrt((d * (d / -h)))) * sqrt((-1.0 / l)); elseif (l <= -5e-311) tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (t_0 * (h / ((d / (M * D)) * 4.0)))); elseif (l <= 2.2e+94) tmp = (1.0 + (t_0 * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * sqrt((1.0 / (h * l)))); else tmp = (d / sqrt(h)) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[l, -2.2e+228], N[(N[(N[(1.0 - N[(N[(N[(D * 0.125), $MachinePrecision] * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d * N[(d / (-h)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(h / N[(N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.2e+94], N[(N[(1.0 + N[(t$95$0 * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{M \cdot D}{d \cdot 2}}{\ell}\\
\mathbf{if}\;\ell \leq -2.2 \cdot 10^{+228}:\\
\;\;\;\;\left(\left(1 - \frac{\left(D \cdot 0.125\right) \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \sqrt{d \cdot \frac{d}{-h}}\right) \cdot \sqrt{\frac{-1}{\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - t\_0 \cdot \frac{h}{\frac{d}{M \cdot D} \cdot 4}\right)\\
\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+94}:\\
\;\;\;\;\left(1 + t\_0 \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.2e228Initial program 44.3%
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-*.f6438.1
Applied rewrites38.1%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-neg.f6468.3
Applied rewrites68.3%
Applied rewrites68.6%
if -2.2e228 < l < -5.00000000000023e-311Initial program 70.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites76.9%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
metadata-evalN/A
associate-/r/N/A
remove-double-divN/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites76.9%
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.f6487.1
Applied rewrites87.1%
if -5.00000000000023e-311 < l < 2.20000000000000012e94Initial program 75.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.0
Applied rewrites82.0%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6491.5
Applied rewrites91.5%
Taylor expanded in h around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6487.9
Applied rewrites87.9%
if 2.20000000000000012e94 < l Initial program 64.5%
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-*.f6447.1
Applied rewrites47.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
lift-*.f64N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f6449.8
Applied rewrites49.8%
sqrt-prodN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6477.3
Applied rewrites77.3%
Final simplification84.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* (* M D) 0.5) (* d 2.0)))
(t_1 (* d (sqrt (/ 1.0 (* h l)))))
(t_2 (/ (/ (* M D) (* d 2.0)) l)))
(if (<= l -3.6e+143)
(*
(* (sqrt (/ d h)) (* (sqrt (- d)) (sqrt (/ -1.0 l))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* d l)))))
(if (<= l -5e-311)
(* t_1 (+ (* t_2 (/ t_0 (/ 1.0 h))) -1.0))
(if (<= l 2.2e+94)
(* (+ 1.0 (* t_2 (/ t_0 (/ -1.0 h)))) t_1)
(/ (/ d (sqrt h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = d * sqrt((1.0 / (h * l)));
double t_2 = ((M * D) / (d * 2.0)) / l;
double tmp;
if (l <= -3.6e+143) {
tmp = (sqrt((d / h)) * (sqrt(-d) * sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l))));
} else if (l <= -5e-311) {
tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0);
} else if (l <= 2.2e+94) {
tmp = (1.0 + (t_2 * (t_0 / (-1.0 / h)))) * t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((m * d_1) * 0.5d0) / (d * 2.0d0)
t_1 = d * sqrt((1.0d0 / (h * l)))
t_2 = ((m * d_1) / (d * 2.0d0)) / l
if (l <= (-3.6d+143)) then
tmp = (sqrt((d / h)) * (sqrt(-d) * sqrt(((-1.0d0) / l)))) * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (d * l))))
else if (l <= (-5d-311)) then
tmp = t_1 * ((t_2 * (t_0 / (1.0d0 / h))) + (-1.0d0))
else if (l <= 2.2d+94) then
tmp = (1.0d0 + (t_2 * (t_0 / ((-1.0d0) / h)))) * t_1
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 t_0 = ((M * D) * 0.5) / (d * 2.0);
double t_1 = d * Math.sqrt((1.0 / (h * l)));
double t_2 = ((M * D) / (d * 2.0)) / l;
double tmp;
if (l <= -3.6e+143) {
tmp = (Math.sqrt((d / h)) * (Math.sqrt(-d) * Math.sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l))));
} else if (l <= -5e-311) {
tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0);
} else if (l <= 2.2e+94) {
tmp = (1.0 + (t_2 * (t_0 / (-1.0 / h)))) * t_1;
} else {
tmp = (d / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = ((M * D) * 0.5) / (d * 2.0) t_1 = d * math.sqrt((1.0 / (h * l))) t_2 = ((M * D) / (d * 2.0)) / l tmp = 0 if l <= -3.6e+143: tmp = (math.sqrt((d / h)) * (math.sqrt(-d) * math.sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l)))) elif l <= -5e-311: tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0) elif l <= 2.2e+94: tmp = (1.0 + (t_2 * (t_0 / (-1.0 / h)))) * t_1 else: tmp = (d / math.sqrt(h)) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) t_1 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_2 = Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) tmp = 0.0 if (l <= -3.6e+143) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) * sqrt(Float64(-1.0 / l)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(d * l))))); elseif (l <= -5e-311) tmp = Float64(t_1 * Float64(Float64(t_2 * Float64(t_0 / Float64(1.0 / h))) + -1.0)); elseif (l <= 2.2e+94) tmp = Float64(Float64(1.0 + Float64(t_2 * Float64(t_0 / Float64(-1.0 / h)))) * t_1); else tmp = Float64(Float64(d / sqrt(h)) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * D) * 0.5) / (d * 2.0); t_1 = d * sqrt((1.0 / (h * l))); t_2 = ((M * D) / (d * 2.0)) / l; tmp = 0.0; if (l <= -3.6e+143) tmp = (sqrt((d / h)) * (sqrt(-d) * sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l)))); elseif (l <= -5e-311) tmp = t_1 * ((t_2 * (t_0 / (1.0 / h))) + -1.0); elseif (l <= 2.2e+94) tmp = (1.0 + (t_2 * (t_0 / (-1.0 / h)))) * t_1; else tmp = (d / sqrt(h)) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[l, -3.6e+143], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(t$95$1 * N[(N[(t$95$2 * N[(t$95$0 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.2e+94], N[(N[(1.0 + N[(t$95$2 * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}\\
t_1 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_2 := \frac{\frac{M \cdot D}{d \cdot 2}}{\ell}\\
\mathbf{if}\;\ell \leq -3.6 \cdot 10^{+143}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{-d} \cdot \sqrt{\frac{-1}{\ell}}\right)\right) \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{t\_0}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+94}:\\
\;\;\;\;\left(1 + t\_2 \cdot \frac{t\_0}{\frac{-1}{h}}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.5999999999999999e143Initial program 55.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-*.f6447.5
Applied rewrites47.5%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-neg.f6465.8
Applied rewrites65.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6465.8
Applied rewrites65.8%
if -3.5999999999999999e143 < l < -5.00000000000023e-311Initial program 72.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites78.1%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6478.4
Applied rewrites78.4%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f640.0
Applied rewrites0.0%
Taylor expanded in h 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.f6489.1
Applied rewrites89.1%
if -5.00000000000023e-311 < l < 2.20000000000000012e94Initial program 75.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.0
Applied rewrites82.0%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6491.5
Applied rewrites91.5%
Taylor expanded in h around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6487.9
Applied rewrites87.9%
if 2.20000000000000012e94 < l Initial program 64.5%
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-*.f6447.1
Applied rewrites47.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
lift-*.f64N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f6449.8
Applied rewrites49.8%
sqrt-prodN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6477.3
Applied rewrites77.3%
Final simplification83.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= l -5.1e+45)
(*
(* t_0 (* (sqrt (- d)) (sqrt (/ -1.0 l))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* d l)))))
(if (<= l -5e-311)
(/
(*
t_0
(-
1.0
(* h (/ (* (* M D) (* D (* M 0.5))) (* (* d 2.0) (* l (* d 2.0)))))))
(sqrt (/ l d)))
(if (<= l 2.2e+94)
(*
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))
(* d (sqrt (/ 1.0 (* h l)))))
(/ (/ d (sqrt h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (l <= -5.1e+45) {
tmp = (t_0 * (sqrt(-d) * sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l))));
} else if (l <= -5e-311) {
tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / sqrt((l / d));
} else if (l <= 2.2e+94) {
tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * sqrt((1.0 / (h * l))));
} 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) :: t_0
real(8) :: tmp
t_0 = sqrt((d / h))
if (l <= (-5.1d+45)) then
tmp = (t_0 * (sqrt(-d) * sqrt(((-1.0d0) / l)))) * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (d * l))))
else if (l <= (-5d-311)) then
tmp = (t_0 * (1.0d0 - (h * (((m * d_1) * (d_1 * (m * 0.5d0))) / ((d * 2.0d0) * (l * (d * 2.0d0))))))) / sqrt((l / d))
else if (l <= 2.2d+94) then
tmp = (1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))) * (d * sqrt((1.0d0 / (h * l))))
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 t_0 = Math.sqrt((d / h));
double tmp;
if (l <= -5.1e+45) {
tmp = (t_0 * (Math.sqrt(-d) * Math.sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l))));
} else if (l <= -5e-311) {
tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / Math.sqrt((l / d));
} else if (l <= 2.2e+94) {
tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * Math.sqrt((1.0 / (h * l))));
} else {
tmp = (d / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) tmp = 0 if l <= -5.1e+45: tmp = (t_0 * (math.sqrt(-d) * math.sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l)))) elif l <= -5e-311: tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / math.sqrt((l / d)) elif l <= 2.2e+94: tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * math.sqrt((1.0 / (h * l)))) else: tmp = (d / math.sqrt(h)) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -5.1e+45) tmp = Float64(Float64(t_0 * Float64(sqrt(Float64(-d)) * sqrt(Float64(-1.0 / l)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(d * l))))); elseif (l <= -5e-311) tmp = Float64(Float64(t_0 * Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(D * Float64(M * 0.5))) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0))))))) / sqrt(Float64(l / d))); elseif (l <= 2.2e+94) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) * Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); else tmp = Float64(Float64(d / sqrt(h)) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); tmp = 0.0; if (l <= -5.1e+45) tmp = (t_0 * (sqrt(-d) * sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l)))); elseif (l <= -5e-311) tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / sqrt((l / d)); elseif (l <= 2.2e+94) tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d * sqrt((1.0 / (h * l)))); else tmp = (d / sqrt(h)) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5.1e+45], N[(N[(t$95$0 * N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(N[(t$95$0 * N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.2e+94], N[(N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -5.1 \cdot 10^{+45}:\\
\;\;\;\;\left(t\_0 \cdot \left(\sqrt{-d} \cdot \sqrt{\frac{-1}{\ell}}\right)\right) \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{t\_0 \cdot \left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(D \cdot \left(M \cdot 0.5\right)\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+94}:\\
\;\;\;\;\left(1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.0999999999999997e45Initial program 54.5%
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-*.f6448.9
Applied rewrites48.9%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-neg.f6462.8
Applied rewrites62.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6462.8
Applied rewrites62.8%
if -5.0999999999999997e45 < l < -5.00000000000023e-311Initial program 76.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites81.4%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
metadata-evalN/A
associate-/r/N/A
remove-double-divN/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.8%
Applied rewrites65.8%
if -5.00000000000023e-311 < l < 2.20000000000000012e94Initial program 75.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.0
Applied rewrites82.0%
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
lift-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6491.5
Applied rewrites91.5%
Taylor expanded in h around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6487.9
Applied rewrites87.9%
if 2.20000000000000012e94 < l Initial program 64.5%
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-*.f6447.1
Applied rewrites47.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
lift-*.f64N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f6449.8
Applied rewrites49.8%
sqrt-prodN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6477.3
Applied rewrites77.3%
Final simplification73.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= l -5.1e+45)
(*
(* t_0 (* (sqrt (- d)) (sqrt (/ -1.0 l))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* d l)))))
(if (<= l 1.52e-86)
(/
(*
t_0
(-
1.0
(* h (/ (* (* M D) (* D (* M 0.5))) (* (* d 2.0) (* l (* d 2.0)))))))
(sqrt (/ l d)))
(* d (/ (/ 1.0 (sqrt l)) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (l <= -5.1e+45) {
tmp = (t_0 * (sqrt(-d) * sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l))));
} else if (l <= 1.52e-86) {
tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / sqrt((l / d));
} else {
tmp = d * ((1.0 / sqrt(l)) / sqrt(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) :: t_0
real(8) :: tmp
t_0 = sqrt((d / h))
if (l <= (-5.1d+45)) then
tmp = (t_0 * (sqrt(-d) * sqrt(((-1.0d0) / l)))) * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (d * l))))
else if (l <= 1.52d-86) then
tmp = (t_0 * (1.0d0 - (h * (((m * d_1) * (d_1 * (m * 0.5d0))) / ((d * 2.0d0) * (l * (d * 2.0d0))))))) / sqrt((l / d))
else
tmp = d * ((1.0d0 / sqrt(l)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double tmp;
if (l <= -5.1e+45) {
tmp = (t_0 * (Math.sqrt(-d) * Math.sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l))));
} else if (l <= 1.52e-86) {
tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / Math.sqrt((l / d));
} else {
tmp = d * ((1.0 / Math.sqrt(l)) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) tmp = 0 if l <= -5.1e+45: tmp = (t_0 * (math.sqrt(-d) * math.sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l)))) elif l <= 1.52e-86: tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / math.sqrt((l / d)) else: tmp = d * ((1.0 / math.sqrt(l)) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -5.1e+45) tmp = Float64(Float64(t_0 * Float64(sqrt(Float64(-d)) * sqrt(Float64(-1.0 / l)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(d * l))))); elseif (l <= 1.52e-86) tmp = Float64(Float64(t_0 * Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(D * Float64(M * 0.5))) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0))))))) / sqrt(Float64(l / d))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(l)) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); tmp = 0.0; if (l <= -5.1e+45) tmp = (t_0 * (sqrt(-d) * sqrt((-1.0 / l)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (d * l)))); elseif (l <= 1.52e-86) tmp = (t_0 * (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))) / sqrt((l / d)); else tmp = d * ((1.0 / sqrt(l)) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5.1e+45], N[(N[(t$95$0 * N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.52e-86], N[(N[(t$95$0 * N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -5.1 \cdot 10^{+45}:\\
\;\;\;\;\left(t\_0 \cdot \left(\sqrt{-d} \cdot \sqrt{\frac{-1}{\ell}}\right)\right) \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right)\\
\mathbf{elif}\;\ell \leq 1.52 \cdot 10^{-86}:\\
\;\;\;\;\frac{t\_0 \cdot \left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(D \cdot \left(M \cdot 0.5\right)\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -5.0999999999999997e45Initial program 54.5%
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-*.f6448.9
Applied rewrites48.9%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-neg.f6462.8
Applied rewrites62.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6462.8
Applied rewrites62.8%
if -5.0999999999999997e45 < l < 1.52e-86Initial program 78.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites83.5%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6483.8
Applied rewrites83.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
metadata-evalN/A
associate-/r/N/A
remove-double-divN/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites83.8%
Applied rewrites67.4%
if 1.52e-86 < l Initial program 65.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.6
Applied rewrites46.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/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
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6469.3
Applied rewrites69.3%
Final simplification67.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (* d l))))
(if (<= l -1.65e+228)
(*
(*
(- 1.0 (/ (* (* D 0.125) (* D (* h (* M M)))) t_0))
(sqrt (* d (/ d (- h)))))
(sqrt (/ -1.0 l)))
(if (<= l -1.85e-67)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(fma (- D) (/ (* (* h 0.125) (* D (* M M))) t_0) 1.0)))
(if (<= l 6.2e-89)
(*
(-
1.0
(* h (/ (* (* M D) (* D (* M 0.5))) (* (* d 2.0) (* l (* d 2.0))))))
(sqrt (/ (/ d h) (/ l d))))
(* d (/ (/ 1.0 (sqrt l)) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * (d * l);
double tmp;
if (l <= -1.65e+228) {
tmp = ((1.0 - (((D * 0.125) * (D * (h * (M * M)))) / t_0)) * sqrt((d * (d / -h)))) * sqrt((-1.0 / l));
} else if (l <= -1.85e-67) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * fma(-D, (((h * 0.125) * (D * (M * M))) / t_0), 1.0));
} else if (l <= 6.2e-89) {
tmp = (1.0 - (h * (((M * D) * (D * (M * 0.5))) / ((d * 2.0) * (l * (d * 2.0)))))) * sqrt(((d / h) / (l / d)));
} else {
tmp = d * ((1.0 / sqrt(l)) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d * Float64(d * l)) tmp = 0.0 if (l <= -1.65e+228) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(D * 0.125) * Float64(D * Float64(h * Float64(M * M)))) / t_0)) * sqrt(Float64(d * Float64(d / Float64(-h))))) * sqrt(Float64(-1.0 / l))); elseif (l <= -1.85e-67) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * fma(Float64(-D), Float64(Float64(Float64(h * 0.125) * Float64(D * Float64(M * M))) / t_0), 1.0))); elseif (l <= 6.2e-89) tmp = Float64(Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(D * Float64(M * 0.5))) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0)))))) * sqrt(Float64(Float64(d / h) / Float64(l / d)))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(l)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.65e+228], N[(N[(N[(1.0 - N[(N[(N[(D * 0.125), $MachinePrecision] * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d * N[(d / (-h)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.85e-67], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[((-D) * N[(N[(N[(h * 0.125), $MachinePrecision] * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.2e-89], N[(N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot \left(d \cdot \ell\right)\\
\mathbf{if}\;\ell \leq -1.65 \cdot 10^{+228}:\\
\;\;\;\;\left(\left(1 - \frac{\left(D \cdot 0.125\right) \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{t\_0}\right) \cdot \sqrt{d \cdot \frac{d}{-h}}\right) \cdot \sqrt{\frac{-1}{\ell}}\\
\mathbf{elif}\;\ell \leq -1.85 \cdot 10^{-67}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(-D, \frac{\left(h \cdot 0.125\right) \cdot \left(D \cdot \left(M \cdot M\right)\right)}{t\_0}, 1\right)\right)\\
\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{-89}:\\
\;\;\;\;\left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(D \cdot \left(M \cdot 0.5\right)\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -1.65000000000000003e228Initial program 44.3%
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-*.f6438.1
Applied rewrites38.1%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-neg.f6468.3
Applied rewrites68.3%
Applied rewrites68.6%
if -1.65000000000000003e228 < l < -1.85e-67Initial program 72.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-*.f6455.1
Applied rewrites55.1%
Applied rewrites58.1%
if -1.85e-67 < l < 6.19999999999999993e-89Initial program 75.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites81.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
metadata-evalN/A
associate-/r/N/A
remove-double-divN/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites82.1%
Applied rewrites64.1%
if 6.19999999999999993e-89 < l Initial program 65.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.6
Applied rewrites46.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/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
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6469.3
Applied rewrites69.3%
Final simplification64.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l 1.35e-86)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(fma (- D) (/ (* (* h 0.125) (* D (* M M))) (* d (* d l))) 1.0)))
(* d (/ (/ 1.0 (sqrt l)) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.35e-86) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * fma(-D, (((h * 0.125) * (D * (M * M))) / (d * (d * l))), 1.0));
} else {
tmp = d * ((1.0 / sqrt(l)) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.35e-86) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * fma(Float64(-D), Float64(Float64(Float64(h * 0.125) * Float64(D * Float64(M * M))) / Float64(d * Float64(d * l))), 1.0))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(l)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.35e-86], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[((-D) * N[(N[(N[(h * 0.125), $MachinePrecision] * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.35 \cdot 10^{-86}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(-D, \frac{\left(h \cdot 0.125\right) \cdot \left(D \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < 1.34999999999999996e-86Initial program 71.6%
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-*.f6456.2
Applied rewrites56.2%
Applied rewrites57.3%
if 1.34999999999999996e-86 < l Initial program 65.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.6
Applied rewrites46.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/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
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f6469.3
Applied rewrites69.3%
Final simplification60.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.1e-145)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= l 2e-309)
(/ d (sqrt (sqrt (* h (* l (* h l))))))
(if (<= l 3.3e-168)
(* (sqrt (/ h (* l (* l l)))) (* (* D D) (* (/ (* M M) d) -0.125)))
(/ (/ d (sqrt h)) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.1e-145) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (l <= 2e-309) {
tmp = d / sqrt(sqrt((h * (l * (h * l)))));
} else if (l <= 3.3e-168) {
tmp = sqrt((h / (l * (l * l)))) * ((D * D) * (((M * M) / d) * -0.125));
} 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 <= (-1.1d-145)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else if (l <= 2d-309) then
tmp = d / sqrt(sqrt((h * (l * (h * l)))))
else if (l <= 3.3d-168) then
tmp = sqrt((h / (l * (l * l)))) * ((d_1 * d_1) * (((m * m) / d) * (-0.125d0)))
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 <= -1.1e-145) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else if (l <= 2e-309) {
tmp = d / Math.sqrt(Math.sqrt((h * (l * (h * l)))));
} else if (l <= 3.3e-168) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((D * D) * (((M * M) / d) * -0.125));
} else {
tmp = (d / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.1e-145: tmp = -d * math.sqrt((1.0 / (h * l))) elif l <= 2e-309: tmp = d / math.sqrt(math.sqrt((h * (l * (h * l))))) elif l <= 3.3e-168: tmp = math.sqrt((h / (l * (l * l)))) * ((D * D) * (((M * M) / d) * -0.125)) else: tmp = (d / math.sqrt(h)) / math.sqrt(l) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.1e-145) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= 2e-309) tmp = Float64(d / sqrt(sqrt(Float64(h * Float64(l * Float64(h * l)))))); elseif (l <= 3.3e-168) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(Float64(M * M) / d) * -0.125))); else tmp = Float64(Float64(d / sqrt(h)) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.1e-145) tmp = -d * sqrt((1.0 / (h * l))); elseif (l <= 2e-309) tmp = d / sqrt(sqrt((h * (l * (h * l))))); elseif (l <= 3.3e-168) tmp = sqrt((h / (l * (l * l)))) * ((D * D) * (((M * M) / d) * -0.125)); else tmp = (d / sqrt(h)) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.1e-145], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2e-309], N[(d / N[Sqrt[N[Sqrt[N[(h * N[(l * N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.3e-168], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{-145}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{-309}:\\
\;\;\;\;\frac{d}{\sqrt{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\
\mathbf{elif}\;\ell \leq 3.3 \cdot 10^{-168}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{M \cdot M}{d} \cdot -0.125\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.1e-145Initial program 67.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-*.f6450.4
Applied rewrites50.4%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6443.5
Applied rewrites43.5%
if -1.1e-145 < l < 1.9999999999999988e-309Initial program 69.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-*.f6462.2
Applied rewrites62.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6416.4
Applied rewrites16.4%
lift-*.f64N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f6416.4
Applied rewrites16.4%
lift-*.f6416.4
/-rgt-identityN/A
clear-numN/A
inv-powN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
lower-sqrt.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
if 1.9999999999999988e-309 < l < 3.3000000000000001e-168Initial program 78.6%
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.3
Applied rewrites50.3%
Taylor expanded in d around 0
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-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6453.8
Applied rewrites53.8%
if 3.3000000000000001e-168 < l Initial program 70.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-*.f6453.9
Applied rewrites53.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
lift-*.f64N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f6452.8
Applied rewrites52.8%
sqrt-prodN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6466.7
Applied rewrites66.7%
Final simplification52.1%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.6e-175) (* (- d) (sqrt (/ 1.0 (* h l)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.6e-175) {
tmp = -d * sqrt((1.0 / (h * l)));
} 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.6d-175) then
tmp = -d * sqrt((1.0d0 / (h * l)))
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.6e-175) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.6e-175: tmp = -d * math.sqrt((1.0 / (h * l))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.6e-175) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); 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.6e-175) tmp = -d * sqrt((1.0 / (h * l))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.6e-175], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $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.6 \cdot 10^{-175}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.6e-175Initial program 69.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-*.f6453.2
Applied rewrites53.2%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 3.6e-175 < l Initial program 70.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-*.f6453.9
Applied rewrites53.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
lift-*.f64N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f6452.8
Applied rewrites52.8%
*-commutativeN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6466.6
Applied rewrites66.6%
Final simplification47.0%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ 1.0 (* h l))))) (if (<= l 3.6e-175) (* (- d) t_0) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double tmp;
if (l <= 3.6e-175) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
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) :: tmp
t_0 = sqrt((1.0d0 / (h * l)))
if (l <= 3.6d-175) then
tmp = -d * t_0
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (h * l)));
double tmp;
if (l <= 3.6e-175) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (h * l))) tmp = 0 if l <= 3.6e-175: tmp = -d * t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) tmp = 0.0 if (l <= 3.6e-175) tmp = Float64(Float64(-d) * t_0); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (h * l))); tmp = 0.0; if (l <= 3.6e-175) tmp = -d * t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3.6e-175], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;\ell \leq 3.6 \cdot 10^{-175}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < 3.6e-175Initial program 69.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-*.f6453.2
Applied rewrites53.2%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 3.6e-175 < l Initial program 70.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-*.f6453.9
Applied rewrites53.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
Final simplification42.0%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ 1.0 (* h l)))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt((1.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 * sqrt((1.0d0 / (h * l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt((1.0 / (h * l)));
}
def code(d, h, l, M, D): return d * math.sqrt((1.0 / (h * l)))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt((1.0 / (h * l))); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{1}{h \cdot \ell}}
\end{array}
Initial program 69.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-*.f6453.4
Applied rewrites53.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.3
Applied rewrites25.3%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((h * l));
}
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((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 69.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-*.f6453.4
Applied rewrites53.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.3
Applied rewrites25.3%
lift-*.f64N/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f6425.3
Applied rewrites25.3%
herbie shell --seed 2024216
(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)))))