
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* 0.5 (* M D)) d)) (t_1 (sqrt (- d))))
(if (<= l -1e-310)
(*
(* (/ t_1 (sqrt (- h))) (* t_1 (sqrt (/ -1.0 l))))
(- 1.0 (* (/ (* h t_0) l) (* 0.5 t_0))))
(if (<= l 1.4e-101)
(/
(*
(- 1.0 (/ (* (* (* h 0.5) (/ (* M D) d)) (* (* M D) 0.25)) (* l d)))
(/ (fabs d) (sqrt h)))
(sqrt l))
(*
(* (/ (sqrt d) (sqrt h)) (/ (sqrt d) (sqrt l)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double t_1 = sqrt(-d);
double tmp;
if (l <= -1e-310) {
tmp = ((t_1 / sqrt(-h)) * (t_1 * sqrt((-1.0 / l)))) * (1.0 - (((h * t_0) / l) * (0.5 * t_0)));
} else if (l <= 1.4e-101) {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (fabs(d) / sqrt(h))) / sqrt(l);
} else {
tmp = ((sqrt(d) / sqrt(h)) * (sqrt(d) / sqrt(l))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.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) :: t_1
real(8) :: tmp
t_0 = (0.5d0 * (m * d_1)) / d
t_1 = sqrt(-d)
if (l <= (-1d-310)) then
tmp = ((t_1 / sqrt(-h)) * (t_1 * sqrt(((-1.0d0) / l)))) * (1.0d0 - (((h * t_0) / l) * (0.5d0 * t_0)))
else if (l <= 1.4d-101) then
tmp = ((1.0d0 - ((((h * 0.5d0) * ((m * d_1) / d)) * ((m * d_1) * 0.25d0)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l)
else
tmp = ((sqrt(d) / sqrt(h)) * (sqrt(d) / sqrt(l))) * (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double t_1 = Math.sqrt(-d);
double tmp;
if (l <= -1e-310) {
tmp = ((t_1 / Math.sqrt(-h)) * (t_1 * Math.sqrt((-1.0 / l)))) * (1.0 - (((h * t_0) / l) * (0.5 * t_0)));
} else if (l <= 1.4e-101) {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (Math.abs(d) / Math.sqrt(h))) / Math.sqrt(l);
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * (Math.sqrt(d) / Math.sqrt(l))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (0.5 * (M * D)) / d t_1 = math.sqrt(-d) tmp = 0 if l <= -1e-310: tmp = ((t_1 / math.sqrt(-h)) * (t_1 * math.sqrt((-1.0 / l)))) * (1.0 - (((h * t_0) / l) * (0.5 * t_0))) elif l <= 1.4e-101: tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (math.fabs(d) / math.sqrt(h))) / math.sqrt(l) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * (math.sqrt(d) / math.sqrt(l))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(0.5 * Float64(M * D)) / d) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -1e-310) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(t_1 * sqrt(Float64(-1.0 / l)))) * Float64(1.0 - Float64(Float64(Float64(h * t_0) / l) * Float64(0.5 * t_0)))); elseif (l <= 1.4e-101) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) / d)) * Float64(Float64(M * D) * 0.25)) / Float64(l * d))) * Float64(abs(d) / sqrt(h))) / sqrt(l)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * Float64(sqrt(d) / sqrt(l))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (0.5 * (M * D)) / d; t_1 = sqrt(-d); tmp = 0.0; if (l <= -1e-310) tmp = ((t_1 / sqrt(-h)) * (t_1 * sqrt((-1.0 / l)))) * (1.0 - (((h * t_0) / l) * (0.5 * t_0))); elseif (l <= 1.4e-101) tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l); else tmp = ((sqrt(d) / sqrt(h)) * (sqrt(d) / sqrt(l))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -1e-310], N[(N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.4e-101], N[(N[(N[(1.0 - N[(N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $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]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.5 \cdot \left(M \cdot D\right)}{d}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-h}} \cdot \left(t\_1 \cdot \sqrt{\frac{-1}{\ell}}\right)\right) \cdot \left(1 - \frac{h \cdot t\_0}{\ell} \cdot \left(0.5 \cdot t\_0\right)\right)\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{-101}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(\left(h \cdot 0.5\right) \cdot \frac{M \cdot D}{d}\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)}{\ell \cdot d}\right) \cdot \frac{\left|d\right|}{\sqrt{h}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\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)\\
\end{array}
\end{array}
if l < -9.999999999999969e-311Initial program 64.2%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f6480.6
Applied egg-rr80.6%
metadata-evalN/A
pow1/2N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6486.8
Applied egg-rr86.8%
if -9.999999999999969e-311 < l < 1.39999999999999995e-101Initial program 64.1%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6466.0
Applied egg-rr66.0%
Applied egg-rr72.4%
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
rem-sqrt-squareN/A
fabs-lowering-fabs.f64N/A
sqrt-lowering-sqrt.f6494.5
Applied egg-rr94.5%
if 1.39999999999999995e-101 < l Initial program 72.3%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6477.9
Applied egg-rr77.9%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6486.2
Applied egg-rr86.2%
Final simplification87.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(/ (* (sqrt h) (* (* M (* M D)) (* D -0.125))) (* d (* l (sqrt l)))))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))))))
(if (<= t_1 -1e-125)
t_0
(if (<= t_1 0.0)
(* (- d) (sqrt (/ 1.0 (* l h))))
(if (<= t_1 INFINITY) (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d)))) t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt(h) * ((M * (M * D)) * (D * -0.125))) / (d * (l * sqrt(l)));
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= -1e-125) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = -d * sqrt((1.0 / (l * h)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.sqrt(h) * ((M * (M * D)) * (D * -0.125))) / (d * (l * Math.sqrt(l)));
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= -1e-125) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.sqrt(h) * ((M * (M * D)) * (D * -0.125))) / (d * (l * math.sqrt(l))) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) tmp = 0 if t_1 <= -1e-125: tmp = t_0 elif t_1 <= 0.0: tmp = -d * math.sqrt((1.0 / (l * h))) elif t_1 <= math.inf: tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) else: tmp = t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(h) * Float64(Float64(M * Float64(M * D)) * Float64(D * -0.125))) / Float64(d * Float64(l * sqrt(l)))) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= -1e-125) tmp = t_0; elseif (t_1 <= 0.0) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = t_0; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (sqrt(h) * ((M * (M * D)) * (D * -0.125))) / (d * (l * sqrt(l))); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))); tmp = 0.0; if (t_1 <= -1e-125) tmp = t_0; elseif (t_1 <= 0.0) tmp = -d * sqrt((1.0 / (l * h))); elseif (t_1 <= Inf) tmp = sqrt((d / l)) * (1.0 / sqrt((h / d))); else tmp = t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[h], $MachinePrecision] * N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-125], t$95$0, If[LessEqual[t$95$1, 0.0], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{h} \cdot \left(\left(M \cdot \left(M \cdot D\right)\right) \cdot \left(D \cdot -0.125\right)\right)}{d \cdot \left(\ell \cdot \sqrt{\ell}\right)}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-125}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.00000000000000001e-125 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.5%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6433.9
Applied egg-rr33.9%
Applied egg-rr33.7%
Taylor expanded in h around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6431.6
Simplified31.6%
*-commutativeN/A
associate-*r/N/A
sqrt-divN/A
frac-timesN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
sqrt-prodN/A
Applied egg-rr36.8%
if -1.00000000000000001e-125 < (*.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)))) < 0.0Initial program 47.4%
unpow2N/A
clear-numN/A
un-div-invN/A
*-commutativeN/A
times-fracN/A
*-commutativeN/A
associate-/l*N/A
times-fracN/A
associate-/r*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6440.5
Applied egg-rr40.5%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6466.9
Simplified66.9%
if 0.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 82.7%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr82.7%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6482.7
Applied egg-rr82.7%
metadata-evalN/A
unpow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6483.1
Applied egg-rr83.1%
Taylor expanded in M around 0
Simplified83.1%
Final simplification57.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (/ (* M (* D (* M D))) (* d -8.0)) (* l (sqrt (/ l h)))))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))))))
(if (<= t_1 0.0)
t_0
(if (<= t_1 INFINITY) (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d)))) t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * (D * (M * D))) / (d * -8.0)) / (l * sqrt((l / h)));
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * (D * (M * D))) / (d * -8.0)) / (l * Math.sqrt((l / h)));
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = ((M * (D * (M * D))) / (d * -8.0)) / (l * math.sqrt((l / h))) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) tmp = 0 if t_1 <= 0.0: tmp = t_0 elif t_1 <= math.inf: tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) else: tmp = t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(d * -8.0)) / Float64(l * sqrt(Float64(l / h)))) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = t_0; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * (D * (M * D))) / (d * -8.0)) / (l * sqrt((l / h))); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))); tmp = 0.0; if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= Inf) tmp = sqrt((d / l)) * (1.0 / sqrt((h / d))); else tmp = t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * -8.0), $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot -8}}{\ell \cdot \sqrt{\frac{\ell}{h}}}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 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 57.1%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6433.4
Applied egg-rr33.4%
Applied egg-rr33.2%
Taylor expanded in h around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6433.0
Simplified33.0%
*-commutativeN/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr66.5%
if 0.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 82.7%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr82.7%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6482.7
Applied egg-rr82.7%
metadata-evalN/A
unpow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6483.1
Applied egg-rr83.1%
Taylor expanded in M around 0
Simplified83.1%
Final simplification72.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ (sqrt (/ h l)) l) (* (* D (* D (* M M))) (/ -0.125 d))))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))))))
(if (<= t_1 0.0)
t_0
(if (<= t_1 INFINITY) (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d)))) t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((h / l)) / l) * ((D * (D * (M * M))) * (-0.125 / d));
double t_1 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.sqrt((h / l)) / l) * ((D * (D * (M * M))) * (-0.125 / d));
double t_1 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.sqrt((h / l)) / l) * ((D * (D * (M * M))) * (-0.125 / d)) t_1 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) tmp = 0 if t_1 <= 0.0: tmp = t_0 elif t_1 <= math.inf: tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) else: tmp = t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(Float64(h / l)) / l) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(-0.125 / d))) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = t_0; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (sqrt((h / l)) / l) * ((D * (D * (M * M))) * (-0.125 / d)); t_1 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))); tmp = 0.0; if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= Inf) tmp = sqrt((d / l)) * (1.0 / sqrt((h / d))); else tmp = t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / l), $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{\frac{h}{\ell}}}{\ell} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 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 57.1%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6433.4
Applied egg-rr33.4%
Applied egg-rr33.2%
Taylor expanded in h around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6433.0
Simplified33.0%
associate-/r*N/A
sqrt-divN/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6460.0
Applied egg-rr60.0%
if 0.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 82.7%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr82.7%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6482.7
Applied egg-rr82.7%
metadata-evalN/A
unpow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6483.1
Applied egg-rr83.1%
Taylor expanded in M around 0
Simplified83.1%
Final simplification68.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* 0.5 (* M D)) d))
(t_1 (- 1.0 (* (/ (* h t_0) l) (* 0.5 t_0))))
(t_2 (sqrt (- d))))
(if (<= h -2e-310)
(* (* (/ t_2 (sqrt (- h))) (* t_2 (sqrt (/ -1.0 l)))) t_1)
(if (<= h 7.2e-88)
(* t_1 (* (* (sqrt d) (/ 1.0 (sqrt h))) (sqrt (/ d l))))
(/
(*
(- 1.0 (/ (* (* (* h 0.5) (/ (* M D) d)) (* (* M D) 0.25)) (* l d)))
(/ (fabs d) (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double t_1 = 1.0 - (((h * t_0) / l) * (0.5 * t_0));
double t_2 = sqrt(-d);
double tmp;
if (h <= -2e-310) {
tmp = ((t_2 / sqrt(-h)) * (t_2 * sqrt((-1.0 / l)))) * t_1;
} else if (h <= 7.2e-88) {
tmp = t_1 * ((sqrt(d) * (1.0 / sqrt(h))) * sqrt((d / l)));
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (fabs(d) / sqrt(h))) / sqrt(l);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (0.5d0 * (m * d_1)) / d
t_1 = 1.0d0 - (((h * t_0) / l) * (0.5d0 * t_0))
t_2 = sqrt(-d)
if (h <= (-2d-310)) then
tmp = ((t_2 / sqrt(-h)) * (t_2 * sqrt(((-1.0d0) / l)))) * t_1
else if (h <= 7.2d-88) then
tmp = t_1 * ((sqrt(d) * (1.0d0 / sqrt(h))) * sqrt((d / l)))
else
tmp = ((1.0d0 - ((((h * 0.5d0) * ((m * d_1) / d)) * ((m * d_1) * 0.25d0)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double t_1 = 1.0 - (((h * t_0) / l) * (0.5 * t_0));
double t_2 = Math.sqrt(-d);
double tmp;
if (h <= -2e-310) {
tmp = ((t_2 / Math.sqrt(-h)) * (t_2 * Math.sqrt((-1.0 / l)))) * t_1;
} else if (h <= 7.2e-88) {
tmp = t_1 * ((Math.sqrt(d) * (1.0 / Math.sqrt(h))) * Math.sqrt((d / l)));
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (Math.abs(d) / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (0.5 * (M * D)) / d t_1 = 1.0 - (((h * t_0) / l) * (0.5 * t_0)) t_2 = math.sqrt(-d) tmp = 0 if h <= -2e-310: tmp = ((t_2 / math.sqrt(-h)) * (t_2 * math.sqrt((-1.0 / l)))) * t_1 elif h <= 7.2e-88: tmp = t_1 * ((math.sqrt(d) * (1.0 / math.sqrt(h))) * math.sqrt((d / l))) else: tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (math.fabs(d) / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(0.5 * Float64(M * D)) / d) t_1 = Float64(1.0 - Float64(Float64(Float64(h * t_0) / l) * Float64(0.5 * t_0))) t_2 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -2e-310) tmp = Float64(Float64(Float64(t_2 / sqrt(Float64(-h))) * Float64(t_2 * sqrt(Float64(-1.0 / l)))) * t_1); elseif (h <= 7.2e-88) tmp = Float64(t_1 * Float64(Float64(sqrt(d) * Float64(1.0 / sqrt(h))) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) / d)) * Float64(Float64(M * D) * 0.25)) / Float64(l * d))) * Float64(abs(d) / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (0.5 * (M * D)) / d; t_1 = 1.0 - (((h * t_0) / l) * (0.5 * t_0)); t_2 = sqrt(-d); tmp = 0.0; if (h <= -2e-310) tmp = ((t_2 / sqrt(-h)) * (t_2 * sqrt((-1.0 / l)))) * t_1; elseif (h <= 7.2e-88) tmp = t_1 * ((sqrt(d) * (1.0 / sqrt(h))) * sqrt((d / l))); else tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -2e-310], N[(N[(N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[h, 7.2e-88], N[(t$95$1 * N[(N[(N[Sqrt[d], $MachinePrecision] * N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.5 \cdot \left(M \cdot D\right)}{d}\\
t_1 := 1 - \frac{h \cdot t\_0}{\ell} \cdot \left(0.5 \cdot t\_0\right)\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t\_2}{\sqrt{-h}} \cdot \left(t\_2 \cdot \sqrt{\frac{-1}{\ell}}\right)\right) \cdot t\_1\\
\mathbf{elif}\;h \leq 7.2 \cdot 10^{-88}:\\
\;\;\;\;t\_1 \cdot \left(\left(\sqrt{d} \cdot \frac{1}{\sqrt{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(\left(h \cdot 0.5\right) \cdot \frac{M \cdot D}{d}\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)}{\ell \cdot d}\right) \cdot \frac{\left|d\right|}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 64.2%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f6480.6
Applied egg-rr80.6%
metadata-evalN/A
pow1/2N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6486.8
Applied egg-rr86.8%
if -1.999999999999994e-310 < h < 7.1999999999999999e-88Initial program 71.5%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr79.2%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6479.2
Applied egg-rr79.2%
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f6492.8
Applied egg-rr92.8%
if 7.1999999999999999e-88 < h Initial program 68.5%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6474.3
Applied egg-rr74.3%
Applied egg-rr62.6%
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
rem-sqrt-squareN/A
fabs-lowering-fabs.f64N/A
sqrt-lowering-sqrt.f6484.3
Applied egg-rr84.3%
Final simplification87.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (/ (* 0.5 (* M D)) d))
(t_2 (- 1.0 (* (/ (* h t_1) l) (* 0.5 t_1)))))
(if (<= h -2e-310)
(* t_2 (* (/ (sqrt (- d)) (sqrt (- h))) t_0))
(if (<= h 8.8e-88)
(* t_2 (* (* (sqrt d) (/ 1.0 (sqrt h))) t_0))
(/
(*
(- 1.0 (/ (* (* (* h 0.5) (/ (* M D) d)) (* (* M D) 0.25)) (* l d)))
(/ (fabs d) (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (0.5 * (M * D)) / d;
double t_2 = 1.0 - (((h * t_1) / l) * (0.5 * t_1));
double tmp;
if (h <= -2e-310) {
tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * t_0);
} else if (h <= 8.8e-88) {
tmp = t_2 * ((sqrt(d) * (1.0 / sqrt(h))) * t_0);
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (fabs(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 = sqrt((d / l))
t_1 = (0.5d0 * (m * d_1)) / d
t_2 = 1.0d0 - (((h * t_1) / l) * (0.5d0 * t_1))
if (h <= (-2d-310)) then
tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * t_0)
else if (h <= 8.8d-88) then
tmp = t_2 * ((sqrt(d) * (1.0d0 / sqrt(h))) * t_0)
else
tmp = ((1.0d0 - ((((h * 0.5d0) * ((m * d_1) / d)) * ((m * d_1) * 0.25d0)) / (l * d))) * (abs(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 / l));
double t_1 = (0.5 * (M * D)) / d;
double t_2 = 1.0 - (((h * t_1) / l) * (0.5 * t_1));
double tmp;
if (h <= -2e-310) {
tmp = t_2 * ((Math.sqrt(-d) / Math.sqrt(-h)) * t_0);
} else if (h <= 8.8e-88) {
tmp = t_2 * ((Math.sqrt(d) * (1.0 / Math.sqrt(h))) * t_0);
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (Math.abs(d) / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (0.5 * (M * D)) / d t_2 = 1.0 - (((h * t_1) / l) * (0.5 * t_1)) tmp = 0 if h <= -2e-310: tmp = t_2 * ((math.sqrt(-d) / math.sqrt(-h)) * t_0) elif h <= 8.8e-88: tmp = t_2 * ((math.sqrt(d) * (1.0 / math.sqrt(h))) * t_0) else: tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (math.fabs(d) / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64(0.5 * Float64(M * D)) / d) t_2 = Float64(1.0 - Float64(Float64(Float64(h * t_1) / l) * Float64(0.5 * t_1))) tmp = 0.0 if (h <= -2e-310) tmp = Float64(t_2 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0)); elseif (h <= 8.8e-88) tmp = Float64(t_2 * Float64(Float64(sqrt(d) * Float64(1.0 / sqrt(h))) * t_0)); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) / d)) * Float64(Float64(M * D) * 0.25)) / Float64(l * d))) * Float64(abs(d) / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (0.5 * (M * D)) / d; t_2 = 1.0 - (((h * t_1) / l) * (0.5 * t_1)); tmp = 0.0; if (h <= -2e-310) tmp = t_2 * ((sqrt(-d) / sqrt(-h)) * t_0); elseif (h <= 8.8e-88) tmp = t_2 * ((sqrt(d) * (1.0 / sqrt(h))) * t_0); else tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(N[(N[(h * t$95$1), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -2e-310], N[(t$95$2 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 8.8e-88], N[(t$95$2 * N[(N[(N[Sqrt[d], $MachinePrecision] * N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \frac{0.5 \cdot \left(M \cdot D\right)}{d}\\
t_2 := 1 - \frac{h \cdot t\_1}{\ell} \cdot \left(0.5 \cdot t\_1\right)\\
\mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_2 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t\_0\right)\\
\mathbf{elif}\;h \leq 8.8 \cdot 10^{-88}:\\
\;\;\;\;t\_2 \cdot \left(\left(\sqrt{d} \cdot \frac{1}{\sqrt{h}}\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(\left(h \cdot 0.5\right) \cdot \frac{M \cdot D}{d}\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)}{\ell \cdot d}\right) \cdot \frac{\left|d\right|}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 64.2%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6468.1
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f6480.6
Applied egg-rr80.6%
if -1.999999999999994e-310 < h < 8.8000000000000002e-88Initial program 71.5%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr79.2%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6479.2
Applied egg-rr79.2%
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f6492.8
Applied egg-rr92.8%
if 8.8000000000000002e-88 < h Initial program 68.5%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6474.3
Applied egg-rr74.3%
Applied egg-rr62.6%
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
rem-sqrt-squareN/A
fabs-lowering-fabs.f64N/A
sqrt-lowering-sqrt.f6484.3
Applied egg-rr84.3%
Final simplification84.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* 0.5 (* M D)) d)))
(if (<= l -1e-310)
(*
(- 1.0 (* (/ (* h t_0) l) (* 0.5 t_0)))
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))))
(/
(*
(- 1.0 (/ (* (* (* h 0.5) (/ (* M D) d)) (* (* M D) 0.25)) (* l d)))
(/ (fabs d) (sqrt h)))
(sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double tmp;
if (l <= -1e-310) {
tmp = (1.0 - (((h * t_0) / l) * (0.5 * t_0))) * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)));
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (fabs(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 = (0.5d0 * (m * d_1)) / d
if (l <= (-1d-310)) then
tmp = (1.0d0 - (((h * t_0) / l) * (0.5d0 * t_0))) * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l)))
else
tmp = ((1.0d0 - ((((h * 0.5d0) * ((m * d_1) / d)) * ((m * d_1) * 0.25d0)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double tmp;
if (l <= -1e-310) {
tmp = (1.0 - (((h * t_0) / l) * (0.5 * t_0))) * ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l)));
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (Math.abs(d) / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (0.5 * (M * D)) / d tmp = 0 if l <= -1e-310: tmp = (1.0 - (((h * t_0) / l) * (0.5 * t_0))) * ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) else: tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (math.fabs(d) / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(0.5 * Float64(M * D)) / d) tmp = 0.0 if (l <= -1e-310) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(h * t_0) / l) * Float64(0.5 * t_0))) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) / d)) * Float64(Float64(M * D) * 0.25)) / Float64(l * d))) * Float64(abs(d) / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (0.5 * (M * D)) / d; tmp = 0.0; if (l <= -1e-310) tmp = (1.0 - (((h * t_0) / l) * (0.5 * t_0))) * ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))); else tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[l, -1e-310], N[(N[(1.0 - N[(N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.5 \cdot \left(M \cdot D\right)}{d}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - \frac{h \cdot t\_0}{\ell} \cdot \left(0.5 \cdot t\_0\right)\right) \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(\left(h \cdot 0.5\right) \cdot \frac{M \cdot D}{d}\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)}{\ell \cdot d}\right) \cdot \frac{\left|d\right|}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -9.999999999999969e-311Initial program 64.2%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6468.1
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f6480.6
Applied egg-rr80.6%
if -9.999999999999969e-311 < l Initial program 69.6%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6474.0
Applied egg-rr74.0%
Applied egg-rr63.0%
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
rem-sqrt-squareN/A
fabs-lowering-fabs.f64N/A
sqrt-lowering-sqrt.f6484.3
Applied egg-rr84.3%
Final simplification82.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))) (t_1 (/ (* 0.5 (* M D)) d)))
(if (<= h -3.9e+151)
(*
(* (/ t_0 (sqrt (- h))) (/ t_0 (sqrt (- l))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))
(if (<= h -2e-310)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (* (/ (* h t_1) l) (* 0.5 t_1)) -1.0))
(/
(*
(- 1.0 (/ (* (* (* h 0.5) (/ (* M D) d)) (* (* M D) 0.25)) (* l d)))
(/ (fabs d) (sqrt h)))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = (0.5 * (M * D)) / d;
double tmp;
if (h <= -3.9e+151) {
tmp = ((t_0 / sqrt(-h)) * (t_0 / sqrt(-l))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else if (h <= -2e-310) {
tmp = (d * sqrt((1.0 / (l * h)))) * ((((h * t_1) / l) * (0.5 * t_1)) + -1.0);
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (fabs(d) / sqrt(h))) / sqrt(l);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt(-d)
t_1 = (0.5d0 * (m * d_1)) / d
if (h <= (-3.9d+151)) then
tmp = ((t_0 / sqrt(-h)) * (t_0 / sqrt(-l))) * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (l * d))))
else if (h <= (-2d-310)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * ((((h * t_1) / l) * (0.5d0 * t_1)) + (-1.0d0))
else
tmp = ((1.0d0 - ((((h * 0.5d0) * ((m * d_1) / d)) * ((m * d_1) * 0.25d0)) / (l * d))) * (abs(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);
double t_1 = (0.5 * (M * D)) / d;
double tmp;
if (h <= -3.9e+151) {
tmp = ((t_0 / Math.sqrt(-h)) * (t_0 / Math.sqrt(-l))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else if (h <= -2e-310) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * ((((h * t_1) / l) * (0.5 * t_1)) + -1.0);
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (Math.abs(d) / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = (0.5 * (M * D)) / d tmp = 0 if h <= -3.9e+151: tmp = ((t_0 / math.sqrt(-h)) * (t_0 / math.sqrt(-l))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) elif h <= -2e-310: tmp = (d * math.sqrt((1.0 / (l * h)))) * ((((h * t_1) / l) * (0.5 * t_1)) + -1.0) else: tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (math.fabs(d) / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(Float64(0.5 * Float64(M * D)) / d) tmp = 0.0 if (h <= -3.9e+151) tmp = Float64(Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(t_0 / sqrt(Float64(-l)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(Float64(h * t_1) / l) * Float64(0.5 * t_1)) + -1.0)); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) / d)) * Float64(Float64(M * D) * 0.25)) / Float64(l * d))) * Float64(abs(d) / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = (0.5 * (M * D)) / d; tmp = 0.0; if (h <= -3.9e+151) tmp = ((t_0 / sqrt(-h)) * (t_0 / sqrt(-l))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))); elseif (h <= -2e-310) tmp = (d * sqrt((1.0 / (l * h)))) * ((((h * t_1) / l) * (0.5 * t_1)) + -1.0); else tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[h, -3.9e+151], N[(N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $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[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(h * t$95$1), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := \frac{0.5 \cdot \left(M \cdot D\right)}{d}\\
\mathbf{if}\;h \leq -3.9 \cdot 10^{+151}:\\
\;\;\;\;\left(\frac{t\_0}{\sqrt{-h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\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(\ell \cdot d\right)}\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot t\_1}{\ell} \cdot \left(0.5 \cdot t\_1\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(\left(h \cdot 0.5\right) \cdot \frac{M \cdot D}{d}\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)}{\ell \cdot d}\right) \cdot \frac{\left|d\right|}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -3.89999999999999976e151Initial program 53.4%
Taylor expanded in M around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6451.6
Simplified51.6%
metadata-evalN/A
unpow1/2N/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f6451.6
Applied egg-rr51.6%
metadata-evalN/A
unpow1/2N/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f6468.6
Applied egg-rr68.6%
if -3.89999999999999976e151 < h < -1.999999999999994e-310Initial program 68.8%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr73.2%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6473.2
Applied egg-rr73.2%
metadata-evalN/A
unpow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6472.7
Applied egg-rr72.7%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6485.7
Simplified85.7%
if -1.999999999999994e-310 < h Initial program 69.6%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6474.0
Applied egg-rr74.0%
Applied egg-rr63.0%
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
rem-sqrt-squareN/A
fabs-lowering-fabs.f64N/A
sqrt-lowering-sqrt.f6484.3
Applied egg-rr84.3%
Final simplification82.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* M D)))
(t_1 (/ t_0 d))
(t_2 (* (/ (* h t_1) l) (* 0.5 t_1)))
(t_3 (* d (sqrt (/ 1.0 (* l h)))))
(t_4 (* (- 1.0 t_2) t_3)))
(if (<= d -2e-310)
(* t_3 (+ t_2 -1.0))
(if (<= d 4e-69)
t_4
(if (<= d 4.7e+148)
(/
(*
(/ (fabs d) (sqrt h))
(- 1.0 (/ (* (* h t_0) (* M (* D 0.25))) (* l (* d d)))))
(sqrt l))
t_4)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = t_0 / d;
double t_2 = ((h * t_1) / l) * (0.5 * t_1);
double t_3 = d * sqrt((1.0 / (l * h)));
double t_4 = (1.0 - t_2) * t_3;
double tmp;
if (d <= -2e-310) {
tmp = t_3 * (t_2 + -1.0);
} else if (d <= 4e-69) {
tmp = t_4;
} else if (d <= 4.7e+148) {
tmp = ((fabs(d) / sqrt(h)) * (1.0 - (((h * t_0) * (M * (D * 0.25))) / (l * (d * d))))) / sqrt(l);
} else {
tmp = t_4;
}
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) :: t_4
real(8) :: tmp
t_0 = 0.5d0 * (m * d_1)
t_1 = t_0 / d
t_2 = ((h * t_1) / l) * (0.5d0 * t_1)
t_3 = d * sqrt((1.0d0 / (l * h)))
t_4 = (1.0d0 - t_2) * t_3
if (d <= (-2d-310)) then
tmp = t_3 * (t_2 + (-1.0d0))
else if (d <= 4d-69) then
tmp = t_4
else if (d <= 4.7d+148) then
tmp = ((abs(d) / sqrt(h)) * (1.0d0 - (((h * t_0) * (m * (d_1 * 0.25d0))) / (l * (d * d))))) / sqrt(l)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (M * D);
double t_1 = t_0 / d;
double t_2 = ((h * t_1) / l) * (0.5 * t_1);
double t_3 = d * Math.sqrt((1.0 / (l * h)));
double t_4 = (1.0 - t_2) * t_3;
double tmp;
if (d <= -2e-310) {
tmp = t_3 * (t_2 + -1.0);
} else if (d <= 4e-69) {
tmp = t_4;
} else if (d <= 4.7e+148) {
tmp = ((Math.abs(d) / Math.sqrt(h)) * (1.0 - (((h * t_0) * (M * (D * 0.25))) / (l * (d * d))))) / Math.sqrt(l);
} else {
tmp = t_4;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (M * D) t_1 = t_0 / d t_2 = ((h * t_1) / l) * (0.5 * t_1) t_3 = d * math.sqrt((1.0 / (l * h))) t_4 = (1.0 - t_2) * t_3 tmp = 0 if d <= -2e-310: tmp = t_3 * (t_2 + -1.0) elif d <= 4e-69: tmp = t_4 elif d <= 4.7e+148: tmp = ((math.fabs(d) / math.sqrt(h)) * (1.0 - (((h * t_0) * (M * (D * 0.25))) / (l * (d * d))))) / math.sqrt(l) else: tmp = t_4 return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(M * D)) t_1 = Float64(t_0 / d) t_2 = Float64(Float64(Float64(h * t_1) / l) * Float64(0.5 * t_1)) t_3 = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) t_4 = Float64(Float64(1.0 - t_2) * t_3) tmp = 0.0 if (d <= -2e-310) tmp = Float64(t_3 * Float64(t_2 + -1.0)); elseif (d <= 4e-69) tmp = t_4; elseif (d <= 4.7e+148) tmp = Float64(Float64(Float64(abs(d) / sqrt(h)) * Float64(1.0 - Float64(Float64(Float64(h * t_0) * Float64(M * Float64(D * 0.25))) / Float64(l * Float64(d * d))))) / sqrt(l)); else tmp = t_4; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (M * D); t_1 = t_0 / d; t_2 = ((h * t_1) / l) * (0.5 * t_1); t_3 = d * sqrt((1.0 / (l * h))); t_4 = (1.0 - t_2) * t_3; tmp = 0.0; if (d <= -2e-310) tmp = t_3 * (t_2 + -1.0); elseif (d <= 4e-69) tmp = t_4; elseif (d <= 4.7e+148) tmp = ((abs(d) / sqrt(h)) * (1.0 - (((h * t_0) * (M * (D * 0.25))) / (l * (d * d))))) / sqrt(l); else tmp = t_4; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / d), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(h * t$95$1), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(1.0 - t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision]}, If[LessEqual[d, -2e-310], N[(t$95$3 * N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4e-69], t$95$4, If[LessEqual[d, 4.7e+148], N[(N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(h * t$95$0), $MachinePrecision] * N[(M * N[(D * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(M \cdot D\right)\\
t_1 := \frac{t\_0}{d}\\
t_2 := \frac{h \cdot t\_1}{\ell} \cdot \left(0.5 \cdot t\_1\right)\\
t_3 := d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
t_4 := \left(1 - t\_2\right) \cdot t\_3\\
\mathbf{if}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_3 \cdot \left(t\_2 + -1\right)\\
\mathbf{elif}\;d \leq 4 \cdot 10^{-69}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;d \leq 4.7 \cdot 10^{+148}:\\
\;\;\;\;\frac{\frac{\left|d\right|}{\sqrt{h}} \cdot \left(1 - \frac{\left(h \cdot t\_0\right) \cdot \left(M \cdot \left(D \cdot 0.25\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if d < -1.999999999999994e-310Initial program 64.2%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6468.1
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6467.8
Applied egg-rr67.8%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6477.1
Simplified77.1%
if -1.999999999999994e-310 < d < 3.9999999999999999e-69 or 4.6999999999999997e148 < d Initial program 68.6%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr73.0%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6473.0
Applied egg-rr73.0%
metadata-evalN/A
unpow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6473.0
Applied egg-rr73.0%
Taylor expanded in h around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6479.2
Simplified79.2%
if 3.9999999999999999e-69 < d < 4.6999999999999997e148Initial program 71.4%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6473.4
Applied egg-rr73.4%
Applied egg-rr71.2%
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
rem-sqrt-squareN/A
fabs-lowering-fabs.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
associate-/l*N/A
associate-*r/N/A
frac-timesN/A
/-lowering-/.f64N/A
Applied egg-rr86.8%
Final simplification79.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* 0.5 (* M D)) d)))
(if (<= h -2e-310)
(* (* d (sqrt (/ 1.0 (* l h)))) (+ (* (/ (* h t_0) l) (* 0.5 t_0)) -1.0))
(/
(*
(- 1.0 (/ (* (* (* h 0.5) (/ (* M D) d)) (* (* M D) 0.25)) (* l d)))
(/ (fabs d) (sqrt h)))
(sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double tmp;
if (h <= -2e-310) {
tmp = (d * sqrt((1.0 / (l * h)))) * ((((h * t_0) / l) * (0.5 * t_0)) + -1.0);
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (fabs(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 = (0.5d0 * (m * d_1)) / d
if (h <= (-2d-310)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * ((((h * t_0) / l) * (0.5d0 * t_0)) + (-1.0d0))
else
tmp = ((1.0d0 - ((((h * 0.5d0) * ((m * d_1) / d)) * ((m * d_1) * 0.25d0)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (0.5 * (M * D)) / d;
double tmp;
if (h <= -2e-310) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * ((((h * t_0) / l) * (0.5 * t_0)) + -1.0);
} else {
tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (Math.abs(d) / Math.sqrt(h))) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (0.5 * (M * D)) / d tmp = 0 if h <= -2e-310: tmp = (d * math.sqrt((1.0 / (l * h)))) * ((((h * t_0) / l) * (0.5 * t_0)) + -1.0) else: tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (math.fabs(d) / math.sqrt(h))) / math.sqrt(l) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(0.5 * Float64(M * D)) / d) tmp = 0.0 if (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(Float64(h * t_0) / l) * Float64(0.5 * t_0)) + -1.0)); else tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) / d)) * Float64(Float64(M * D) * 0.25)) / Float64(l * d))) * Float64(abs(d) / sqrt(h))) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (0.5 * (M * D)) / d; tmp = 0.0; if (h <= -2e-310) tmp = (d * sqrt((1.0 / (l * h)))) * ((((h * t_0) / l) * (0.5 * t_0)) + -1.0); else tmp = ((1.0 - ((((h * 0.5) * ((M * D) / d)) * ((M * D) * 0.25)) / (l * d))) * (abs(d) / sqrt(h))) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.5 \cdot \left(M \cdot D\right)}{d}\\
\mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot t\_0}{\ell} \cdot \left(0.5 \cdot t\_0\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(\left(h \cdot 0.5\right) \cdot \frac{M \cdot D}{d}\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)}{\ell \cdot d}\right) \cdot \frac{\left|d\right|}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 64.2%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6468.1
Applied egg-rr68.1%
metadata-evalN/A
unpow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6467.8
Applied egg-rr67.8%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6477.1
Simplified77.1%
if -1.999999999999994e-310 < h Initial program 69.6%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6474.0
Applied egg-rr74.0%
Applied egg-rr63.0%
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
rem-sqrt-squareN/A
fabs-lowering-fabs.f64N/A
sqrt-lowering-sqrt.f6484.3
Applied egg-rr84.3%
Final simplification80.8%
(FPCore (d h l M D)
:precision binary64
(if (<= h -4.7e+140)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= h 1.65e-308)
(* (- d) (sqrt (/ 1.0 (* l h))))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.7e+140) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (h <= 1.65e-308) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-4.7d+140)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (h <= 1.65d-308) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.7e+140) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (h <= 1.65e-308) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -4.7e+140: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif h <= 1.65e-308: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -4.7e+140) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (h <= 1.65e-308) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -4.7e+140) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (h <= 1.65e-308) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -4.7e+140], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.65e-308], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -4.7 \cdot 10^{+140}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;h \leq 1.65 \cdot 10^{-308}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if h < -4.7000000000000003e140Initial program 56.6%
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr59.1%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6459.1
Applied egg-rr59.1%
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6459.1
Applied egg-rr59.1%
Taylor expanded in M around 0
Simplified34.4%
if -4.7000000000000003e140 < h < 1.6499999999999999e-308Initial program 67.9%
unpow2N/A
clear-numN/A
un-div-invN/A
*-commutativeN/A
times-fracN/A
*-commutativeN/A
associate-/l*N/A
times-fracN/A
associate-/r*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6464.2
Applied egg-rr64.2%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6451.2
Simplified51.2%
if 1.6499999999999999e-308 < h Initial program 69.6%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6474.0
Applied egg-rr74.0%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6438.7
Simplified38.7%
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6438.8
Applied egg-rr38.8%
*-commutativeN/A
sqrt-prodN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6448.7
Applied egg-rr48.7%
Final simplification47.2%
(FPCore (d h l M D) :precision binary64 (if (<= l 2.5e-221) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.5e-221) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 2.5d-221) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.5e-221) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.5e-221: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.5e-221) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.5e-221) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.5e-221], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.5 \cdot 10^{-221}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 2.49999999999999998e-221Initial program 65.7%
unpow2N/A
clear-numN/A
un-div-invN/A
*-commutativeN/A
times-fracN/A
*-commutativeN/A
associate-/l*N/A
times-fracN/A
associate-/r*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6461.5
Applied egg-rr61.5%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6441.2
Simplified41.2%
if 2.49999999999999998e-221 < l Initial program 68.7%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6473.9
Applied egg-rr73.9%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6440.2
Simplified40.2%
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6440.3
Applied egg-rr40.3%
*-commutativeN/A
sqrt-prodN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6451.2
Applied egg-rr51.2%
Final simplification45.6%
(FPCore (d h l M D) :precision binary64 (if (<= l 7.6e-222) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 7.6e-222) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 7.6d-222) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 7.6e-222) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 7.6e-222: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 7.6e-222) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 7.6e-222) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 7.6e-222], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7.6 \cdot 10^{-222}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < 7.59999999999999993e-222Initial program 65.7%
unpow2N/A
clear-numN/A
un-div-invN/A
*-commutativeN/A
times-fracN/A
*-commutativeN/A
associate-/l*N/A
times-fracN/A
associate-/r*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6461.5
Applied egg-rr61.5%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6441.2
Simplified41.2%
if 7.59999999999999993e-222 < l Initial program 68.7%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6473.9
Applied egg-rr73.9%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6440.2
Simplified40.2%
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6440.3
Applied egg-rr40.3%
Final simplification40.8%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 67.0%
metadata-evalN/A
unpow1/2N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6438.2
Applied egg-rr38.2%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6425.1
Simplified25.1%
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6425.2
Applied egg-rr25.2%
Final simplification25.2%
herbie shell --seed 2024198
(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)))))