
(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 29 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}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0))))))
(t_1 (sqrt (/ d l)))
(t_2 (sqrt (/ d h))))
(if (<= t_0 -1e-118)
(*
(- 1.0 (pow (* (* D (* 0.5 (/ M d))) (sqrt (* h (/ 0.5 l)))) 2.0))
(* t_1 t_2))
(if (or (<= t_0 0.0) (not (<= t_0 1e+292)))
(fabs (/ d (sqrt (* l h))))
(*
t_1
(*
t_2
(+ 1.0 (* -0.5 (* (/ h l) (pow (* (/ M d) (* 0.5 D)) 2.0))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))));
double t_1 = sqrt((d / l));
double t_2 = sqrt((d / h));
double tmp;
if (t_0 <= -1e-118) {
tmp = (1.0 - pow(((D * (0.5 * (M / d))) * sqrt((h * (0.5 / l)))), 2.0)) * (t_1 * t_2);
} else if ((t_0 <= 0.0) || !(t_0 <= 1e+292)) {
tmp = fabs((d / sqrt((l * h))));
} else {
tmp = t_1 * (t_2 * (1.0 + (-0.5 * ((h / l) * pow(((M / d) * (0.5 * D)), 2.0)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))
t_1 = sqrt((d / l))
t_2 = sqrt((d / h))
if (t_0 <= (-1d-118)) then
tmp = (1.0d0 - (((d_1 * (0.5d0 * (m / d))) * sqrt((h * (0.5d0 / l)))) ** 2.0d0)) * (t_1 * t_2)
else if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+292))) then
tmp = abs((d / sqrt((l * h))))
else
tmp = t_1 * (t_2 * (1.0d0 + ((-0.5d0) * ((h / l) * (((m / d) * (0.5d0 * d_1)) ** 2.0d0)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))));
double t_1 = Math.sqrt((d / l));
double t_2 = Math.sqrt((d / h));
double tmp;
if (t_0 <= -1e-118) {
tmp = (1.0 - Math.pow(((D * (0.5 * (M / d))) * Math.sqrt((h * (0.5 / l)))), 2.0)) * (t_1 * t_2);
} else if ((t_0 <= 0.0) || !(t_0 <= 1e+292)) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else {
tmp = t_1 * (t_2 * (1.0 + (-0.5 * ((h / l) * Math.pow(((M / d) * (0.5 * D)), 2.0)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)))) t_1 = math.sqrt((d / l)) t_2 = math.sqrt((d / h)) tmp = 0 if t_0 <= -1e-118: tmp = (1.0 - math.pow(((D * (0.5 * (M / d))) * math.sqrt((h * (0.5 / l)))), 2.0)) * (t_1 * t_2) elif (t_0 <= 0.0) or not (t_0 <= 1e+292): tmp = math.fabs((d / math.sqrt((l * h)))) else: tmp = t_1 * (t_2 * (1.0 + (-0.5 * ((h / l) * math.pow(((M / d) * (0.5 * D)), 2.0))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (t_0 <= -1e-118) tmp = Float64(Float64(1.0 - (Float64(Float64(D * Float64(0.5 * Float64(M / d))) * sqrt(Float64(h * Float64(0.5 / l)))) ^ 2.0)) * Float64(t_1 * t_2)); elseif ((t_0 <= 0.0) || !(t_0 <= 1e+292)) tmp = abs(Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(t_1 * Float64(t_2 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(0.5 * D)) ^ 2.0)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0))));
t_1 = sqrt((d / l));
t_2 = sqrt((d / h));
tmp = 0.0;
if (t_0 <= -1e-118)
tmp = (1.0 - (((D * (0.5 * (M / d))) * sqrt((h * (0.5 / l)))) ^ 2.0)) * (t_1 * t_2);
elseif ((t_0 <= 0.0) || ~((t_0 <= 1e+292)))
tmp = abs((d / sqrt((l * h))));
else
tmp = t_1 * (t_2 * (1.0 + (-0.5 * ((h / l) * (((M / d) * (0.5 * D)) ^ 2.0)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -1e-118], N[(N[(1.0 - N[Power[N[(N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+292]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(0.5 * D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right)\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-118}:\\
\;\;\;\;\left(1 - {\left(\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right) \cdot \sqrt{h \cdot \frac{0.5}{\ell}}\right)}^{2}\right) \cdot \left(t_1 \cdot t_2\right)\\
\mathbf{elif}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+292}\right):\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \left(0.5 \cdot D\right)\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -9.99999999999999985e-119Initial program 87.7%
metadata-eval87.7%
unpow1/287.7%
metadata-eval87.7%
unpow1/287.7%
*-commutative87.7%
associate-*l*87.7%
times-frac82.5%
metadata-eval82.5%
Simplified82.5%
associate-*r*82.5%
frac-times87.7%
*-commutative87.7%
metadata-eval87.7%
add-sqr-sqrt87.7%
pow287.7%
Applied egg-rr82.3%
*-commutative82.3%
associate-*l/87.6%
associate-*r/87.7%
*-commutative87.7%
associate-*r/87.7%
associate-/r/89.5%
Simplified89.5%
if -9.99999999999999985e-119 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -0.0 or 1e292 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 23.1%
associate-*l*23.1%
metadata-eval23.1%
unpow1/223.1%
metadata-eval23.1%
unpow1/223.1%
sub-neg23.1%
+-commutative23.1%
*-commutative23.1%
distribute-rgt-neg-in23.1%
fma-def23.1%
Simplified23.0%
Taylor expanded in h around 0 31.3%
pow1/231.3%
metadata-eval31.3%
metadata-eval31.3%
metadata-eval31.3%
pow-prod-up31.2%
pow-prod-down27.8%
pow227.8%
metadata-eval27.8%
Applied egg-rr27.8%
pow-pow31.3%
metadata-eval31.3%
pow1/231.3%
*-rgt-identity31.3%
pow131.3%
sqrt-unprod31.2%
Applied egg-rr31.2%
unpow131.2%
Simplified31.2%
add-sqr-sqrt31.2%
rem-sqrt-square31.2%
frac-times36.8%
sqrt-div39.0%
sqrt-unprod30.8%
add-sqr-sqrt57.5%
Applied egg-rr57.5%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1e292Initial program 98.8%
metadata-eval98.8%
unpow1/298.8%
metadata-eval98.8%
unpow1/298.8%
*-commutative98.8%
associate-*l*98.8%
times-frac98.8%
metadata-eval98.8%
Simplified98.8%
div-inv98.8%
sqrt-prod39.9%
Applied egg-rr39.9%
expm1-log1p-u38.2%
expm1-udef23.6%
Applied egg-rr57.4%
expm1-def94.4%
expm1-log1p98.8%
*-commutative98.8%
associate-*l*98.8%
Simplified96.4%
Final simplification81.1%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)))))))
(if (<= t_0 -1e-118)
t_0
(if (or (<= t_0 0.0) (not (<= t_0 1e+292)))
(fabs (/ d (sqrt (* l h))))
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* (/ M d) (* 0.5 D)) 2.0))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= -1e-118) {
tmp = t_0;
} else if ((t_0 <= 0.0) || !(t_0 <= 1e+292)) {
tmp = fabs((d / sqrt((l * h))));
} else {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * pow(((M / d) * (0.5 * D)), 2.0)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))
if (t_0 <= (-1d-118)) then
tmp = t_0
else if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+292))) then
tmp = abs((d / sqrt((l * h))))
else
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((-0.5d0) * ((h / l) * (((m / d) * (0.5d0 * d_1)) ** 2.0d0)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= -1e-118) {
tmp = t_0;
} else if ((t_0 <= 0.0) || !(t_0 <= 1e+292)) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * Math.pow(((M / d) * (0.5 * D)), 2.0)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)))) tmp = 0 if t_0 <= -1e-118: tmp = t_0 elif (t_0 <= 0.0) or not (t_0 <= 1e+292): tmp = math.fabs((d / math.sqrt((l * h)))) else: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * math.pow(((M / d) * (0.5 * D)), 2.0))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) tmp = 0.0 if (t_0 <= -1e-118) tmp = t_0; elseif ((t_0 <= 0.0) || !(t_0 <= 1e+292)) tmp = abs(Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(0.5 * D)) ^ 2.0)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0))));
tmp = 0.0;
if (t_0 <= -1e-118)
tmp = t_0;
elseif ((t_0 <= 0.0) || ~((t_0 <= 1e+292)))
tmp = abs((d / sqrt((l * h))));
else
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * (((M / d) * (0.5 * D)) ^ 2.0)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-118], t$95$0, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+292]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(0.5 * D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-118}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+292}\right):\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \left(0.5 \cdot D\right)\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -9.99999999999999985e-119Initial program 87.7%
if -9.99999999999999985e-119 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -0.0 or 1e292 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 23.1%
associate-*l*23.1%
metadata-eval23.1%
unpow1/223.1%
metadata-eval23.1%
unpow1/223.1%
sub-neg23.1%
+-commutative23.1%
*-commutative23.1%
distribute-rgt-neg-in23.1%
fma-def23.1%
Simplified23.0%
Taylor expanded in h around 0 31.3%
pow1/231.3%
metadata-eval31.3%
metadata-eval31.3%
metadata-eval31.3%
pow-prod-up31.2%
pow-prod-down27.8%
pow227.8%
metadata-eval27.8%
Applied egg-rr27.8%
pow-pow31.3%
metadata-eval31.3%
pow1/231.3%
*-rgt-identity31.3%
pow131.3%
sqrt-unprod31.2%
Applied egg-rr31.2%
unpow131.2%
Simplified31.2%
add-sqr-sqrt31.2%
rem-sqrt-square31.2%
frac-times36.8%
sqrt-div39.0%
sqrt-unprod30.8%
add-sqr-sqrt57.5%
Applied egg-rr57.5%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1e292Initial program 98.8%
metadata-eval98.8%
unpow1/298.8%
metadata-eval98.8%
unpow1/298.8%
*-commutative98.8%
associate-*l*98.8%
times-frac98.8%
metadata-eval98.8%
Simplified98.8%
div-inv98.8%
sqrt-prod39.9%
Applied egg-rr39.9%
expm1-log1p-u38.2%
expm1-udef23.6%
Applied egg-rr57.4%
expm1-def94.4%
expm1-log1p98.8%
*-commutative98.8%
associate-*l*98.8%
Simplified96.4%
Final simplification80.4%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))))
(*
(* (/ (sqrt d) (sqrt h)) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (pow (* (* D (* 0.5 (/ M d))) (sqrt (* h (/ 0.5 l)))) 2.0)))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = ((sqrt(d) / sqrt(h)) * (1.0 / sqrt((l / d)))) * (1.0 - pow(((D * (0.5 * (M / d))) * sqrt((h * (0.5 / l)))), 2.0));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))))
else
tmp = ((sqrt(d) / sqrt(h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (((d_1 * (0.5d0 * (m / d))) * sqrt((h * (0.5d0 / l)))) ** 2.0d0))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - Math.pow(((D * (0.5 * (M / d))) * Math.sqrt((h * (0.5 / l)))), 2.0));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -2e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - math.pow(((D * (0.5 * (M / d))) * math.sqrt((h * (0.5 / l)))), 2.0)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - (Float64(Float64(D * Float64(0.5 * Float64(M / d))) * sqrt(Float64(h * Float64(0.5 / l)))) ^ 2.0))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -2e-310)
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))));
else
tmp = ((sqrt(d) / sqrt(h)) * (1.0 / sqrt((l / d)))) * (1.0 - (((D * (0.5 * (M / d))) * sqrt((h * (0.5 / l)))) ^ 2.0));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[Power[N[(N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - {\left(\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right) \cdot \sqrt{h \cdot \frac{0.5}{\ell}}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 66.8%
associate-*l*66.8%
metadata-eval66.8%
unpow1/266.8%
metadata-eval66.8%
unpow1/266.8%
associate-*l*66.8%
metadata-eval66.8%
times-frac64.1%
Simplified64.1%
frac-2neg41.1%
sqrt-div46.2%
Applied egg-rr77.1%
if -1.999999999999994e-310 < l Initial program 73.5%
metadata-eval73.5%
unpow1/273.5%
metadata-eval73.5%
unpow1/273.5%
*-commutative73.5%
associate-*l*73.5%
times-frac71.7%
metadata-eval71.7%
Simplified71.7%
associate-*r*71.7%
frac-times73.5%
*-commutative73.5%
metadata-eval73.5%
add-sqr-sqrt73.5%
pow273.5%
Applied egg-rr71.8%
*-commutative71.8%
associate-*l/73.6%
associate-*r/71.8%
*-commutative71.8%
associate-*r/71.8%
associate-/r/72.4%
Simplified72.4%
clear-num72.0%
sqrt-div72.3%
metadata-eval72.3%
Applied egg-rr72.3%
sqrt-div81.2%
div-inv81.2%
Applied egg-rr81.2%
associate-*r/81.2%
*-rgt-identity81.2%
Simplified81.2%
Final simplification78.9%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -2e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* t_0 (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))))
(*
(* t_0 (* (sqrt d) (sqrt (/ 1.0 h))))
(- 1.0 (* (* h (/ 0.5 l)) (pow (* D (* 0.5 (/ M d))) 2.0)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -2e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 / l)) * pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
if (l <= (-2d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))))
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0d0 / h)))) * (1.0d0 - ((h * (0.5d0 / l)) * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (t_0 * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = (t_0 * (Math.sqrt(d) * Math.sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 / l)) * Math.pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= -2e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (t_0 * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) else: tmp = (t_0 * (math.sqrt(d) * math.sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 / l)) * math.pow((D * (0.5 * (M / d))), 2.0))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))))); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) * sqrt(Float64(1.0 / h)))) * Float64(1.0 - Float64(Float64(h * Float64(0.5 / l)) * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (l <= -2e-310)
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))));
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 / l)) * ((D * (0.5 * (M / d))) ^ 2.0)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] * N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right) \cdot \left(1 - \left(h \cdot \frac{0.5}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 66.8%
associate-*l*66.8%
metadata-eval66.8%
unpow1/266.8%
metadata-eval66.8%
unpow1/266.8%
associate-*l*66.8%
metadata-eval66.8%
times-frac64.1%
Simplified64.1%
frac-2neg41.1%
sqrt-div46.2%
Applied egg-rr77.1%
if -1.999999999999994e-310 < l Initial program 73.5%
metadata-eval73.5%
unpow1/273.5%
metadata-eval73.5%
unpow1/273.5%
*-commutative73.5%
associate-*l*73.5%
times-frac71.7%
metadata-eval71.7%
Simplified71.7%
div-inv71.7%
sqrt-prod81.5%
Applied egg-rr81.5%
associate-*r*81.5%
frac-times83.2%
*-commutative83.2%
metadata-eval83.2%
expm1-log1p-u83.0%
expm1-udef83.0%
Applied egg-rr81.2%
expm1-def81.2%
expm1-log1p81.4%
*-commutative81.4%
associate-*l/83.2%
associate-*r/80.6%
*-commutative80.6%
associate-*r/80.6%
associate-/r/80.6%
Simplified80.6%
Final simplification78.7%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (sqrt (/ d h))))
(if (<= h -1.95e+160)
(*
(- 1.0 (* 0.125 (/ (* (* (/ D d) (/ D d)) (* M (* h M))) l)))
(* t_1 (/ (sqrt (- d)) (sqrt (- l)))))
(if (<= h 6e-129)
(*
(* t_0 t_1)
(- 1.0 (* (pow (/ D (* d (/ 2.0 M))) 2.0) (* 0.5 (/ h l)))))
(*
(* t_0 (* (sqrt d) (sqrt (/ 1.0 h))))
(- 1.0 (* 0.125 (* (/ (* h M) (* l d)) (/ (* M (* D D)) d)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double tmp;
if (h <= -1.95e+160) {
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_1 * (sqrt(-d) / sqrt(-l)));
} else if (h <= 6e-129) {
tmp = (t_0 * t_1) * (1.0 - (pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
} else {
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
t_1 = sqrt((d / h))
if (h <= (-1.95d+160)) then
tmp = (1.0d0 - (0.125d0 * ((((d_1 / d) * (d_1 / d)) * (m * (h * m))) / l))) * (t_1 * (sqrt(-d) / sqrt(-l)))
else if (h <= 6d-129) then
tmp = (t_0 * t_1) * (1.0d0 - (((d_1 / (d * (2.0d0 / m))) ** 2.0d0) * (0.5d0 * (h / l))))
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0d0 / h)))) * (1.0d0 - (0.125d0 * (((h * m) / (l * d)) * ((m * (d_1 * d_1)) / d))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = Math.sqrt((d / h));
double tmp;
if (h <= -1.95e+160) {
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_1 * (Math.sqrt(-d) / Math.sqrt(-l)));
} else if (h <= 6e-129) {
tmp = (t_0 * t_1) * (1.0 - (Math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
} else {
tmp = (t_0 * (Math.sqrt(d) * Math.sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) tmp = 0 if h <= -1.95e+160: tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_1 * (math.sqrt(-d) / math.sqrt(-l))) elif h <= 6e-129: tmp = (t_0 * t_1) * (1.0 - (math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l)))) else: tmp = (t_0 * (math.sqrt(d) * math.sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d)))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (h <= -1.95e+160) tmp = Float64(Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(h * M))) / l))) * Float64(t_1 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); elseif (h <= 6e-129) tmp = Float64(Float64(t_0 * t_1) * Float64(1.0 - Float64((Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) * sqrt(Float64(1.0 / h)))) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(h * M) / Float64(l * d)) * Float64(Float64(M * Float64(D * D)) / d))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
t_1 = sqrt((d / h));
tmp = 0.0;
if (h <= -1.95e+160)
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_1 * (sqrt(-d) / sqrt(-l)));
elseif (h <= 6e-129)
tmp = (t_0 * t_1) * (1.0 - (((D / (d * (2.0 / M))) ^ 2.0) * (0.5 * (h / l))));
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1.95e+160], N[(N[(1.0 - N[(0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 6e-129], N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] * N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(h * M), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;h \leq -1.95 \cdot 10^{+160}:\\
\;\;\;\;\left(1 - 0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell}\right) \cdot \left(t_1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;h \leq 6 \cdot 10^{-129}:\\
\;\;\;\;\left(t_0 \cdot t_1\right) \cdot \left(1 - {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right) \cdot \left(1 - 0.125 \cdot \left(\frac{h \cdot M}{\ell \cdot d} \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\end{array}
\end{array}
if h < -1.95000000000000004e160Initial program 53.9%
metadata-eval53.9%
unpow1/253.9%
metadata-eval53.9%
unpow1/253.9%
*-commutative53.9%
associate-*l*53.9%
times-frac54.0%
metadata-eval54.0%
Simplified54.0%
clear-num54.0%
frac-times54.0%
*-un-lft-identity54.0%
Applied egg-rr54.0%
Taylor expanded in D around 0 33.6%
associate-/l/36.0%
associate-*l/35.7%
unpow235.7%
unpow235.7%
times-frac47.3%
unpow247.3%
associate-*l*49.6%
Simplified49.6%
frac-2neg31.9%
sqrt-div38.3%
Applied egg-rr56.0%
if -1.95000000000000004e160 < h < 5.9999999999999996e-129Initial program 73.8%
metadata-eval73.8%
unpow1/273.8%
metadata-eval73.8%
unpow1/273.8%
*-commutative73.8%
associate-*l*73.8%
times-frac71.1%
metadata-eval71.1%
Simplified71.1%
clear-num71.2%
frac-times72.4%
*-un-lft-identity72.4%
Applied egg-rr72.4%
if 5.9999999999999996e-129 < h Initial program 71.3%
metadata-eval71.3%
unpow1/271.3%
metadata-eval71.3%
unpow1/271.3%
*-commutative71.3%
associate-*l*71.3%
times-frac68.5%
metadata-eval68.5%
Simplified68.5%
div-inv68.5%
sqrt-prod79.0%
Applied egg-rr79.0%
Taylor expanded in M around 0 48.8%
associate-*r/48.8%
*-commutative48.8%
associate-*r/48.8%
*-commutative48.8%
*-commutative48.8%
*-commutative48.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
swap-sqr62.0%
associate-*l*57.2%
*-commutative57.2%
*-commutative57.2%
unpow257.2%
associate-*r*65.9%
Simplified65.9%
associate-*r*64.4%
times-frac71.5%
*-commutative71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*69.2%
Applied egg-rr69.2%
Final simplification68.8%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= h -6.5e+158)
(*
(- 1.0 (* 0.125 (/ (* (* (/ D d) (/ D d)) (* M (* h M))) l)))
(* (/ (sqrt (- d)) (sqrt (- h))) t_0))
(if (<= h 4e-129)
(*
(* t_0 (sqrt (/ d h)))
(- 1.0 (* (pow (/ D (* d (/ 2.0 M))) 2.0) (* 0.5 (/ h l)))))
(*
(* t_0 (* (sqrt d) (sqrt (/ 1.0 h))))
(- 1.0 (* 0.125 (* (/ (* h M) (* l d)) (/ (* M (* D D)) d)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (h <= -6.5e+158) {
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * ((sqrt(-d) / sqrt(-h)) * t_0);
} else if (h <= 4e-129) {
tmp = (t_0 * sqrt((d / h))) * (1.0 - (pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
} else {
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
if (h <= (-6.5d+158)) then
tmp = (1.0d0 - (0.125d0 * ((((d_1 / d) * (d_1 / d)) * (m * (h * m))) / l))) * ((sqrt(-d) / sqrt(-h)) * t_0)
else if (h <= 4d-129) then
tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (((d_1 / (d * (2.0d0 / m))) ** 2.0d0) * (0.5d0 * (h / l))))
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0d0 / h)))) * (1.0d0 - (0.125d0 * (((h * m) / (l * d)) * ((m * (d_1 * d_1)) / d))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (h <= -6.5e+158) {
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * ((Math.sqrt(-d) / Math.sqrt(-h)) * t_0);
} else if (h <= 4e-129) {
tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (Math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
} else {
tmp = (t_0 * (Math.sqrt(d) * Math.sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if h <= -6.5e+158: tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * ((math.sqrt(-d) / math.sqrt(-h)) * t_0) elif h <= 4e-129: tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l)))) else: tmp = (t_0 * (math.sqrt(d) * math.sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d)))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -6.5e+158) tmp = Float64(Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(h * M))) / l))) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0)); elseif (h <= 4e-129) tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64((Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) * sqrt(Float64(1.0 / h)))) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(h * M) / Float64(l * d)) * Float64(Float64(M * Float64(D * D)) / d))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (h <= -6.5e+158)
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * ((sqrt(-d) / sqrt(-h)) * t_0);
elseif (h <= 4e-129)
tmp = (t_0 * sqrt((d / h))) * (1.0 - (((D / (d * (2.0 / M))) ^ 2.0) * (0.5 * (h / l))));
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - (0.125 * (((h * M) / (l * d)) * ((M * (D * D)) / d))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -6.5e+158], N[(N[(1.0 - N[(0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4e-129], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] * N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(h * M), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -6.5 \cdot 10^{+158}:\\
\;\;\;\;\left(1 - 0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell}\right) \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t_0\right)\\
\mathbf{elif}\;h \leq 4 \cdot 10^{-129}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right) \cdot \left(1 - 0.125 \cdot \left(\frac{h \cdot M}{\ell \cdot d} \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\end{array}
\end{array}
if h < -6.5000000000000001e158Initial program 53.9%
metadata-eval53.9%
unpow1/253.9%
metadata-eval53.9%
unpow1/253.9%
*-commutative53.9%
associate-*l*53.9%
times-frac54.0%
metadata-eval54.0%
Simplified54.0%
clear-num54.0%
frac-times54.0%
*-un-lft-identity54.0%
Applied egg-rr54.0%
Taylor expanded in D around 0 33.6%
associate-/l/36.0%
associate-*l/35.7%
unpow235.7%
unpow235.7%
times-frac47.3%
unpow247.3%
associate-*l*49.6%
Simplified49.6%
frac-2neg31.9%
sqrt-div35.7%
Applied egg-rr65.4%
if -6.5000000000000001e158 < h < 3.9999999999999997e-129Initial program 73.8%
metadata-eval73.8%
unpow1/273.8%
metadata-eval73.8%
unpow1/273.8%
*-commutative73.8%
associate-*l*73.8%
times-frac71.1%
metadata-eval71.1%
Simplified71.1%
clear-num71.2%
frac-times72.4%
*-un-lft-identity72.4%
Applied egg-rr72.4%
if 3.9999999999999997e-129 < h Initial program 71.3%
metadata-eval71.3%
unpow1/271.3%
metadata-eval71.3%
unpow1/271.3%
*-commutative71.3%
associate-*l*71.3%
times-frac68.5%
metadata-eval68.5%
Simplified68.5%
div-inv68.5%
sqrt-prod79.0%
Applied egg-rr79.0%
Taylor expanded in M around 0 48.8%
associate-*r/48.8%
*-commutative48.8%
associate-*r/48.8%
*-commutative48.8%
*-commutative48.8%
*-commutative48.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
swap-sqr62.0%
associate-*l*57.2%
*-commutative57.2%
*-commutative57.2%
unpow257.2%
associate-*r*65.9%
Simplified65.9%
associate-*r*64.4%
times-frac71.5%
*-commutative71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*69.2%
Applied egg-rr69.2%
Final simplification70.3%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= h -6.5e+159)
(*
(- 1.0 (* 0.125 (/ (* (* (/ D d) (/ D d)) (* M (* h M))) l)))
(* t_0 (/ (sqrt (- d)) (sqrt (- l)))))
(*
(* (sqrt (/ d l)) t_0)
(- 1.0 (* (pow (/ D (* d (/ 2.0 M))) 2.0) (* 0.5 (/ h l))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (h <= -6.5e+159) {
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_0 * (sqrt(-d) / sqrt(-l)));
} else {
tmp = (sqrt((d / l)) * t_0) * (1.0 - (pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 (h <= (-6.5d+159)) then
tmp = (1.0d0 - (0.125d0 * ((((d_1 / d) * (d_1 / d)) * (m * (h * m))) / l))) * (t_0 * (sqrt(-d) / sqrt(-l)))
else
tmp = (sqrt((d / l)) * t_0) * (1.0d0 - (((d_1 / (d * (2.0d0 / m))) ** 2.0d0) * (0.5d0 * (h / l))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double tmp;
if (h <= -6.5e+159) {
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_0 * (Math.sqrt(-d) / Math.sqrt(-l)));
} else {
tmp = (Math.sqrt((d / l)) * t_0) * (1.0 - (Math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) tmp = 0 if h <= -6.5e+159: tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_0 * (math.sqrt(-d) / math.sqrt(-l))) else: tmp = (math.sqrt((d / l)) * t_0) * (1.0 - (math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l)))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (h <= -6.5e+159) tmp = Float64(Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(h * M))) / l))) * Float64(t_0 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); else tmp = Float64(Float64(sqrt(Float64(d / l)) * t_0) * Float64(1.0 - Float64((Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / h));
tmp = 0.0;
if (h <= -6.5e+159)
tmp = (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) * (t_0 * (sqrt(-d) / sqrt(-l)));
else
tmp = (sqrt((d / l)) * t_0) * (1.0 - (((D / (d * (2.0 / M))) ^ 2.0) * (0.5 * (h / l))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -6.5e+159], N[(N[(1.0 - N[(0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;h \leq -6.5 \cdot 10^{+159}:\\
\;\;\;\;\left(1 - 0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell}\right) \cdot \left(t_0 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t_0\right) \cdot \left(1 - {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\end{array}
\end{array}
if h < -6.5000000000000001e159Initial program 53.9%
metadata-eval53.9%
unpow1/253.9%
metadata-eval53.9%
unpow1/253.9%
*-commutative53.9%
associate-*l*53.9%
times-frac54.0%
metadata-eval54.0%
Simplified54.0%
clear-num54.0%
frac-times54.0%
*-un-lft-identity54.0%
Applied egg-rr54.0%
Taylor expanded in D around 0 33.6%
associate-/l/36.0%
associate-*l/35.7%
unpow235.7%
unpow235.7%
times-frac47.3%
unpow247.3%
associate-*l*49.6%
Simplified49.6%
frac-2neg31.9%
sqrt-div38.3%
Applied egg-rr56.0%
if -6.5000000000000001e159 < h Initial program 73.0%
metadata-eval73.0%
unpow1/273.0%
metadata-eval73.0%
unpow1/273.0%
*-commutative73.0%
associate-*l*73.0%
times-frac70.3%
metadata-eval70.3%
Simplified70.3%
clear-num70.3%
frac-times72.0%
*-un-lft-identity72.0%
Applied egg-rr72.0%
Final simplification69.3%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -1.35e+123)
(* (/ (sqrt (- d)) (sqrt (- h))) t_0)
(if (<= l 2e+115)
(*
(* t_0 (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))))
(sqrt (/ d h)))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -1.35e+123) {
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
} else if (l <= 2e+115) {
tmp = (t_0 * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) * sqrt((d / h));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
if (l <= (-1.35d+123)) then
tmp = (sqrt(-d) / sqrt(-h)) * t_0
else if (l <= 2d+115) then
tmp = (t_0 * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))))) * sqrt((d / h))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= -1.35e+123) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * t_0;
} else if (l <= 2e+115) {
tmp = (t_0 * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) * Math.sqrt((d / h));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= -1.35e+123: tmp = (math.sqrt(-d) / math.sqrt(-h)) * t_0 elif l <= 2e+115: tmp = (t_0 * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) * math.sqrt((d / h)) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -1.35e+123) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0); elseif (l <= 2e+115) tmp = Float64(Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))))) * sqrt(Float64(d / h))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (l <= -1.35e+123)
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
elseif (l <= 2e+115)
tmp = (t_0 * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))))) * sqrt((d / h));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.35e+123], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, 2e+115], N[(N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{+123}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t_0\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+115}:\\
\;\;\;\;\left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -1.35000000000000007e123Initial program 57.2%
associate-*l*57.2%
metadata-eval57.2%
unpow1/257.2%
metadata-eval57.2%
unpow1/257.2%
sub-neg57.2%
+-commutative57.2%
*-commutative57.2%
distribute-rgt-neg-in57.2%
fma-def57.2%
Simplified57.1%
Taylor expanded in h around 0 52.3%
frac-2neg52.3%
sqrt-div71.6%
Applied egg-rr71.6%
if -1.35000000000000007e123 < l < 2e115Initial program 74.0%
associate-*l*74.0%
metadata-eval74.0%
unpow1/274.0%
metadata-eval74.0%
unpow1/274.0%
associate-*l*74.0%
metadata-eval74.0%
times-frac71.5%
Simplified71.5%
if 2e115 < l Initial program 59.5%
associate-*l*59.5%
metadata-eval59.5%
unpow1/259.5%
metadata-eval59.5%
unpow1/259.5%
sub-neg59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt-neg-in59.5%
fma-def59.5%
Simplified56.2%
Taylor expanded in h around 0 56.6%
Taylor expanded in d around 0 59.3%
*-commutative59.3%
associate-/r*59.2%
Simplified59.2%
sqrt-div77.4%
Applied egg-rr77.4%
Final simplification72.2%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -8.2e+112)
(* (/ (sqrt (- d)) (sqrt (- h))) t_0)
(if (<= l 3.6e+115)
(*
t_0
(*
(sqrt (/ d h))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* (/ M d) (* 0.5 D)) 2.0))))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -8.2e+112) {
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
} else if (l <= 3.6e+115) {
tmp = t_0 * (sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * pow(((M / d) * (0.5 * D)), 2.0)))));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
if (l <= (-8.2d+112)) then
tmp = (sqrt(-d) / sqrt(-h)) * t_0
else if (l <= 3.6d+115) then
tmp = t_0 * (sqrt((d / h)) * (1.0d0 + ((-0.5d0) * ((h / l) * (((m / d) * (0.5d0 * d_1)) ** 2.0d0)))))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= -8.2e+112) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * t_0;
} else if (l <= 3.6e+115) {
tmp = t_0 * (Math.sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * Math.pow(((M / d) * (0.5 * D)), 2.0)))));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= -8.2e+112: tmp = (math.sqrt(-d) / math.sqrt(-h)) * t_0 elif l <= 3.6e+115: tmp = t_0 * (math.sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * math.pow(((M / d) * (0.5 * D)), 2.0))))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -8.2e+112) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0); elseif (l <= 3.6e+115) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(0.5 * D)) ^ 2.0)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (l <= -8.2e+112)
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
elseif (l <= 3.6e+115)
tmp = t_0 * (sqrt((d / h)) * (1.0 + (-0.5 * ((h / l) * (((M / d) * (0.5 * D)) ^ 2.0)))));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -8.2e+112], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, 3.6e+115], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(0.5 * D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -8.2 \cdot 10^{+112}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t_0\\
\mathbf{elif}\;\ell \leq 3.6 \cdot 10^{+115}:\\
\;\;\;\;t_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \left(0.5 \cdot D\right)\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -8.19999999999999951e112Initial program 57.2%
associate-*l*57.2%
metadata-eval57.2%
unpow1/257.2%
metadata-eval57.2%
unpow1/257.2%
sub-neg57.2%
+-commutative57.2%
*-commutative57.2%
distribute-rgt-neg-in57.2%
fma-def57.2%
Simplified57.1%
Taylor expanded in h around 0 52.3%
frac-2neg52.3%
sqrt-div71.6%
Applied egg-rr71.6%
if -8.19999999999999951e112 < l < 3.6000000000000001e115Initial program 74.0%
metadata-eval74.0%
unpow1/274.0%
metadata-eval74.0%
unpow1/274.0%
*-commutative74.0%
associate-*l*74.0%
times-frac71.5%
metadata-eval71.5%
Simplified71.5%
div-inv71.5%
sqrt-prod37.8%
Applied egg-rr37.8%
expm1-log1p-u16.3%
expm1-udef12.5%
Applied egg-rr23.2%
expm1-def34.1%
expm1-log1p71.5%
*-commutative71.5%
associate-*l*71.5%
Simplified73.5%
if 3.6000000000000001e115 < l Initial program 59.5%
associate-*l*59.5%
metadata-eval59.5%
unpow1/259.5%
metadata-eval59.5%
unpow1/259.5%
sub-neg59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt-neg-in59.5%
fma-def59.5%
Simplified56.2%
Taylor expanded in h around 0 56.6%
Taylor expanded in d around 0 59.3%
*-commutative59.3%
associate-/r*59.2%
Simplified59.2%
sqrt-div77.4%
Applied egg-rr77.4%
Final simplification73.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* (pow (* D (* 0.5 (/ M d))) 2.0) (* 0.5 (/ h l))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (pow((D * (0.5 * (M / d))), 2.0) * (0.5 * (h / l))));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) * (0.5d0 * (h / l))))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (Math.pow((D * (0.5 * (M / d))), 2.0) * (0.5 * (h / l))));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (math.pow((D * (0.5 * (M / d))), 2.0) * (0.5 * (h / l))))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) * Float64(0.5 * Float64(h / l))))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((D * (0.5 * (M / d))) ^ 2.0) * (0.5 * (h / l))));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)
\end{array}
Initial program 69.8%
metadata-eval69.8%
unpow1/269.8%
metadata-eval69.8%
unpow1/269.8%
*-commutative69.8%
associate-*l*69.8%
times-frac67.5%
metadata-eval67.5%
Simplified67.5%
Taylor expanded in M around 0 69.8%
*-commutative69.8%
associate-*l/69.0%
associate-*l*69.0%
*-commutative69.0%
Simplified69.0%
Final simplification69.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* (pow (/ D (* d (/ 2.0 M))) 2.0) (* 0.5 (/ h l))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((d_1 / (d * (2.0d0 / m))) ** 2.0d0) * (0.5d0 * (h / l))))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (Math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (math.pow((D / (d * (2.0 / M))), 2.0) * (0.5 * (h / l))))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64((Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0) * Float64(0.5 * Float64(h / l))))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((D / (d * (2.0 / M))) ^ 2.0) * (0.5 * (h / l))));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)
\end{array}
Initial program 69.8%
metadata-eval69.8%
unpow1/269.8%
metadata-eval69.8%
unpow1/269.8%
*-commutative69.8%
associate-*l*69.8%
times-frac67.5%
metadata-eval67.5%
Simplified67.5%
clear-num67.5%
frac-times69.0%
*-un-lft-identity69.0%
Applied egg-rr69.0%
Final simplification69.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= l -9e+53)
(* t_0 (/ (sqrt (- d)) (sqrt (- l))))
(if (<= l 4.8e+105)
(*
(* (sqrt (/ d l)) t_0)
(- 1.0 (* 0.125 (/ (* (* (/ D d) (/ D d)) (* M (* h M))) l))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (l <= -9e+53) {
tmp = t_0 * (sqrt(-d) / sqrt(-l));
} else if (l <= 4.8e+105) {
tmp = (sqrt((d / l)) * t_0) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-9d+53)) then
tmp = t_0 * (sqrt(-d) / sqrt(-l))
else if (l <= 4.8d+105) then
tmp = (sqrt((d / l)) * t_0) * (1.0d0 - (0.125d0 * ((((d_1 / d) * (d_1 / d)) * (m * (h * m))) / l)))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
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 <= -9e+53) {
tmp = t_0 * (Math.sqrt(-d) / Math.sqrt(-l));
} else if (l <= 4.8e+105) {
tmp = (Math.sqrt((d / l)) * t_0) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) tmp = 0 if l <= -9e+53: tmp = t_0 * (math.sqrt(-d) / math.sqrt(-l)) elif l <= 4.8e+105: tmp = (math.sqrt((d / l)) * t_0) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -9e+53) tmp = Float64(t_0 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (l <= 4.8e+105) tmp = Float64(Float64(sqrt(Float64(d / l)) * t_0) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(h * M))) / l)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / h));
tmp = 0.0;
if (l <= -9e+53)
tmp = t_0 * (sqrt(-d) / sqrt(-l));
elseif (l <= 4.8e+105)
tmp = (sqrt((d / l)) * t_0) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -9e+53], N[(t$95$0 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.8e+105], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -9 \cdot 10^{+53}:\\
\;\;\;\;t_0 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{+105}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t_0\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -9.0000000000000004e53Initial program 57.1%
associate-*l*57.1%
metadata-eval57.1%
unpow1/257.1%
metadata-eval57.1%
unpow1/257.1%
sub-neg57.1%
+-commutative57.1%
*-commutative57.1%
distribute-rgt-neg-in57.1%
fma-def57.1%
Simplified56.9%
Taylor expanded in h around 0 51.0%
frac-2neg51.0%
sqrt-div58.8%
Applied egg-rr58.8%
if -9.0000000000000004e53 < l < 4.7999999999999995e105Initial program 74.8%
metadata-eval74.8%
unpow1/274.8%
metadata-eval74.8%
unpow1/274.8%
*-commutative74.8%
associate-*l*74.8%
times-frac72.6%
metadata-eval72.6%
Simplified72.6%
clear-num72.6%
frac-times74.2%
*-un-lft-identity74.2%
Applied egg-rr74.2%
Taylor expanded in D around 0 49.0%
associate-/l/52.8%
associate-*l/52.7%
unpow252.7%
unpow252.7%
times-frac66.0%
unpow266.0%
associate-*l*69.5%
Simplified69.5%
if 4.7999999999999995e105 < l Initial program 61.6%
associate-*l*61.6%
metadata-eval61.6%
unpow1/261.6%
metadata-eval61.6%
unpow1/261.6%
sub-neg61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt-neg-in61.6%
fma-def61.6%
Simplified58.7%
Taylor expanded in h around 0 56.1%
Taylor expanded in d around 0 57.2%
*-commutative57.2%
associate-/r*57.1%
Simplified57.1%
sqrt-div76.4%
Applied egg-rr76.4%
Final simplification68.4%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -2.7e+50)
(* (/ (sqrt (- d)) (sqrt (- h))) t_0)
(if (<= l 2.8e+108)
(*
(* t_0 (sqrt (/ d h)))
(- 1.0 (* 0.125 (/ (* (* (/ D d) (/ D d)) (* M (* h M))) l))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -2.7e+50) {
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
} else if (l <= 2.8e+108) {
tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
if (l <= (-2.7d+50)) then
tmp = (sqrt(-d) / sqrt(-h)) * t_0
else if (l <= 2.8d+108) then
tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (0.125d0 * ((((d_1 / d) * (d_1 / d)) * (m * (h * m))) / l)))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= -2.7e+50) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * t_0;
} else if (l <= 2.8e+108) {
tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= -2.7e+50: tmp = (math.sqrt(-d) / math.sqrt(-h)) * t_0 elif l <= 2.8e+108: tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -2.7e+50) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0); elseif (l <= 2.8e+108) tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(h * M))) / l)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (l <= -2.7e+50)
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
elseif (l <= 2.8e+108)
tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -2.7e+50], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, 2.8e+108], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t_0\\
\mathbf{elif}\;\ell \leq 2.8 \cdot 10^{+108}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -2.7e50Initial program 57.1%
associate-*l*57.1%
metadata-eval57.1%
unpow1/257.1%
metadata-eval57.1%
unpow1/257.1%
sub-neg57.1%
+-commutative57.1%
*-commutative57.1%
distribute-rgt-neg-in57.1%
fma-def57.1%
Simplified56.9%
Taylor expanded in h around 0 51.0%
frac-2neg51.0%
sqrt-div66.6%
Applied egg-rr66.6%
if -2.7e50 < l < 2.7999999999999998e108Initial program 74.8%
metadata-eval74.8%
unpow1/274.8%
metadata-eval74.8%
unpow1/274.8%
*-commutative74.8%
associate-*l*74.8%
times-frac72.6%
metadata-eval72.6%
Simplified72.6%
clear-num72.6%
frac-times74.2%
*-un-lft-identity74.2%
Applied egg-rr74.2%
Taylor expanded in D around 0 49.0%
associate-/l/52.8%
associate-*l/52.7%
unpow252.7%
unpow252.7%
times-frac66.0%
unpow266.0%
associate-*l*69.5%
Simplified69.5%
if 2.7999999999999998e108 < l Initial program 61.6%
associate-*l*61.6%
metadata-eval61.6%
unpow1/261.6%
metadata-eval61.6%
unpow1/261.6%
sub-neg61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt-neg-in61.6%
fma-def61.6%
Simplified58.7%
Taylor expanded in h around 0 56.1%
Taylor expanded in d around 0 57.2%
*-commutative57.2%
associate-/r*57.1%
Simplified57.1%
sqrt-div76.4%
Applied egg-rr76.4%
Final simplification69.9%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= M 3.75e-137)
(* t_0 (/ 1.0 (sqrt (/ h d))))
(if (<= M 3.3e-94)
(fabs (/ d (sqrt (* l h))))
(if (<= M 2.5e-61)
(* t_0 (sqrt (/ d h)))
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.125 (/ (pow (/ D d) 2.0) (/ l (* M (* h M))))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (M <= 3.75e-137) {
tmp = t_0 * (1.0 / sqrt((h / d)));
} else if (M <= 3.3e-94) {
tmp = fabs((d / sqrt((l * h))));
} else if (M <= 2.5e-61) {
tmp = t_0 * sqrt((d / h));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.125 * (pow((D / d), 2.0) / (l / (M * (h * M))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
if (m <= 3.75d-137) then
tmp = t_0 * (1.0d0 / sqrt((h / d)))
else if (m <= 3.3d-94) then
tmp = abs((d / sqrt((l * h))))
else if (m <= 2.5d-61) then
tmp = t_0 * sqrt((d / h))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.125d0) * (((d_1 / d) ** 2.0d0) / (l / (m * (h * m))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (M <= 3.75e-137) {
tmp = t_0 * (1.0 / Math.sqrt((h / d)));
} else if (M <= 3.3e-94) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else if (M <= 2.5e-61) {
tmp = t_0 * Math.sqrt((d / h));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.125 * (Math.pow((D / d), 2.0) / (l / (M * (h * M))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if M <= 3.75e-137: tmp = t_0 * (1.0 / math.sqrt((h / d))) elif M <= 3.3e-94: tmp = math.fabs((d / math.sqrt((l * h)))) elif M <= 2.5e-61: tmp = t_0 * math.sqrt((d / h)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.125 * (math.pow((D / d), 2.0) / (l / (M * (h * M)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (M <= 3.75e-137) tmp = Float64(t_0 * Float64(1.0 / sqrt(Float64(h / d)))); elseif (M <= 3.3e-94) tmp = abs(Float64(d / sqrt(Float64(l * h)))); elseif (M <= 2.5e-61) tmp = Float64(t_0 * sqrt(Float64(d / h))); else tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.125 * Float64((Float64(D / d) ^ 2.0) / Float64(l / Float64(M * Float64(h * M))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (M <= 3.75e-137)
tmp = t_0 * (1.0 / sqrt((h / d)));
elseif (M <= 3.3e-94)
tmp = abs((d / sqrt((l * h))));
elseif (M <= 2.5e-61)
tmp = t_0 * sqrt((d / h));
else
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.125 * (((D / d) ^ 2.0) / (l / (M * (h * M))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 3.75e-137], N[(t$95$0 * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 3.3e-94], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[M, 2.5e-61], N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;M \leq 3.75 \cdot 10^{-137}:\\
\;\;\;\;t_0 \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{elif}\;M \leq 3.3 \cdot 10^{-94}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{elif}\;M \leq 2.5 \cdot 10^{-61}:\\
\;\;\;\;t_0 \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.125 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{\ell}{M \cdot \left(h \cdot M\right)}}\right)\\
\end{array}
\end{array}
if M < 3.7499999999999998e-137Initial program 70.3%
associate-*l*70.3%
metadata-eval70.3%
unpow1/270.3%
metadata-eval70.3%
unpow1/270.3%
sub-neg70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt-neg-in70.3%
fma-def70.3%
Simplified69.7%
Taylor expanded in h around 0 45.7%
clear-num45.7%
sqrt-div45.8%
metadata-eval45.8%
Applied egg-rr45.8%
if 3.7499999999999998e-137 < M < 3.3000000000000001e-94Initial program 40.9%
associate-*l*40.7%
metadata-eval40.7%
unpow1/240.7%
metadata-eval40.7%
unpow1/240.7%
sub-neg40.7%
+-commutative40.7%
*-commutative40.7%
distribute-rgt-neg-in40.7%
fma-def40.7%
Simplified40.7%
Taylor expanded in h around 0 28.7%
pow1/228.7%
metadata-eval28.7%
metadata-eval28.7%
metadata-eval28.7%
pow-prod-up28.7%
pow-prod-down28.7%
pow228.7%
metadata-eval28.7%
Applied egg-rr28.7%
pow-pow28.7%
metadata-eval28.7%
pow1/228.7%
*-rgt-identity28.7%
pow128.7%
sqrt-unprod17.1%
Applied egg-rr17.1%
unpow117.1%
Simplified17.1%
add-sqr-sqrt17.1%
rem-sqrt-square17.1%
frac-times16.6%
sqrt-div28.0%
sqrt-unprod25.2%
add-sqr-sqrt39.9%
Applied egg-rr39.9%
if 3.3000000000000001e-94 < M < 2.4999999999999999e-61Initial program 67.2%
associate-*l*67.2%
metadata-eval67.2%
unpow1/267.2%
metadata-eval67.2%
unpow1/267.2%
sub-neg67.2%
+-commutative67.2%
*-commutative67.2%
distribute-rgt-neg-in67.2%
fma-def67.2%
Simplified67.2%
Taylor expanded in h around 0 56.5%
div-inv56.4%
sqrt-unprod44.1%
*-rgt-identity44.1%
expm1-log1p-u43.9%
expm1-udef33.4%
sqrt-unprod44.7%
div-inv44.7%
Applied egg-rr44.7%
expm1-def55.2%
expm1-log1p56.5%
Simplified56.5%
if 2.4999999999999999e-61 < M Initial program 72.0%
metadata-eval72.0%
unpow1/272.0%
metadata-eval72.0%
unpow1/272.0%
*-commutative72.0%
associate-*l*72.0%
times-frac70.7%
metadata-eval70.7%
Simplified70.7%
clear-num70.7%
frac-times70.6%
*-un-lft-identity70.6%
Applied egg-rr70.6%
Taylor expanded in D around 0 48.6%
associate-/l/49.9%
associate-*l/49.8%
unpow249.8%
unpow249.8%
times-frac62.0%
unpow262.0%
associate-*l*64.8%
Simplified64.8%
pow164.8%
sqrt-unprod52.0%
cancel-sign-sub-inv52.0%
metadata-eval52.0%
associate-/l*51.9%
pow251.9%
associate-*r*50.3%
Applied egg-rr50.3%
unpow150.3%
associate-*l*51.9%
Simplified51.9%
Final simplification47.8%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= M 3.4e-197)
(* t_0 (/ 1.0 (sqrt (/ h d))))
(*
(* t_0 (sqrt (/ d h)))
(- 1.0 (* 0.125 (/ (* (* (/ D d) (/ D d)) (* M (* h M))) l)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (M <= 3.4e-197) {
tmp = t_0 * (1.0 / sqrt((h / d)));
} else {
tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l))
if (m <= 3.4d-197) then
tmp = t_0 * (1.0d0 / sqrt((h / d)))
else
tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (0.125d0 * ((((d_1 / d) * (d_1 / d)) * (m * (h * m))) / l)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (M <= 3.4e-197) {
tmp = t_0 * (1.0 / Math.sqrt((h / d)));
} else {
tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if M <= 3.4e-197: tmp = t_0 * (1.0 / math.sqrt((h / d))) else: tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (M <= 3.4e-197) tmp = Float64(t_0 * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(h * M))) / l)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (M <= 3.4e-197)
tmp = t_0 * (1.0 / sqrt((h / d)));
else
tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.125 * ((((D / d) * (D / d)) * (M * (h * M))) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 3.4e-197], N[(t$95$0 * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;M \leq 3.4 \cdot 10^{-197}:\\
\;\;\;\;t_0 \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 3.3999999999999998e-197Initial program 70.6%
associate-*l*70.6%
metadata-eval70.6%
unpow1/270.6%
metadata-eval70.6%
unpow1/270.6%
sub-neg70.6%
+-commutative70.6%
*-commutative70.6%
distribute-rgt-neg-in70.6%
fma-def70.6%
Simplified69.9%
Taylor expanded in h around 0 43.9%
clear-num43.9%
sqrt-div44.1%
metadata-eval44.1%
Applied egg-rr44.1%
if 3.3999999999999998e-197 < M Initial program 68.6%
metadata-eval68.6%
unpow1/268.6%
metadata-eval68.6%
unpow1/268.6%
*-commutative68.6%
associate-*l*68.6%
times-frac67.7%
metadata-eval67.7%
Simplified67.7%
clear-num67.7%
frac-times67.6%
*-un-lft-identity67.6%
Applied egg-rr67.6%
Taylor expanded in D around 0 48.0%
associate-/l/49.8%
associate-*l/49.8%
unpow249.8%
unpow249.8%
times-frac61.4%
unpow261.4%
associate-*l*63.5%
Simplified63.5%
Final simplification52.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h)))))
(if (<= d -1.25e+163)
(fabs t_0)
(if (<= d -1.16e+128)
(cbrt (/ (* d (* d t_0)) (* l h)))
(if (<= d -5e-310)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d 1.02e-70)
(* (sqrt (/ h (pow l 3.0))) (/ (* (* D D) -0.125) (/ (/ d M) M)))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double tmp;
if (d <= -1.25e+163) {
tmp = fabs(t_0);
} else if (d <= -1.16e+128) {
tmp = cbrt(((d * (d * t_0)) / (l * h)));
} else if (d <= -5e-310) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= 1.02e-70) {
tmp = sqrt((h / pow(l, 3.0))) * (((D * D) * -0.125) / ((d / M) / M));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d / Math.sqrt((l * h));
double tmp;
if (d <= -1.25e+163) {
tmp = Math.abs(t_0);
} else if (d <= -1.16e+128) {
tmp = Math.cbrt(((d * (d * t_0)) / (l * h)));
} else if (d <= -5e-310) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (d <= 1.02e-70) {
tmp = Math.sqrt((h / Math.pow(l, 3.0))) * (((D * D) * -0.125) / ((d / M) / M));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (d <= -1.25e+163) tmp = abs(t_0); elseif (d <= -1.16e+128) tmp = cbrt(Float64(Float64(d * Float64(d * t_0)) / Float64(l * h))); elseif (d <= -5e-310) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= 1.02e-70) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(Float64(D * D) * -0.125) / Float64(Float64(d / M) / M))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.25e+163], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[d, -1.16e+128], N[Power[N[(N[(d * N[(d * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.02e-70], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+163}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{elif}\;d \leq -1.16 \cdot 10^{+128}:\\
\;\;\;\;\sqrt[3]{\frac{d \cdot \left(d \cdot t_0\right)}{\ell \cdot h}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq 1.02 \cdot 10^{-70}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{\left(D \cdot D\right) \cdot -0.125}{\frac{\frac{d}{M}}{M}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -1.25e163Initial program 79.9%
associate-*l*79.9%
metadata-eval79.9%
unpow1/279.9%
metadata-eval79.9%
unpow1/279.9%
sub-neg79.9%
+-commutative79.9%
*-commutative79.9%
distribute-rgt-neg-in79.9%
fma-def79.9%
Simplified79.9%
Taylor expanded in h around 0 66.5%
pow1/266.5%
metadata-eval66.5%
metadata-eval66.5%
metadata-eval66.5%
pow-prod-up66.1%
pow-prod-down47.1%
pow247.1%
metadata-eval47.1%
Applied egg-rr47.1%
pow-pow66.5%
metadata-eval66.5%
pow1/266.5%
*-rgt-identity66.5%
pow166.5%
sqrt-unprod44.0%
Applied egg-rr44.0%
unpow144.0%
Simplified44.0%
add-sqr-sqrt44.0%
rem-sqrt-square44.0%
frac-times13.6%
sqrt-div13.6%
sqrt-unprod0.0%
add-sqr-sqrt69.2%
Applied egg-rr69.2%
if -1.25e163 < d < -1.1600000000000001e128Initial program 89.4%
associate-*l*89.3%
metadata-eval89.3%
unpow1/289.3%
metadata-eval89.3%
unpow1/289.3%
sub-neg89.3%
+-commutative89.3%
*-commutative89.3%
distribute-rgt-neg-in89.3%
fma-def89.3%
Simplified89.3%
Taylor expanded in h around 0 11.9%
pow1/211.9%
metadata-eval11.9%
metadata-eval11.9%
metadata-eval11.9%
pow-prod-up11.9%
pow-prod-down11.8%
pow211.8%
metadata-eval11.8%
Applied egg-rr11.8%
pow-pow11.9%
metadata-eval11.9%
pow1/211.9%
*-rgt-identity11.9%
add-cbrt-cube1.2%
sqrt-unprod1.2%
sqrt-unprod1.2%
add-sqr-sqrt1.2%
sqrt-unprod1.2%
Applied egg-rr1.2%
associate-*l*1.2%
Simplified1.2%
*-commutative1.2%
associate-*l/1.2%
frac-times1.1%
frac-times1.1%
sqrt-div1.1%
sqrt-unprod0.0%
add-sqr-sqrt67.2%
*-commutative67.2%
Applied egg-rr67.2%
if -1.1600000000000001e128 < d < -4.999999999999985e-310Initial program 61.2%
associate-*l*61.2%
metadata-eval61.2%
unpow1/261.2%
metadata-eval61.2%
unpow1/261.2%
sub-neg61.2%
+-commutative61.2%
*-commutative61.2%
distribute-rgt-neg-in61.2%
fma-def61.2%
Simplified61.2%
Taylor expanded in h around 0 36.5%
div-inv36.5%
sqrt-unprod0.0%
*-rgt-identity0.0%
expm1-log1p-u0.0%
expm1-udef0.0%
sqrt-unprod17.6%
div-inv17.6%
Applied egg-rr17.6%
expm1-def35.5%
expm1-log1p36.5%
Simplified36.5%
if -4.999999999999985e-310 < d < 1.0200000000000001e-70Initial program 62.3%
metadata-eval62.3%
unpow1/262.3%
metadata-eval62.3%
unpow1/262.3%
*-commutative62.3%
associate-*l*62.3%
times-frac60.0%
metadata-eval60.0%
Simplified60.0%
clear-num60.0%
frac-times57.6%
*-un-lft-identity57.6%
Applied egg-rr57.6%
Taylor expanded in D around 0 32.4%
associate-/l/40.6%
associate-*l/40.6%
unpow240.6%
unpow240.6%
times-frac47.3%
unpow247.3%
associate-*l*52.0%
Simplified52.0%
Taylor expanded in d around 0 39.9%
associate-*r*39.9%
*-commutative39.9%
associate-/l*38.1%
associate-*r/38.1%
unpow238.1%
unpow238.1%
associate-/r*42.9%
Simplified42.9%
if 1.0200000000000001e-70 < d Initial program 80.6%
associate-*l*80.5%
metadata-eval80.5%
unpow1/280.5%
metadata-eval80.5%
unpow1/280.5%
sub-neg80.5%
+-commutative80.5%
*-commutative80.5%
distribute-rgt-neg-in80.5%
fma-def80.5%
Simplified80.5%
Taylor expanded in h around 0 53.6%
Taylor expanded in d around 0 50.9%
*-commutative50.9%
associate-/r*50.8%
Simplified50.8%
sqrt-div65.5%
Applied egg-rr65.5%
Final simplification50.3%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -6e-195)
(* t_0 (/ 1.0 (sqrt (/ h d))))
(if (<= l -3.5e-267)
(cbrt (/ (* d (* d (/ d (sqrt (* l h))))) (* l h)))
(if (<= l 3.3e-251)
(* t_0 (sqrt (/ d h)))
(if (<= l 3.8e-172)
(cbrt (* (/ d h) (* (/ d l) (* d (- (pow (* l h) -0.5))))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -6e-195) {
tmp = t_0 * (1.0 / sqrt((h / d)));
} else if (l <= -3.5e-267) {
tmp = cbrt(((d * (d * (d / sqrt((l * h))))) / (l * h)));
} else if (l <= 3.3e-251) {
tmp = t_0 * sqrt((d / h));
} else if (l <= 3.8e-172) {
tmp = cbrt(((d / h) * ((d / l) * (d * -pow((l * h), -0.5)))));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= -6e-195) {
tmp = t_0 * (1.0 / Math.sqrt((h / d)));
} else if (l <= -3.5e-267) {
tmp = Math.cbrt(((d * (d * (d / Math.sqrt((l * h))))) / (l * h)));
} else if (l <= 3.3e-251) {
tmp = t_0 * Math.sqrt((d / h));
} else if (l <= 3.8e-172) {
tmp = Math.cbrt(((d / h) * ((d / l) * (d * -Math.pow((l * h), -0.5)))));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -6e-195) tmp = Float64(t_0 * Float64(1.0 / sqrt(Float64(h / d)))); elseif (l <= -3.5e-267) tmp = cbrt(Float64(Float64(d * Float64(d * Float64(d / sqrt(Float64(l * h))))) / Float64(l * h))); elseif (l <= 3.3e-251) tmp = Float64(t_0 * sqrt(Float64(d / h))); elseif (l <= 3.8e-172) tmp = cbrt(Float64(Float64(d / h) * Float64(Float64(d / l) * Float64(d * Float64(-(Float64(l * h) ^ -0.5)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -6e-195], N[(t$95$0 * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.5e-267], N[Power[N[(N[(d * N[(d * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[l, 3.3e-251], N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e-172], N[Power[N[(N[(d / h), $MachinePrecision] * N[(N[(d / l), $MachinePrecision] * N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -6 \cdot 10^{-195}:\\
\;\;\;\;t_0 \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{elif}\;\ell \leq -3.5 \cdot 10^{-267}:\\
\;\;\;\;\sqrt[3]{\frac{d \cdot \left(d \cdot \frac{d}{\sqrt{\ell \cdot h}}\right)}{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 3.3 \cdot 10^{-251}:\\
\;\;\;\;t_0 \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-172}:\\
\;\;\;\;\sqrt[3]{\frac{d}{h} \cdot \left(\frac{d}{\ell} \cdot \left(d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -6e-195Initial program 68.0%
associate-*l*68.0%
metadata-eval68.0%
unpow1/268.0%
metadata-eval68.0%
unpow1/268.0%
sub-neg68.0%
+-commutative68.0%
*-commutative68.0%
distribute-rgt-neg-in68.0%
fma-def68.0%
Simplified68.0%
Taylor expanded in h around 0 46.1%
clear-num46.1%
sqrt-div46.2%
metadata-eval46.2%
Applied egg-rr46.2%
if -6e-195 < l < -3.4999999999999999e-267Initial program 66.7%
associate-*l*66.7%
metadata-eval66.7%
unpow1/266.7%
metadata-eval66.7%
unpow1/266.7%
sub-neg66.7%
+-commutative66.7%
*-commutative66.7%
distribute-rgt-neg-in66.7%
fma-def66.7%
Simplified66.7%
Taylor expanded in h around 0 8.8%
pow1/28.8%
metadata-eval8.8%
metadata-eval8.8%
metadata-eval8.8%
pow-prod-up8.8%
pow-prod-down8.6%
pow28.6%
metadata-eval8.6%
Applied egg-rr8.6%
pow-pow8.8%
metadata-eval8.8%
pow1/28.8%
*-rgt-identity8.8%
add-cbrt-cube8.7%
sqrt-unprod8.7%
sqrt-unprod8.7%
add-sqr-sqrt8.7%
sqrt-unprod8.7%
Applied egg-rr8.7%
associate-*l*8.7%
Simplified8.7%
*-commutative8.7%
associate-*l/8.7%
frac-times0.8%
frac-times0.8%
sqrt-div0.8%
sqrt-unprod0.0%
add-sqr-sqrt51.4%
*-commutative51.4%
Applied egg-rr51.4%
if -3.4999999999999999e-267 < l < 3.3e-251Initial program 63.1%
associate-*l*63.1%
metadata-eval63.1%
unpow1/263.1%
metadata-eval63.1%
unpow1/263.1%
sub-neg63.1%
+-commutative63.1%
*-commutative63.1%
distribute-rgt-neg-in63.1%
fma-def63.1%
Simplified63.1%
Taylor expanded in h around 0 38.1%
div-inv38.1%
sqrt-unprod18.7%
*-rgt-identity18.7%
expm1-log1p-u18.0%
expm1-udef18.1%
sqrt-unprod33.1%
div-inv33.1%
Applied egg-rr33.1%
expm1-def37.0%
expm1-log1p38.1%
Simplified38.1%
if 3.3e-251 < l < 3.79999999999999987e-172Initial program 87.4%
associate-*l*87.4%
metadata-eval87.4%
unpow1/287.4%
metadata-eval87.4%
unpow1/287.4%
sub-neg87.4%
+-commutative87.4%
*-commutative87.4%
distribute-rgt-neg-in87.4%
fma-def87.4%
Simplified87.4%
Taylor expanded in h around 0 25.4%
pow1/225.4%
metadata-eval25.4%
metadata-eval25.4%
metadata-eval25.4%
pow-prod-up25.1%
pow-prod-down13.6%
pow213.6%
metadata-eval13.6%
Applied egg-rr13.6%
pow-pow25.4%
metadata-eval25.4%
pow1/225.4%
*-rgt-identity25.4%
add-cbrt-cube7.6%
sqrt-unprod7.6%
sqrt-unprod7.6%
add-sqr-sqrt7.6%
sqrt-unprod7.6%
Applied egg-rr7.6%
associate-*l*7.6%
Simplified7.6%
Taylor expanded in d around -inf 69.0%
associate-*r*51.2%
neg-mul-151.2%
associate-/l/51.2%
associate-/r*51.2%
unpow-151.2%
metadata-eval51.2%
pow-sqr51.2%
rem-sqrt-square51.2%
rem-square-sqrt51.2%
fabs-sqr51.2%
rem-square-sqrt51.2%
distribute-lft-neg-in51.2%
distribute-rgt-neg-in51.2%
*-commutative51.2%
Simplified69.0%
if 3.79999999999999987e-172 < l Initial program 71.4%
associate-*l*71.3%
metadata-eval71.3%
unpow1/271.3%
metadata-eval71.3%
unpow1/271.3%
sub-neg71.3%
+-commutative71.3%
*-commutative71.3%
distribute-rgt-neg-in71.3%
fma-def71.3%
Simplified69.1%
Taylor expanded in h around 0 44.9%
Taylor expanded in d around 0 46.4%
*-commutative46.4%
associate-/r*46.3%
Simplified46.3%
sqrt-div55.9%
Applied egg-rr55.9%
Final simplification50.4%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))))
(if (<= M 6.1e-136)
t_0
(if (<= M 4.4e-94)
(fabs (/ d (sqrt (* l h))))
(if (<= M 2.6e+81)
t_0
(* -0.125 (* (sqrt (/ h (pow l 3.0))) (/ (* D D) (/ d (* M M))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l)) * (1.0 / sqrt((h / d)));
double tmp;
if (M <= 6.1e-136) {
tmp = t_0;
} else if (M <= 4.4e-94) {
tmp = fabs((d / sqrt((l * h))));
} else if (M <= 2.6e+81) {
tmp = t_0;
} else {
tmp = -0.125 * (sqrt((h / pow(l, 3.0))) * ((D * D) / (d / (M * M))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / l)) * (1.0d0 / sqrt((h / d)))
if (m <= 6.1d-136) then
tmp = t_0
else if (m <= 4.4d-94) then
tmp = abs((d / sqrt((l * h))))
else if (m <= 2.6d+81) then
tmp = t_0
else
tmp = (-0.125d0) * (sqrt((h / (l ** 3.0d0))) * ((d_1 * d_1) / (d / (m * m))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
double tmp;
if (M <= 6.1e-136) {
tmp = t_0;
} else if (M <= 4.4e-94) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else if (M <= 2.6e+81) {
tmp = t_0;
} else {
tmp = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) * ((D * D) / (d / (M * M))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) tmp = 0 if M <= 6.1e-136: tmp = t_0 elif M <= 4.4e-94: tmp = math.fabs((d / math.sqrt((l * h)))) elif M <= 2.6e+81: tmp = t_0 else: tmp = -0.125 * (math.sqrt((h / math.pow(l, 3.0))) * ((D * D) / (d / (M * M)))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))) tmp = 0.0 if (M <= 6.1e-136) tmp = t_0; elseif (M <= 4.4e-94) tmp = abs(Float64(d / sqrt(Float64(l * h)))); elseif (M <= 2.6e+81) tmp = t_0; else tmp = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(D * D) / Float64(d / Float64(M * M))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l)) * (1.0 / sqrt((h / d)));
tmp = 0.0;
if (M <= 6.1e-136)
tmp = t_0;
elseif (M <= 4.4e-94)
tmp = abs((d / sqrt((l * h))));
elseif (M <= 2.6e+81)
tmp = t_0;
else
tmp = -0.125 * (sqrt((h / (l ^ 3.0))) * ((D * D) / (d / (M * M))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 6.1e-136], t$95$0, If[LessEqual[M, 4.4e-94], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[M, 2.6e+81], t$95$0, N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{if}\;M \leq 6.1 \cdot 10^{-136}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M \leq 4.4 \cdot 10^{-94}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{elif}\;M \leq 2.6 \cdot 10^{+81}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{D \cdot D}{\frac{d}{M \cdot M}}\right)\\
\end{array}
\end{array}
if M < 6.0999999999999999e-136 or 4.40000000000000002e-94 < M < 2.59999999999999992e81Initial program 71.1%
associate-*l*71.1%
metadata-eval71.1%
unpow1/271.1%
metadata-eval71.1%
unpow1/271.1%
sub-neg71.1%
+-commutative71.1%
*-commutative71.1%
distribute-rgt-neg-in71.1%
fma-def71.1%
Simplified70.6%
Taylor expanded in h around 0 46.5%
clear-num46.5%
sqrt-div46.7%
metadata-eval46.7%
Applied egg-rr46.7%
if 6.0999999999999999e-136 < M < 4.40000000000000002e-94Initial program 40.9%
associate-*l*40.7%
metadata-eval40.7%
unpow1/240.7%
metadata-eval40.7%
unpow1/240.7%
sub-neg40.7%
+-commutative40.7%
*-commutative40.7%
distribute-rgt-neg-in40.7%
fma-def40.7%
Simplified40.7%
Taylor expanded in h around 0 28.7%
pow1/228.7%
metadata-eval28.7%
metadata-eval28.7%
metadata-eval28.7%
pow-prod-up28.7%
pow-prod-down28.7%
pow228.7%
metadata-eval28.7%
Applied egg-rr28.7%
pow-pow28.7%
metadata-eval28.7%
pow1/228.7%
*-rgt-identity28.7%
pow128.7%
sqrt-unprod17.1%
Applied egg-rr17.1%
unpow117.1%
Simplified17.1%
add-sqr-sqrt17.1%
rem-sqrt-square17.1%
frac-times16.6%
sqrt-div28.0%
sqrt-unprod25.2%
add-sqr-sqrt39.9%
Applied egg-rr39.9%
if 2.59999999999999992e81 < M Initial program 68.7%
metadata-eval68.7%
unpow1/268.7%
metadata-eval68.7%
unpow1/268.7%
*-commutative68.7%
associate-*l*68.7%
times-frac66.1%
metadata-eval66.1%
Simplified66.1%
div-inv66.1%
sqrt-prod40.9%
Applied egg-rr40.9%
Taylor expanded in d around 0 18.3%
associate-/l*18.2%
unpow218.2%
unpow218.2%
Simplified18.2%
Final simplification42.2%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= h 3.1e-256) (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d)))) (* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3.1e-256) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 3.1d-256) then
tmp = sqrt((d / l)) * (1.0d0 / sqrt((h / d)))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3.1e-256) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= 3.1e-256: tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= 3.1e-256) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= 3.1e-256)
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, 3.1e-256], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 3.1 \cdot 10^{-256}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < 3.09999999999999986e-256Initial program 68.5%
associate-*l*68.5%
metadata-eval68.5%
unpow1/268.5%
metadata-eval68.5%
unpow1/268.5%
sub-neg68.5%
+-commutative68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
fma-def68.5%
Simplified67.2%
Taylor expanded in h around 0 43.2%
clear-num43.2%
sqrt-div43.3%
metadata-eval43.3%
Applied egg-rr43.3%
if 3.09999999999999986e-256 < h Initial program 71.8%
associate-*l*71.8%
metadata-eval71.8%
unpow1/271.8%
metadata-eval71.8%
unpow1/271.8%
sub-neg71.8%
+-commutative71.8%
*-commutative71.8%
distribute-rgt-neg-in71.8%
fma-def71.8%
Simplified71.7%
Taylor expanded in h around 0 39.6%
Taylor expanded in d around 0 40.9%
*-commutative40.9%
associate-/r*40.8%
Simplified40.8%
sqrt-div50.3%
Applied egg-rr50.3%
Final simplification46.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= d 1.85e-219) (* d (- (pow (* l h) -0.5))) (* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.85e-219) {
tmp = d * -pow((l * h), -0.5);
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 1.85d-219) then
tmp = d * -((l * h) ** (-0.5d0))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.85e-219) {
tmp = d * -Math.pow((l * h), -0.5);
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if d <= 1.85e-219: tmp = d * -math.pow((l * h), -0.5) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= 1.85e-219) tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= 1.85e-219)
tmp = d * -((l * h) ^ -0.5);
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.85e-219], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.85 \cdot 10^{-219}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < 1.85e-219Initial program 64.8%
associate-*l*64.8%
metadata-eval64.8%
unpow1/264.8%
metadata-eval64.8%
unpow1/264.8%
sub-neg64.8%
+-commutative64.8%
*-commutative64.8%
distribute-rgt-neg-in64.8%
fma-def64.8%
Simplified64.8%
Taylor expanded in h around 0 39.4%
pow1/239.4%
metadata-eval39.4%
metadata-eval39.4%
metadata-eval39.4%
pow-prod-up39.2%
pow-prod-down29.1%
pow229.1%
metadata-eval29.1%
Applied egg-rr29.1%
pow-pow39.4%
metadata-eval39.4%
pow1/239.4%
*-rgt-identity39.4%
pow139.4%
sqrt-unprod28.9%
Applied egg-rr28.9%
unpow128.9%
Simplified28.9%
Taylor expanded in d around -inf 38.1%
associate-*r*38.1%
neg-mul-138.1%
associate-/l/38.6%
associate-/r*38.1%
unpow-138.1%
metadata-eval38.1%
pow-sqr38.1%
rem-sqrt-square38.1%
rem-square-sqrt38.0%
fabs-sqr38.0%
rem-square-sqrt38.1%
distribute-lft-neg-in38.1%
distribute-rgt-neg-in38.1%
*-commutative38.1%
Simplified38.1%
if 1.85e-219 < d Initial program 76.9%
associate-*l*76.9%
metadata-eval76.9%
unpow1/276.9%
metadata-eval76.9%
unpow1/276.9%
sub-neg76.9%
+-commutative76.9%
*-commutative76.9%
distribute-rgt-neg-in76.9%
fma-def76.9%
Simplified75.0%
Taylor expanded in h around 0 45.2%
Taylor expanded in d around 0 44.7%
*-commutative44.7%
associate-/r*44.6%
Simplified44.6%
sqrt-div55.3%
Applied egg-rr55.3%
Final simplification45.2%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= h 3.1e-256) (* (sqrt (/ d l)) (sqrt (/ d h))) (* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3.1e-256) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 3.1d-256) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3.1e-256) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= 3.1e-256: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= 3.1e-256) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= 3.1e-256)
tmp = sqrt((d / l)) * sqrt((d / h));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, 3.1e-256], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 3.1 \cdot 10^{-256}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < 3.09999999999999986e-256Initial program 68.5%
associate-*l*68.5%
metadata-eval68.5%
unpow1/268.5%
metadata-eval68.5%
unpow1/268.5%
sub-neg68.5%
+-commutative68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
fma-def68.5%
Simplified67.2%
Taylor expanded in h around 0 43.2%
div-inv43.2%
sqrt-unprod5.8%
*-rgt-identity5.8%
expm1-log1p-u5.7%
expm1-udef5.0%
sqrt-unprod28.4%
div-inv28.4%
Applied egg-rr28.4%
expm1-def41.6%
expm1-log1p43.2%
Simplified43.2%
if 3.09999999999999986e-256 < h Initial program 71.8%
associate-*l*71.8%
metadata-eval71.8%
unpow1/271.8%
metadata-eval71.8%
unpow1/271.8%
sub-neg71.8%
+-commutative71.8%
*-commutative71.8%
distribute-rgt-neg-in71.8%
fma-def71.8%
Simplified71.7%
Taylor expanded in h around 0 39.6%
Taylor expanded in d around 0 40.9%
*-commutative40.9%
associate-/r*40.8%
Simplified40.8%
sqrt-div50.3%
Applied egg-rr50.3%
Final simplification46.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= h 4.8e+232) (fabs (/ d (sqrt (* l h)))) (sqrt (/ (/ d l) (/ h d)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 4.8e+232) {
tmp = fabs((d / sqrt((l * h))));
} else {
tmp = sqrt(((d / l) / (h / d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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.8d+232) then
tmp = abs((d / sqrt((l * h))))
else
tmp = sqrt(((d / l) / (h / d)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 4.8e+232) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else {
tmp = Math.sqrt(((d / l) / (h / d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= 4.8e+232: tmp = math.fabs((d / math.sqrt((l * h)))) else: tmp = math.sqrt(((d / l) / (h / d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= 4.8e+232) tmp = abs(Float64(d / sqrt(Float64(l * h)))); else tmp = sqrt(Float64(Float64(d / l) / Float64(h / d))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= 4.8e+232)
tmp = abs((d / sqrt((l * h))));
else
tmp = sqrt(((d / l) / (h / d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, 4.8e+232], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 4.8 \cdot 10^{+232}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\end{array}
\end{array}
if h < 4.8000000000000003e232Initial program 69.9%
associate-*l*69.9%
metadata-eval69.9%
unpow1/269.9%
metadata-eval69.9%
unpow1/269.9%
sub-neg69.9%
+-commutative69.9%
*-commutative69.9%
distribute-rgt-neg-in69.9%
fma-def69.9%
Simplified69.1%
Taylor expanded in h around 0 41.0%
pow1/241.0%
metadata-eval41.0%
metadata-eval41.0%
metadata-eval41.0%
pow-prod-up40.8%
pow-prod-down29.8%
pow229.8%
metadata-eval29.8%
Applied egg-rr29.8%
pow-pow41.0%
metadata-eval41.0%
pow1/241.0%
*-rgt-identity41.0%
pow141.0%
sqrt-unprod30.9%
Applied egg-rr30.9%
unpow130.9%
Simplified30.9%
add-sqr-sqrt30.9%
rem-sqrt-square30.9%
frac-times23.4%
sqrt-div26.4%
sqrt-unprod19.1%
add-sqr-sqrt41.3%
Applied egg-rr41.3%
if 4.8000000000000003e232 < h Initial program 66.4%
associate-*l*66.4%
metadata-eval66.4%
unpow1/266.4%
metadata-eval66.4%
unpow1/266.4%
sub-neg66.4%
+-commutative66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
fma-def66.4%
Simplified66.1%
Taylor expanded in h around 0 58.7%
pow1/258.7%
metadata-eval58.7%
metadata-eval58.7%
metadata-eval58.7%
pow-prod-up58.7%
pow-prod-down50.8%
pow250.8%
metadata-eval50.8%
Applied egg-rr50.8%
pow-pow58.7%
metadata-eval58.7%
pow1/258.7%
*-rgt-identity58.7%
pow158.7%
sqrt-unprod51.3%
Applied egg-rr51.3%
unpow151.3%
Simplified51.3%
*-commutative51.3%
clear-num51.4%
un-div-inv51.4%
Applied egg-rr51.4%
Final simplification41.8%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* l h) -0.5)))
(if (<= h -2.7e-250)
(* d (- t_0))
(if (<= h 2.5e+227) (* d t_0) (sqrt (/ (/ d l) (/ h d)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((l * h), -0.5);
double tmp;
if (h <= -2.7e-250) {
tmp = d * -t_0;
} else if (h <= 2.5e+227) {
tmp = d * t_0;
} else {
tmp = sqrt(((d / l) / (h / d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 = (l * h) ** (-0.5d0)
if (h <= (-2.7d-250)) then
tmp = d * -t_0
else if (h <= 2.5d+227) then
tmp = d * t_0
else
tmp = sqrt(((d / l) / (h / d)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((l * h), -0.5);
double tmp;
if (h <= -2.7e-250) {
tmp = d * -t_0;
} else if (h <= 2.5e+227) {
tmp = d * t_0;
} else {
tmp = Math.sqrt(((d / l) / (h / d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.pow((l * h), -0.5) tmp = 0 if h <= -2.7e-250: tmp = d * -t_0 elif h <= 2.5e+227: tmp = d * t_0 else: tmp = math.sqrt(((d / l) / (h / d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(l * h) ^ -0.5 tmp = 0.0 if (h <= -2.7e-250) tmp = Float64(d * Float64(-t_0)); elseif (h <= 2.5e+227) tmp = Float64(d * t_0); else tmp = sqrt(Float64(Float64(d / l) / Float64(h / d))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = (l * h) ^ -0.5;
tmp = 0.0;
if (h <= -2.7e-250)
tmp = d * -t_0;
elseif (h <= 2.5e+227)
tmp = d * t_0;
else
tmp = sqrt(((d / l) / (h / d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[h, -2.7e-250], N[(d * (-t$95$0)), $MachinePrecision], If[LessEqual[h, 2.5e+227], N[(d * t$95$0), $MachinePrecision], N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;h \leq -2.7 \cdot 10^{-250}:\\
\;\;\;\;d \cdot \left(-t_0\right)\\
\mathbf{elif}\;h \leq 2.5 \cdot 10^{+227}:\\
\;\;\;\;d \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\end{array}
\end{array}
if h < -2.70000000000000002e-250Initial program 64.7%
associate-*l*64.7%
metadata-eval64.7%
unpow1/264.7%
metadata-eval64.7%
unpow1/264.7%
sub-neg64.7%
+-commutative64.7%
*-commutative64.7%
distribute-rgt-neg-in64.7%
fma-def64.7%
Simplified64.7%
Taylor expanded in h around 0 41.8%
pow1/241.8%
metadata-eval41.8%
metadata-eval41.8%
metadata-eval41.8%
pow-prod-up41.5%
pow-prod-down30.1%
pow230.1%
metadata-eval30.1%
Applied egg-rr30.1%
pow-pow41.8%
metadata-eval41.8%
pow1/241.8%
*-rgt-identity41.8%
pow141.8%
sqrt-unprod29.1%
Applied egg-rr29.1%
unpow129.1%
Simplified29.1%
Taylor expanded in d around -inf 40.1%
associate-*r*40.1%
neg-mul-140.1%
associate-/l/40.7%
associate-/r*40.1%
unpow-140.1%
metadata-eval40.1%
pow-sqr40.1%
rem-sqrt-square40.1%
rem-square-sqrt39.9%
fabs-sqr39.9%
rem-square-sqrt40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-in40.1%
*-commutative40.1%
Simplified40.1%
if -2.70000000000000002e-250 < h < 2.4999999999999998e227Initial program 75.5%
associate-*l*75.5%
metadata-eval75.5%
unpow1/275.5%
metadata-eval75.5%
unpow1/275.5%
sub-neg75.5%
+-commutative75.5%
*-commutative75.5%
distribute-rgt-neg-in75.5%
fma-def75.5%
Simplified73.8%
Taylor expanded in h around 0 40.1%
pow1/240.1%
metadata-eval40.1%
metadata-eval40.1%
metadata-eval40.1%
pow-prod-up40.0%
pow-prod-down29.4%
pow229.4%
metadata-eval29.4%
Applied egg-rr29.4%
pow-pow40.1%
metadata-eval40.1%
pow1/240.1%
*-rgt-identity40.1%
pow140.1%
sqrt-unprod32.7%
Applied egg-rr32.7%
unpow132.7%
Simplified32.7%
frac-times29.5%
div-inv29.4%
add-exp-log28.7%
add-sqr-sqrt28.7%
swap-sqr30.9%
sqrt-unprod37.8%
add-sqr-sqrt43.0%
*-commutative43.0%
add-exp-log44.5%
inv-pow44.5%
sqrt-pow144.5%
metadata-eval44.5%
Applied egg-rr44.5%
if 2.4999999999999998e227 < h Initial program 66.4%
associate-*l*66.4%
metadata-eval66.4%
unpow1/266.4%
metadata-eval66.4%
unpow1/266.4%
sub-neg66.4%
+-commutative66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
fma-def66.4%
Simplified66.1%
Taylor expanded in h around 0 58.7%
pow1/258.7%
metadata-eval58.7%
metadata-eval58.7%
metadata-eval58.7%
pow-prod-up58.7%
pow-prod-down50.8%
pow250.8%
metadata-eval50.8%
Applied egg-rr50.8%
pow-pow58.7%
metadata-eval58.7%
pow1/258.7%
*-rgt-identity58.7%
pow158.7%
sqrt-unprod51.3%
Applied egg-rr51.3%
unpow151.3%
Simplified51.3%
*-commutative51.3%
clear-num51.4%
un-div-inv51.4%
Applied egg-rr51.4%
Final simplification42.7%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= h -2.7e-250)
(* d (- (pow (* l h) -0.5)))
(if (<= h 1.35e+230)
(* d (sqrt (/ (/ 1.0 h) l)))
(sqrt (/ (/ d l) (/ h d))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.7e-250) {
tmp = d * -pow((l * h), -0.5);
} else if (h <= 1.35e+230) {
tmp = d * sqrt(((1.0 / h) / l));
} else {
tmp = sqrt(((d / l) / (h / d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-2.7d-250)) then
tmp = d * -((l * h) ** (-0.5d0))
else if (h <= 1.35d+230) then
tmp = d * sqrt(((1.0d0 / h) / l))
else
tmp = sqrt(((d / l) / (h / d)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.7e-250) {
tmp = d * -Math.pow((l * h), -0.5);
} else if (h <= 1.35e+230) {
tmp = d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = Math.sqrt(((d / l) / (h / d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= -2.7e-250: tmp = d * -math.pow((l * h), -0.5) elif h <= 1.35e+230: tmp = d * math.sqrt(((1.0 / h) / l)) else: tmp = math.sqrt(((d / l) / (h / d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= -2.7e-250) tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); elseif (h <= 1.35e+230) tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = sqrt(Float64(Float64(d / l) / Float64(h / d))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= -2.7e-250)
tmp = d * -((l * h) ^ -0.5);
elseif (h <= 1.35e+230)
tmp = d * sqrt(((1.0 / h) / l));
else
tmp = sqrt(((d / l) / (h / d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.7e-250], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[h, 1.35e+230], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.7 \cdot 10^{-250}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{elif}\;h \leq 1.35 \cdot 10^{+230}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\end{array}
\end{array}
if h < -2.70000000000000002e-250Initial program 64.7%
associate-*l*64.7%
metadata-eval64.7%
unpow1/264.7%
metadata-eval64.7%
unpow1/264.7%
sub-neg64.7%
+-commutative64.7%
*-commutative64.7%
distribute-rgt-neg-in64.7%
fma-def64.7%
Simplified64.7%
Taylor expanded in h around 0 41.8%
pow1/241.8%
metadata-eval41.8%
metadata-eval41.8%
metadata-eval41.8%
pow-prod-up41.5%
pow-prod-down30.1%
pow230.1%
metadata-eval30.1%
Applied egg-rr30.1%
pow-pow41.8%
metadata-eval41.8%
pow1/241.8%
*-rgt-identity41.8%
pow141.8%
sqrt-unprod29.1%
Applied egg-rr29.1%
unpow129.1%
Simplified29.1%
Taylor expanded in d around -inf 40.1%
associate-*r*40.1%
neg-mul-140.1%
associate-/l/40.7%
associate-/r*40.1%
unpow-140.1%
metadata-eval40.1%
pow-sqr40.1%
rem-sqrt-square40.1%
rem-square-sqrt39.9%
fabs-sqr39.9%
rem-square-sqrt40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-in40.1%
*-commutative40.1%
Simplified40.1%
if -2.70000000000000002e-250 < h < 1.35000000000000002e230Initial program 75.5%
associate-*l*75.5%
metadata-eval75.5%
unpow1/275.5%
metadata-eval75.5%
unpow1/275.5%
sub-neg75.5%
+-commutative75.5%
*-commutative75.5%
distribute-rgt-neg-in75.5%
fma-def75.5%
Simplified73.8%
Taylor expanded in h around 0 40.1%
Taylor expanded in d around 0 44.5%
*-commutative44.5%
associate-/r*44.5%
Simplified44.5%
add-exp-log43.0%
associate-/l/43.0%
Applied egg-rr43.0%
add-exp-log44.5%
associate-/r*44.5%
Applied egg-rr44.5%
if 1.35000000000000002e230 < h Initial program 66.4%
associate-*l*66.4%
metadata-eval66.4%
unpow1/266.4%
metadata-eval66.4%
unpow1/266.4%
sub-neg66.4%
+-commutative66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
fma-def66.4%
Simplified66.1%
Taylor expanded in h around 0 58.7%
pow1/258.7%
metadata-eval58.7%
metadata-eval58.7%
metadata-eval58.7%
pow-prod-up58.7%
pow-prod-down50.8%
pow250.8%
metadata-eval50.8%
Applied egg-rr50.8%
pow-pow58.7%
metadata-eval58.7%
pow1/258.7%
*-rgt-identity58.7%
pow158.7%
sqrt-unprod51.3%
Applied egg-rr51.3%
unpow151.3%
Simplified51.3%
*-commutative51.3%
clear-num51.4%
un-div-inv51.4%
Applied egg-rr51.4%
Final simplification42.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= h -2.7e-250) (* d (- (pow (* l h) -0.5))) (if (<= h 9e+232) (* d (sqrt (/ 1.0 (* l h)))) (sqrt (/ (/ d l) (/ h d))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.7e-250) {
tmp = d * -pow((l * h), -0.5);
} else if (h <= 9e+232) {
tmp = d * sqrt((1.0 / (l * h)));
} else {
tmp = sqrt(((d / l) / (h / d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-2.7d-250)) then
tmp = d * -((l * h) ** (-0.5d0))
else if (h <= 9d+232) then
tmp = d * sqrt((1.0d0 / (l * h)))
else
tmp = sqrt(((d / l) / (h / d)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.7e-250) {
tmp = d * -Math.pow((l * h), -0.5);
} else if (h <= 9e+232) {
tmp = d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = Math.sqrt(((d / l) / (h / d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= -2.7e-250: tmp = d * -math.pow((l * h), -0.5) elif h <= 9e+232: tmp = d * math.sqrt((1.0 / (l * h))) else: tmp = math.sqrt(((d / l) / (h / d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= -2.7e-250) tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); elseif (h <= 9e+232) tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = sqrt(Float64(Float64(d / l) / Float64(h / d))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= -2.7e-250)
tmp = d * -((l * h) ^ -0.5);
elseif (h <= 9e+232)
tmp = d * sqrt((1.0 / (l * h)));
else
tmp = sqrt(((d / l) / (h / d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.7e-250], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[h, 9e+232], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.7 \cdot 10^{-250}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{elif}\;h \leq 9 \cdot 10^{+232}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\end{array}
\end{array}
if h < -2.70000000000000002e-250Initial program 64.7%
associate-*l*64.7%
metadata-eval64.7%
unpow1/264.7%
metadata-eval64.7%
unpow1/264.7%
sub-neg64.7%
+-commutative64.7%
*-commutative64.7%
distribute-rgt-neg-in64.7%
fma-def64.7%
Simplified64.7%
Taylor expanded in h around 0 41.8%
pow1/241.8%
metadata-eval41.8%
metadata-eval41.8%
metadata-eval41.8%
pow-prod-up41.5%
pow-prod-down30.1%
pow230.1%
metadata-eval30.1%
Applied egg-rr30.1%
pow-pow41.8%
metadata-eval41.8%
pow1/241.8%
*-rgt-identity41.8%
pow141.8%
sqrt-unprod29.1%
Applied egg-rr29.1%
unpow129.1%
Simplified29.1%
Taylor expanded in d around -inf 40.1%
associate-*r*40.1%
neg-mul-140.1%
associate-/l/40.7%
associate-/r*40.1%
unpow-140.1%
metadata-eval40.1%
pow-sqr40.1%
rem-sqrt-square40.1%
rem-square-sqrt39.9%
fabs-sqr39.9%
rem-square-sqrt40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-in40.1%
*-commutative40.1%
Simplified40.1%
if -2.70000000000000002e-250 < h < 8.9999999999999995e232Initial program 75.5%
associate-*l*75.5%
metadata-eval75.5%
unpow1/275.5%
metadata-eval75.5%
unpow1/275.5%
sub-neg75.5%
+-commutative75.5%
*-commutative75.5%
distribute-rgt-neg-in75.5%
fma-def75.5%
Simplified73.8%
Taylor expanded in h around 0 40.1%
Taylor expanded in d around 0 44.5%
if 8.9999999999999995e232 < h Initial program 66.4%
associate-*l*66.4%
metadata-eval66.4%
unpow1/266.4%
metadata-eval66.4%
unpow1/266.4%
sub-neg66.4%
+-commutative66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
fma-def66.4%
Simplified66.1%
Taylor expanded in h around 0 58.7%
pow1/258.7%
metadata-eval58.7%
metadata-eval58.7%
metadata-eval58.7%
pow-prod-up58.7%
pow-prod-down50.8%
pow250.8%
metadata-eval50.8%
Applied egg-rr50.8%
pow-pow58.7%
metadata-eval58.7%
pow1/258.7%
*-rgt-identity58.7%
pow158.7%
sqrt-unprod51.3%
Applied egg-rr51.3%
unpow151.3%
Simplified51.3%
*-commutative51.3%
clear-num51.4%
un-div-inv51.4%
Applied egg-rr51.4%
Final simplification42.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -8.5e-196) (sqrt (* (/ d l) (/ d h))) (* d (pow (* l h) -0.5))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8.5e-196) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-8.5d-196)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8.5e-196) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -8.5e-196: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.pow((l * h), -0.5) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -8.5e-196) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -8.5e-196)
tmp = sqrt(((d / l) * (d / h)));
else
tmp = d * ((l * h) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -8.5e-196], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{-196}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -8.50000000000000004e-196Initial program 68.0%
associate-*l*68.0%
metadata-eval68.0%
unpow1/268.0%
metadata-eval68.0%
unpow1/268.0%
sub-neg68.0%
+-commutative68.0%
*-commutative68.0%
distribute-rgt-neg-in68.0%
fma-def68.0%
Simplified68.0%
Taylor expanded in h around 0 46.1%
pow1/246.1%
metadata-eval46.1%
metadata-eval46.1%
metadata-eval46.1%
pow-prod-up45.8%
pow-prod-down34.0%
pow234.0%
metadata-eval34.0%
Applied egg-rr34.0%
pow-pow46.1%
metadata-eval46.1%
pow1/246.1%
*-rgt-identity46.1%
pow146.1%
sqrt-unprod33.7%
Applied egg-rr33.7%
unpow133.7%
Simplified33.7%
if -8.50000000000000004e-196 < l Initial program 71.2%
associate-*l*71.2%
metadata-eval71.2%
unpow1/271.2%
metadata-eval71.2%
unpow1/271.2%
sub-neg71.2%
+-commutative71.2%
*-commutative71.2%
distribute-rgt-neg-in71.2%
fma-def71.2%
Simplified69.8%
Taylor expanded in h around 0 38.4%
pow1/238.4%
metadata-eval38.4%
metadata-eval38.4%
metadata-eval38.4%
pow-prod-up38.3%
pow-prod-down28.2%
pow228.2%
metadata-eval28.2%
Applied egg-rr28.2%
pow-pow38.4%
metadata-eval38.4%
pow1/238.4%
*-rgt-identity38.4%
pow138.4%
sqrt-unprod30.4%
Applied egg-rr30.4%
unpow130.4%
Simplified30.4%
frac-times24.8%
div-inv24.8%
add-exp-log24.2%
add-sqr-sqrt24.2%
swap-sqr26.1%
sqrt-unprod32.4%
add-sqr-sqrt37.0%
*-commutative37.0%
add-exp-log38.2%
inv-pow38.2%
sqrt-pow138.2%
metadata-eval38.2%
Applied egg-rr38.2%
Final simplification36.2%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -6.2e-193) (sqrt (/ d (* h (/ l d)))) (* d (pow (* l h) -0.5))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.2e-193) {
tmp = sqrt((d / (h * (l / d))));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-6.2d-193)) then
tmp = sqrt((d / (h * (l / d))))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.2e-193) {
tmp = Math.sqrt((d / (h * (l / d))));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -6.2e-193: tmp = math.sqrt((d / (h * (l / d)))) else: tmp = d * math.pow((l * h), -0.5) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -6.2e-193) tmp = sqrt(Float64(d / Float64(h * Float64(l / d)))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -6.2e-193)
tmp = sqrt((d / (h * (l / d))));
else
tmp = d * ((l * h) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.2e-193], N[Sqrt[N[(d / N[(h * N[(l / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{-193}:\\
\;\;\;\;\sqrt{\frac{d}{h \cdot \frac{\ell}{d}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -6.2000000000000004e-193Initial program 68.0%
associate-*l*68.0%
metadata-eval68.0%
unpow1/268.0%
metadata-eval68.0%
unpow1/268.0%
sub-neg68.0%
+-commutative68.0%
*-commutative68.0%
distribute-rgt-neg-in68.0%
fma-def68.0%
Simplified68.0%
Taylor expanded in h around 0 46.1%
pow1/246.1%
metadata-eval46.1%
metadata-eval46.1%
metadata-eval46.1%
pow-prod-up45.8%
pow-prod-down34.0%
pow234.0%
metadata-eval34.0%
Applied egg-rr34.0%
pow-pow46.1%
metadata-eval46.1%
pow1/246.1%
*-rgt-identity46.1%
pow146.1%
sqrt-unprod33.7%
Applied egg-rr33.7%
unpow133.7%
Simplified33.7%
*-commutative33.7%
clear-num33.7%
frac-times33.7%
*-un-lft-identity33.7%
Applied egg-rr33.7%
if -6.2000000000000004e-193 < l Initial program 71.2%
associate-*l*71.2%
metadata-eval71.2%
unpow1/271.2%
metadata-eval71.2%
unpow1/271.2%
sub-neg71.2%
+-commutative71.2%
*-commutative71.2%
distribute-rgt-neg-in71.2%
fma-def71.2%
Simplified69.8%
Taylor expanded in h around 0 38.4%
pow1/238.4%
metadata-eval38.4%
metadata-eval38.4%
metadata-eval38.4%
pow-prod-up38.3%
pow-prod-down28.2%
pow228.2%
metadata-eval28.2%
Applied egg-rr28.2%
pow-pow38.4%
metadata-eval38.4%
pow1/238.4%
*-rgt-identity38.4%
pow138.4%
sqrt-unprod30.4%
Applied egg-rr30.4%
unpow130.4%
Simplified30.4%
frac-times24.8%
div-inv24.8%
add-exp-log24.2%
add-sqr-sqrt24.2%
swap-sqr26.1%
sqrt-unprod32.4%
add-sqr-sqrt37.0%
*-commutative37.0%
add-exp-log38.2%
inv-pow38.2%
sqrt-pow138.2%
metadata-eval38.2%
Applied egg-rr38.2%
Final simplification36.2%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 * ((l * h) ** (-0.5d0))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * ((l * h) ^ -0.5);
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 69.8%
associate-*l*69.8%
metadata-eval69.8%
unpow1/269.8%
metadata-eval69.8%
unpow1/269.8%
sub-neg69.8%
+-commutative69.8%
*-commutative69.8%
distribute-rgt-neg-in69.8%
fma-def69.8%
Simplified69.0%
Taylor expanded in h around 0 41.8%
pow1/241.8%
metadata-eval41.8%
metadata-eval41.8%
metadata-eval41.8%
pow-prod-up41.6%
pow-prod-down30.7%
pow230.7%
metadata-eval30.7%
Applied egg-rr30.7%
pow-pow41.8%
metadata-eval41.8%
pow1/241.8%
*-rgt-identity41.8%
pow141.8%
sqrt-unprod31.8%
Applied egg-rr31.8%
unpow131.8%
Simplified31.8%
frac-times22.9%
div-inv22.9%
add-exp-log22.1%
add-sqr-sqrt22.1%
swap-sqr25.2%
sqrt-unprod18.9%
add-sqr-sqrt23.0%
*-commutative23.0%
add-exp-log23.7%
inv-pow23.7%
sqrt-pow123.7%
metadata-eval23.7%
Applied egg-rr23.7%
Final simplification23.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return d / math.sqrt((l * h))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d / sqrt((l * h));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 69.8%
associate-*l*69.8%
metadata-eval69.8%
unpow1/269.8%
metadata-eval69.8%
unpow1/269.8%
sub-neg69.8%
+-commutative69.8%
*-commutative69.8%
distribute-rgt-neg-in69.8%
fma-def69.8%
Simplified69.0%
Taylor expanded in h around 0 41.8%
pow1/241.8%
metadata-eval41.8%
metadata-eval41.8%
metadata-eval41.8%
pow-prod-up41.6%
pow-prod-down30.7%
pow230.7%
metadata-eval30.7%
Applied egg-rr30.7%
pow-pow41.8%
metadata-eval41.8%
pow1/241.8%
*-rgt-identity41.8%
pow141.8%
sqrt-unprod31.8%
Applied egg-rr31.8%
unpow131.8%
Simplified31.8%
expm1-log1p-u31.0%
expm1-udef21.5%
frac-times17.2%
sqrt-div18.8%
sqrt-unprod14.8%
add-sqr-sqrt16.1%
Applied egg-rr16.1%
expm1-def19.3%
expm1-log1p23.7%
*-commutative23.7%
Simplified23.7%
Final simplification23.7%
herbie shell --seed 2023258
(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)))))