
(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 22 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: d, h, l, 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 M) (* d 2.0))))
(if (<= d -5e-182)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (/ (* h (* (* 0.5 (* D (* 0.5 M))) t_0)) (* d l))))
(if (<= d 2.2e-253)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(*
(* (/ (sqrt d) (sqrt h)) (/ (sqrt d) (sqrt l)))
(+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0)))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = (D * M) / (d * 2.0);
double tmp;
if (d <= -5e-182) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((h * ((0.5 * (D * (0.5 * M))) * t_0)) / (d * l)));
} else if (d <= 2.2e-253) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else {
tmp = ((sqrt(d) / sqrt(h)) * (sqrt(d) / sqrt(l))) * (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0))));
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64(D * M) / Float64(d * 2.0)) tmp = 0.0 if (d <= -5e-182) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(0.5 * Float64(D * Float64(0.5 * M))) * t_0)) / Float64(d * l)))); elseif (d <= 2.2e-253) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * Float64(sqrt(d) / sqrt(l))) * Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0))))); end return tmp end
NOTE: d, h, l, 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[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-182], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(0.5 * N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.2e-253], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \frac{D \cdot M}{d \cdot 2}\\
\mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot t\_0\right)}{d \cdot \ell}\right)\\
\mathbf{elif}\;d \leq 2.2 \cdot 10^{-253}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\
\end{array}
\end{array}
if d < -5.00000000000000024e-182Initial program 76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
lift-*.f64N/A
metadata-eval75.4
Applied rewrites75.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites79.9%
if -5.00000000000000024e-182 < d < 2.19999999999999996e-253Initial program 14.7%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites18.1%
Applied rewrites17.6%
Applied rewrites62.4%
if 2.19999999999999996e-253 < d Initial program 72.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6485.2
Applied rewrites85.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6488.4
Applied rewrites88.4%
Final simplification81.1%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+ 1.0 (* (/ h l) (* (pow (/ (* D M) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
(t_1 (* t_0 (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))))))
(if (<= t_1 2e+225)
(* (* (sqrt (/ d h)) (sqrt (/ d l))) t_0)
(if (<= t_1 INFINITY)
(/ d (* (sqrt h) (sqrt l)))
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h / l) * (pow(((D * M) / (d * 2.0)), 2.0) * (-1.0 / 2.0)));
double t_1 = t_0 * (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= 2e+225) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) t_1 = Float64(t_0 * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= 2e+225) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * t_0); elseif (t_1 <= Inf) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); end return tmp end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+225], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := 1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\\
t_1 := t\_0 \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+225}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999986e225Initial program 87.0%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6487.0
Applied rewrites87.0%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6487.0
Applied rewrites87.0%
if 1.99999999999999986e225 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 55.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6469.7
Applied rewrites69.7%
Applied rewrites69.7%
Applied rewrites71.5%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites13.6%
Applied rewrites19.2%
Applied rewrites48.7%
Final simplification77.2%
NOTE: d, h, l, 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 M) (* d 2.0)))
(t_1
(*
(+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0))))
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))))))
(if (<= t_1 2e+225)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(+ 1.0 (* (/ h l) (* (/ (* t_0 (* 0.5 (* D M))) d) (/ -1.0 2.0)))))
(if (<= t_1 INFINITY)
(/ d (* (sqrt h) (sqrt l)))
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = (D * M) / (d * 2.0);
double t_1 = (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0)))) * (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0)));
double tmp;
if (t_1 <= 2e+225) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 + ((h / l) * (((t_0 * (0.5 * (D * M))) / d) * (-1.0 / 2.0))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64(D * M) / Float64(d * 2.0)) t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_1 <= 2e+225) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 + Float64(Float64(h / l) * Float64(Float64(Float64(t_0 * Float64(0.5 * Float64(D * M))) / d) * Float64(-1.0 / 2.0))))); elseif (t_1 <= Inf) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); end return tmp end
NOTE: d, h, l, 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[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+225], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[(N[(t$95$0 * N[(0.5 * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \frac{D \cdot M}{d \cdot 2}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+225}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left(\frac{t\_0 \cdot \left(0.5 \cdot \left(D \cdot M\right)\right)}{d} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999986e225Initial program 87.0%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6487.0
Applied rewrites87.0%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6487.0
Applied rewrites87.0%
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
lift-*.f64N/A
metadata-eval86.5
Applied rewrites86.5%
if 1.99999999999999986e225 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 55.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6469.7
Applied rewrites69.7%
Applied rewrites69.7%
Applied rewrites71.5%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites13.6%
Applied rewrites19.2%
Applied rewrites48.7%
Final simplification76.8%
NOTE: d, h, l, 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 M) (* d 2.0))) (t_1 (sqrt (/ d l))))
(if (<= d -5e-182)
(*
(* (sqrt (/ d h)) t_1)
(- 1.0 (/ (* h (* (* 0.5 (* D (* 0.5 M))) t_0)) (* d l))))
(if (<= d 2.5e-216)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(*
(+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0))))
(* t_1 (/ (sqrt d) (sqrt h))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = (D * M) / (d * 2.0);
double t_1 = sqrt((d / l));
double tmp;
if (d <= -5e-182) {
tmp = (sqrt((d / h)) * t_1) * (1.0 - ((h * ((0.5 * (D * (0.5 * M))) * t_0)) / (d * l)));
} else if (d <= 2.5e-216) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else {
tmp = (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0)))) * (t_1 * (sqrt(d) / sqrt(h)));
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64(D * M) / Float64(d * 2.0)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (d <= -5e-182) tmp = Float64(Float64(sqrt(Float64(d / h)) * t_1) * Float64(1.0 - Float64(Float64(h * Float64(Float64(0.5 * Float64(D * Float64(0.5 * M))) * t_0)) / Float64(d * l)))); elseif (d <= 2.5e-216) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); else tmp = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64(t_1 * Float64(sqrt(d) / sqrt(h)))); end return tmp end
NOTE: d, h, l, 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[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -5e-182], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(0.5 * N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.5e-216], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \frac{D \cdot M}{d \cdot 2}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t\_1\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot t\_0\right)}{d \cdot \ell}\right)\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{-216}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if d < -5.00000000000000024e-182Initial program 76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
lift-*.f64N/A
metadata-eval75.4
Applied rewrites75.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites79.9%
if -5.00000000000000024e-182 < d < 2.5000000000000001e-216Initial program 21.3%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites19.9%
Applied rewrites21.7%
Applied rewrites61.7%
if 2.5000000000000001e-216 < d Initial program 73.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6473.1
Applied rewrites73.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-/.f6487.0
Applied rewrites87.0%
Final simplification79.7%
NOTE: d, h, l, 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 (<= d -5e-182)
(*
(* t_0 (sqrt (/ d l)))
(-
1.0
(/ (* h (* (* 0.5 (* D (* 0.5 M))) (/ (* D M) (* d 2.0)))) (* d l))))
(if (<= d 1.35e-198)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(if (<= d 3.05e+153)
(*
(sqrt d)
(*
(sqrt (/ 1.0 l))
(*
t_0
(fma
(/ (* M (* D (* D M))) (* (* d d) 4.0))
(* (/ h l) -0.5)
1.0))))
(/ d (sqrt (/ 1.0 (/ (/ 1.0 l) h)))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (d <= -5e-182) {
tmp = (t_0 * sqrt((d / l))) * (1.0 - ((h * ((0.5 * (D * (0.5 * M))) * ((D * M) / (d * 2.0)))) / (d * l)));
} else if (d <= 1.35e-198) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else if (d <= 3.05e+153) {
tmp = sqrt(d) * (sqrt((1.0 / l)) * (t_0 * fma(((M * (D * (D * M))) / ((d * d) * 4.0)), ((h / l) * -0.5), 1.0)));
} else {
tmp = d / sqrt((1.0 / ((1.0 / l) / h)));
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (d <= -5e-182) tmp = Float64(Float64(t_0 * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(0.5 * Float64(D * Float64(0.5 * M))) * Float64(Float64(D * M) / Float64(d * 2.0)))) / Float64(d * l)))); elseif (d <= 1.35e-198) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); elseif (d <= 3.05e+153) tmp = Float64(sqrt(d) * Float64(sqrt(Float64(1.0 / l)) * Float64(t_0 * fma(Float64(Float64(M * Float64(D * Float64(D * M))) / Float64(Float64(d * d) * 4.0)), Float64(Float64(h / l) * -0.5), 1.0)))); else tmp = Float64(d / sqrt(Float64(1.0 / Float64(Float64(1.0 / l) / h)))); end return tmp end
NOTE: d, h, l, 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[d, -5e-182], N[(N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(0.5 * N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.35e-198], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 3.05e+153], N[(N[Sqrt[d], $MachinePrecision] * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(1.0 / N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\
\;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot \frac{D \cdot M}{d \cdot 2}\right)}{d \cdot \ell}\right)\\
\mathbf{elif}\;d \leq 1.35 \cdot 10^{-198}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{elif}\;d \leq 3.05 \cdot 10^{+153}:\\
\;\;\;\;\sqrt{d} \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \left(t\_0 \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(D \cdot M\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\frac{1}{\frac{\frac{1}{\ell}}{h}}}}\\
\end{array}
\end{array}
if d < -5.00000000000000024e-182Initial program 76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
lift-*.f64N/A
metadata-eval75.4
Applied rewrites75.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites79.9%
if -5.00000000000000024e-182 < d < 1.3500000000000001e-198Initial program 24.1%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites24.9%
Applied rewrites26.6%
Applied rewrites64.1%
if 1.3500000000000001e-198 < d < 3.0499999999999999e153Initial program 81.2%
Applied rewrites84.0%
if 3.0499999999999999e153 < d Initial program 61.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6477.3
Applied rewrites77.3%
Applied rewrites77.4%
Applied rewrites77.4%
Applied rewrites77.4%
Final simplification77.5%
NOTE: d, h, l, 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 (/ 1.0 (* h l)))))
(if (<= d -7.6e+160)
(* t_0 (- d))
(if (<= d -6.8e-148)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(fma
-0.5
(/ (* h (/ (* (* D M) (* 0.5 (* D M))) (* d (* d 2.0)))) l)
1.0))
(if (<= d 1.15e-204)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(if (<= d 2.5e+101)
(/
(*
(/ d (sqrt l))
(+
1.0
(/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0)))))
(sqrt h))
(/ d (/ 1.0 t_0))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double tmp;
if (d <= -7.6e+160) {
tmp = t_0 * -d;
} else if (d <= -6.8e-148) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * fma(-0.5, ((h * (((D * M) * (0.5 * (D * M))) / (d * (d * 2.0)))) / l), 1.0);
} else if (d <= 1.15e-204) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else if (d <= 2.5e+101) {
tmp = ((d / sqrt(l)) * (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0))))) / sqrt(h);
} else {
tmp = d / (1.0 / t_0);
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) tmp = 0.0 if (d <= -7.6e+160) tmp = Float64(t_0 * Float64(-d)); elseif (d <= -6.8e-148) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(-0.5, Float64(Float64(h * Float64(Float64(Float64(D * M) * Float64(0.5 * Float64(D * M))) / Float64(d * Float64(d * 2.0)))) / l), 1.0)); elseif (d <= 1.15e-204) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); elseif (d <= 2.5e+101) tmp = Float64(Float64(Float64(d / sqrt(l)) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0))))) / sqrt(h)); else tmp = Float64(d / Float64(1.0 / t_0)); end return tmp end
NOTE: d, h, l, 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[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -7.6e+160], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -6.8e-148], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(N[(h * N[(N[(N[(D * M), $MachinePrecision] * N[(0.5 * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -7.6 \cdot 10^{+160}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -6.8 \cdot 10^{-148}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(-0.5, \frac{h \cdot \frac{\left(D \cdot M\right) \cdot \left(0.5 \cdot \left(D \cdot M\right)\right)}{d \cdot \left(d \cdot 2\right)}}{\ell}, 1\right)\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if d < -7.60000000000000024e160Initial program 59.3%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6461.5
Applied rewrites61.5%
if -7.60000000000000024e160 < d < -6.8000000000000005e-148Initial program 81.0%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6481.0
Applied rewrites81.0%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6481.0
Applied rewrites81.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites85.5%
if -6.8000000000000005e-148 < d < 1.15e-204Initial program 30.5%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites21.5%
Applied rewrites23.1%
Applied rewrites62.3%
if 1.15e-204 < d < 2.49999999999999994e101Initial program 79.4%
Applied rewrites83.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-/.f64N/A
lower-sqrt.f6487.8
Applied rewrites84.3%
if 2.49999999999999994e101 < d Initial program 64.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites78.2%
Final simplification76.8%
NOTE: d, h, l, 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 (/ 1.0 (* h l))))
(t_1
(+ 1.0 (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0))))))
(if (<= d -1.25e+111)
(* t_0 (- d))
(if (<= d -4.6e-126)
(* (sqrt (/ d l)) (* (sqrt (/ d h)) t_1))
(if (<= d 1.15e-204)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(if (<= d 2.5e+101)
(/ (* (/ d (sqrt l)) t_1) (sqrt h))
(/ d (/ 1.0 t_0))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double t_1 = 1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)));
double tmp;
if (d <= -1.25e+111) {
tmp = t_0 * -d;
} else if (d <= -4.6e-126) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * t_1);
} else if (d <= 1.15e-204) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else if (d <= 2.5e+101) {
tmp = ((d / sqrt(l)) * t_1) / sqrt(h);
} else {
tmp = d / (1.0 / t_0);
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) t_1 = Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0)))) tmp = 0.0 if (d <= -1.25e+111) tmp = Float64(t_0 * Float64(-d)); elseif (d <= -4.6e-126) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * t_1)); elseif (d <= 1.15e-204) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); elseif (d <= 2.5e+101) tmp = Float64(Float64(Float64(d / sqrt(l)) * t_1) / sqrt(h)); else tmp = Float64(d / Float64(1.0 / t_0)); end return tmp end
NOTE: d, h, l, 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[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -4.6e-126], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
t_1 := 1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -4.6 \cdot 10^{-126}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot t\_1}{\sqrt{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if d < -1.2499999999999999e111Initial program 63.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if -1.2499999999999999e111 < d < -4.60000000000000021e-126Initial program 84.8%
Applied rewrites0.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lift-/.f64N/A
unpow1/2N/A
metadata-evalN/A
lift-/.f64N/A
lift-pow.f64N/A
associate-*l*N/A
Applied rewrites87.0%
if -4.60000000000000021e-126 < d < 1.15e-204Initial program 33.7%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites20.0%
Applied rewrites21.4%
Applied rewrites61.0%
if 1.15e-204 < d < 2.49999999999999994e101Initial program 79.4%
Applied rewrites83.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-/.f64N/A
lower-sqrt.f6487.8
Applied rewrites84.3%
if 2.49999999999999994e101 < d Initial program 64.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites78.2%
Final simplification75.1%
NOTE: d, h, l, 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 (/ 1.0 (* h l)))))
(if (<= d -1.25e+111)
(* t_0 (- d))
(if (<= d -8.5e-118)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(fma (* D (* D (* h (* M M)))) (/ -0.125 (* l (* d d))) 1.0))
(if (<= d 1.15e-204)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(if (<= d 2.5e+101)
(/
(*
(/ d (sqrt l))
(+
1.0
(/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0)))))
(sqrt h))
(/ d (/ 1.0 t_0))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double tmp;
if (d <= -1.25e+111) {
tmp = t_0 * -d;
} else if (d <= -8.5e-118) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * fma((D * (D * (h * (M * M)))), (-0.125 / (l * (d * d))), 1.0);
} else if (d <= 1.15e-204) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else if (d <= 2.5e+101) {
tmp = ((d / sqrt(l)) * (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0))))) / sqrt(h);
} else {
tmp = d / (1.0 / t_0);
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) tmp = 0.0 if (d <= -1.25e+111) tmp = Float64(t_0 * Float64(-d)); elseif (d <= -8.5e-118) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(Float64(D * Float64(D * Float64(h * Float64(M * M)))), Float64(-0.125 / Float64(l * Float64(d * d))), 1.0)); elseif (d <= 1.15e-204) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); elseif (d <= 2.5e+101) tmp = Float64(Float64(Float64(d / sqrt(l)) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0))))) / sqrt(h)); else tmp = Float64(d / Float64(1.0 / t_0)); end return tmp end
NOTE: d, h, l, 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[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -8.5e-118], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if d < -1.2499999999999999e111Initial program 63.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if -1.2499999999999999e111 < d < -8.50000000000000087e-118Initial program 86.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6486.1
Applied rewrites86.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6486.1
Applied rewrites86.1%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6486.3
Applied rewrites86.3%
if -8.50000000000000087e-118 < d < 1.15e-204Initial program 34.3%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites19.4%
Applied rewrites20.6%
Applied rewrites60.6%
if 1.15e-204 < d < 2.49999999999999994e101Initial program 79.4%
Applied rewrites83.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-/.f64N/A
lower-sqrt.f6487.8
Applied rewrites84.3%
if 2.49999999999999994e101 < d Initial program 64.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites78.2%
Final simplification74.7%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-182)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(-
1.0
(/ (* h (* (* 0.5 (* D (* 0.5 M))) (/ (* D M) (* d 2.0)))) (* d l))))
(if (<= d 1.15e-204)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(if (<= d 2.5e+101)
(/
(*
(/ d (sqrt l))
(+ 1.0 (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0)))))
(sqrt h))
(/ d (/ 1.0 (sqrt (/ 1.0 (* h l)))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-182) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((h * ((0.5 * (D * (0.5 * M))) * ((D * M) / (d * 2.0)))) / (d * l)));
} else if (d <= 1.15e-204) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else if (d <= 2.5e+101) {
tmp = ((d / sqrt(l)) * (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0))))) / sqrt(h);
} else {
tmp = d / (1.0 / sqrt((1.0 / (h * l))));
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-182) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(0.5 * Float64(D * Float64(0.5 * M))) * Float64(Float64(D * M) / Float64(d * 2.0)))) / Float64(d * l)))); elseif (d <= 1.15e-204) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); elseif (d <= 2.5e+101) tmp = Float64(Float64(Float64(d / sqrt(l)) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0))))) / sqrt(h)); else tmp = Float64(d / Float64(1.0 / sqrt(Float64(1.0 / Float64(h * l))))); end return tmp end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-182], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(0.5 * N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot \frac{D \cdot M}{d \cdot 2}\right)}{d \cdot \ell}\right)\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\
\end{array}
\end{array}
if d < -5.00000000000000024e-182Initial program 76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6476.3
Applied rewrites76.3%
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
lift-*.f64N/A
metadata-eval75.4
Applied rewrites75.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites79.9%
if -5.00000000000000024e-182 < d < 1.15e-204Initial program 24.6%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites23.3%
Applied rewrites25.0%
Applied rewrites63.3%
if 1.15e-204 < d < 2.49999999999999994e101Initial program 79.4%
Applied rewrites83.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-/.f64N/A
lower-sqrt.f6487.8
Applied rewrites84.3%
if 2.49999999999999994e101 < d Initial program 64.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites78.2%
Final simplification77.5%
NOTE: d, h, l, 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 (/ 1.0 (* h l)))))
(if (<= d -1.25e+111)
(* t_0 (- d))
(if (<= d -8.5e-118)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(fma (* D (* D (* h (* M M)))) (/ -0.125 (* l (* d d))) 1.0))
(if (<= d 1.7e+101)
(/
(fma
(* (* M (* M (* D -0.125))) (/ D l))
(sqrt (/ h l))
(/ (* d d) (sqrt (* h l))))
d)
(/ d (/ 1.0 t_0)))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double tmp;
if (d <= -1.25e+111) {
tmp = t_0 * -d;
} else if (d <= -8.5e-118) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * fma((D * (D * (h * (M * M)))), (-0.125 / (l * (d * d))), 1.0);
} else if (d <= 1.7e+101) {
tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
} else {
tmp = d / (1.0 / t_0);
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) tmp = 0.0 if (d <= -1.25e+111) tmp = Float64(t_0 * Float64(-d)); elseif (d <= -8.5e-118) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(Float64(D * Float64(D * Float64(h * Float64(M * M)))), Float64(-0.125 / Float64(l * Float64(d * d))), 1.0)); elseif (d <= 1.7e+101) tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d); else tmp = Float64(d / Float64(1.0 / t_0)); end return tmp end
NOTE: d, h, l, 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[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -8.5e-118], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.7e+101], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{+101}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if d < -1.2499999999999999e111Initial program 63.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if -1.2499999999999999e111 < d < -8.50000000000000087e-118Initial program 86.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6486.1
Applied rewrites86.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6486.1
Applied rewrites86.1%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6486.3
Applied rewrites86.3%
if -8.50000000000000087e-118 < d < 1.70000000000000009e101Initial program 56.9%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites34.6%
Applied rewrites44.6%
Applied rewrites66.6%
if 1.70000000000000009e101 < d Initial program 64.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites78.2%
Final simplification72.1%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (* D (* D M))))
(t_1 (sqrt (/ 1.0 (* h l))))
(t_2 (sqrt (/ h (* l (* l l))))))
(if (<= d -1.25e+111)
(* t_1 (- d))
(if (<= d -2.1e-122)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(fma (* D (* D (* h (* M M)))) (/ -0.125 (* l (* d d))) 1.0))
(if (<= d -2.4e-302)
(* t_0 (* t_2 (/ 0.125 d)))
(if (<= d 8e-206)
(* t_2 (* (* D D) (/ (* -0.125 (* M M)) d)))
(if (<= d 2.5e+101)
(*
(+ 1.0 (/ (* t_0 (* h -0.5)) (* l (* (* d d) 4.0))))
(/ d (sqrt (* h l))))
(/ d (/ 1.0 t_1)))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D * (D * M));
double t_1 = sqrt((1.0 / (h * l)));
double t_2 = sqrt((h / (l * (l * l))));
double tmp;
if (d <= -1.25e+111) {
tmp = t_1 * -d;
} else if (d <= -2.1e-122) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * fma((D * (D * (h * (M * M)))), (-0.125 / (l * (d * d))), 1.0);
} else if (d <= -2.4e-302) {
tmp = t_0 * (t_2 * (0.125 / d));
} else if (d <= 8e-206) {
tmp = t_2 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (d <= 2.5e+101) {
tmp = (1.0 + ((t_0 * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / sqrt((h * l)));
} else {
tmp = d / (1.0 / t_1);
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(M * Float64(D * Float64(D * M))) t_1 = sqrt(Float64(1.0 / Float64(h * l))) t_2 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (d <= -1.25e+111) tmp = Float64(t_1 * Float64(-d)); elseif (d <= -2.1e-122) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(Float64(D * Float64(D * Float64(h * Float64(M * M)))), Float64(-0.125 / Float64(l * Float64(d * d))), 1.0)); elseif (d <= -2.4e-302) tmp = Float64(t_0 * Float64(t_2 * Float64(0.125 / d))); elseif (d <= 8e-206) tmp = Float64(t_2 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); elseif (d <= 2.5e+101) tmp = Float64(Float64(1.0 + Float64(Float64(t_0 * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0)))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(1.0 / t_1)); end return tmp end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$1 * (-d)), $MachinePrecision], If[LessEqual[d, -2.1e-122], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.4e-302], N[(t$95$0 * N[(t$95$2 * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8e-206], N[(t$95$2 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(1.0 + N[(N[(t$95$0 * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := M \cdot \left(D \cdot \left(D \cdot M\right)\right)\\
t_1 := \sqrt{\frac{1}{h \cdot \ell}}\\
t_2 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
\;\;\;\;t\_1 \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -2.1 \cdot 10^{-122}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\
\mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \frac{0.125}{d}\right)\\
\mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\
\;\;\;\;t\_2 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;\left(1 + \frac{t\_0 \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\frac{1}{t\_1}}\\
\end{array}
\end{array}
if d < -1.2499999999999999e111Initial program 63.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if -1.2499999999999999e111 < d < -2.09999999999999992e-122Initial program 84.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6484.5
Applied rewrites84.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6484.5
Applied rewrites84.5%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6484.8
Applied rewrites84.8%
if -2.09999999999999992e-122 < d < -2.40000000000000022e-302Initial program 35.0%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites42.3%
Applied rewrites48.9%
if -2.40000000000000022e-302 < d < 8.00000000000000023e-206Initial program 34.6%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.1%
if 8.00000000000000023e-206 < d < 2.49999999999999994e101Initial program 79.4%
Applied rewrites83.1%
Applied rewrites72.4%
if 2.49999999999999994e101 < d Initial program 64.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites78.2%
Final simplification69.1%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (* D (* D M))))
(t_1 (sqrt (/ h (* l (* l l)))))
(t_2 (sqrt (/ 1.0 (* h l))))
(t_3 (* (* d d) 4.0)))
(if (<= d -1.6e+123)
(* t_2 (- d))
(if (<= d -2.5e-130)
(* (fma (/ t_0 t_3) (* (/ h l) -0.5) 1.0) (sqrt (/ (* d d) (* h l))))
(if (<= d -2.4e-302)
(* t_0 (* t_1 (/ 0.125 d)))
(if (<= d 8e-206)
(* t_1 (* (* D D) (/ (* -0.125 (* M M)) d)))
(if (<= d 2.5e+101)
(* (+ 1.0 (/ (* t_0 (* h -0.5)) (* l t_3))) (/ d (sqrt (* h l))))
(/ d (/ 1.0 t_2)))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D * (D * M));
double t_1 = sqrt((h / (l * (l * l))));
double t_2 = sqrt((1.0 / (h * l)));
double t_3 = (d * d) * 4.0;
double tmp;
if (d <= -1.6e+123) {
tmp = t_2 * -d;
} else if (d <= -2.5e-130) {
tmp = fma((t_0 / t_3), ((h / l) * -0.5), 1.0) * sqrt(((d * d) / (h * l)));
} else if (d <= -2.4e-302) {
tmp = t_0 * (t_1 * (0.125 / d));
} else if (d <= 8e-206) {
tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (d <= 2.5e+101) {
tmp = (1.0 + ((t_0 * (h * -0.5)) / (l * t_3))) * (d / sqrt((h * l)));
} else {
tmp = d / (1.0 / t_2);
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(M * Float64(D * Float64(D * M))) t_1 = sqrt(Float64(h / Float64(l * Float64(l * l)))) t_2 = sqrt(Float64(1.0 / Float64(h * l))) t_3 = Float64(Float64(d * d) * 4.0) tmp = 0.0 if (d <= -1.6e+123) tmp = Float64(t_2 * Float64(-d)); elseif (d <= -2.5e-130) tmp = Float64(fma(Float64(t_0 / t_3), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(Float64(Float64(d * d) / Float64(h * l)))); elseif (d <= -2.4e-302) tmp = Float64(t_0 * Float64(t_1 * Float64(0.125 / d))); elseif (d <= 8e-206) tmp = Float64(t_1 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); elseif (d <= 2.5e+101) tmp = Float64(Float64(1.0 + Float64(Float64(t_0 * Float64(h * -0.5)) / Float64(l * t_3))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(1.0 / t_2)); end return tmp end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[d, -1.6e+123], N[(t$95$2 * (-d)), $MachinePrecision], If[LessEqual[d, -2.5e-130], N[(N[(N[(t$95$0 / t$95$3), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.4e-302], N[(t$95$0 * N[(t$95$1 * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8e-206], N[(t$95$1 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(1.0 + N[(N[(t$95$0 * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := M \cdot \left(D \cdot \left(D \cdot M\right)\right)\\
t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
t_2 := \sqrt{\frac{1}{h \cdot \ell}}\\
t_3 := \left(d \cdot d\right) \cdot 4\\
\mathbf{if}\;d \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;t\_2 \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -2.5 \cdot 10^{-130}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0}{t\_3}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{0.125}{d}\right)\\
\mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\
\;\;\;\;t\_1 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;\left(1 + \frac{t\_0 \cdot \left(h \cdot -0.5\right)}{\ell \cdot t\_3}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\frac{1}{t\_2}}\\
\end{array}
\end{array}
if d < -1.60000000000000002e123Initial program 61.0%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if -1.60000000000000002e123 < d < -2.4999999999999998e-130Initial program 82.5%
Applied rewrites70.6%
if -2.4999999999999998e-130 < d < -2.40000000000000022e-302Initial program 31.8%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites43.1%
Applied rewrites50.2%
if -2.40000000000000022e-302 < d < 8.00000000000000023e-206Initial program 34.6%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.1%
if 8.00000000000000023e-206 < d < 2.49999999999999994e101Initial program 79.4%
Applied rewrites83.1%
Applied rewrites72.4%
if 2.49999999999999994e101 < d Initial program 64.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites78.2%
Final simplification66.9%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.6e+59)
(* (sqrt (/ 1.0 (* h l))) (- d))
(if (<= l -4.5e-303)
(* (* D (sqrt (/ h (* l (* l l))))) (/ (* M (* D M)) (* d 8.0)))
(if (<= l 8.5e+38)
(*
(+ 1.0 (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0))))
(/ d (sqrt (* h l))))
(/ d (* (sqrt h) (sqrt l)))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.6e+59) {
tmp = sqrt((1.0 / (h * l))) * -d;
} else if (l <= -4.5e-303) {
tmp = (D * sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0));
} else if (l <= 8.5e+38) {
tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / sqrt((h * l)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
NOTE: d, h, l, 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 <= (-2.6d+59)) then
tmp = sqrt((1.0d0 / (h * l))) * -d
else if (l <= (-4.5d-303)) then
tmp = (d_1 * sqrt((h / (l * (l * l))))) * ((m * (d_1 * m)) / (d * 8.0d0))
else if (l <= 8.5d+38) then
tmp = (1.0d0 + (((m * (d_1 * (d_1 * m))) * (h * (-0.5d0))) / (l * ((d * d) * 4.0d0)))) * (d / sqrt((h * l)))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.6e+59) {
tmp = Math.sqrt((1.0 / (h * l))) * -d;
} else if (l <= -4.5e-303) {
tmp = (D * Math.sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0));
} else if (l <= 8.5e+38) {
tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / Math.sqrt((h * l)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -2.6e+59: tmp = math.sqrt((1.0 / (h * l))) * -d elif l <= -4.5e-303: tmp = (D * math.sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0)) elif l <= 8.5e+38: tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / math.sqrt((h * l))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.6e+59) tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d)); elseif (l <= -4.5e-303) tmp = Float64(Float64(D * sqrt(Float64(h / Float64(l * Float64(l * l))))) * Float64(Float64(M * Float64(D * M)) / Float64(d * 8.0))); elseif (l <= 8.5e+38) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0)))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -2.6e+59)
tmp = sqrt((1.0 / (h * l))) * -d;
elseif (l <= -4.5e-303)
tmp = (D * sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0));
elseif (l <= 8.5e+38)
tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / sqrt((h * l)));
else
tmp = d / (sqrt(h) * sqrt(l));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.6e+59], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, -4.5e-303], N[(N[(D * N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e+38], N[(N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.6 \cdot 10^{+59}:\\
\;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
\mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\
\;\;\;\;\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+38}:\\
\;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.59999999999999999e59Initial program 57.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6460.7
Applied rewrites60.7%
if -2.59999999999999999e59 < l < -4.5000000000000001e-303Initial program 70.2%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites47.5%
Applied rewrites50.5%
if -4.5000000000000001e-303 < l < 8.4999999999999997e38Initial program 80.4%
Applied rewrites73.6%
Applied rewrites72.3%
if 8.4999999999999997e38 < l Initial program 46.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6461.0
Applied rewrites61.0%
Applied rewrites60.9%
Applied rewrites64.4%
Final simplification62.2%
NOTE: d, h, l, 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 h) (sqrt l)))) (t_1 (sqrt (/ h (* l (* l l))))))
(if (<= l -1.5e-206)
(* (sqrt (/ 1.0 (* h l))) (- d))
(if (<= l -4.5e-303)
(* t_1 (* (/ 0.125 d) (* D (* D (* M M)))))
(if (<= l 6.5e-226)
t_0
(if (<= l 1.6e-145)
(* t_1 (* (* D D) (/ (* -0.125 (* M M)) d)))
t_0))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = d / (sqrt(h) * sqrt(l));
double t_1 = sqrt((h / (l * (l * l))));
double tmp;
if (l <= -1.5e-206) {
tmp = sqrt((1.0 / (h * l))) * -d;
} else if (l <= -4.5e-303) {
tmp = t_1 * ((0.125 / d) * (D * (D * (M * M))));
} else if (l <= 6.5e-226) {
tmp = t_0;
} else if (l <= 1.6e-145) {
tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: d, h, l, 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 = d / (sqrt(h) * sqrt(l))
t_1 = sqrt((h / (l * (l * l))))
if (l <= (-1.5d-206)) then
tmp = sqrt((1.0d0 / (h * l))) * -d
else if (l <= (-4.5d-303)) then
tmp = t_1 * ((0.125d0 / d) * (d_1 * (d_1 * (m * m))))
else if (l <= 6.5d-226) then
tmp = t_0
else if (l <= 1.6d-145) then
tmp = t_1 * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
else
tmp = t_0
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d / (Math.sqrt(h) * Math.sqrt(l));
double t_1 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (l <= -1.5e-206) {
tmp = Math.sqrt((1.0 / (h * l))) * -d;
} else if (l <= -4.5e-303) {
tmp = t_1 * ((0.125 / d) * (D * (D * (M * M))));
} else if (l <= 6.5e-226) {
tmp = t_0;
} else if (l <= 1.6e-145) {
tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
} else {
tmp = t_0;
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = d / (math.sqrt(h) * math.sqrt(l)) t_1 = math.sqrt((h / (l * (l * l)))) tmp = 0 if l <= -1.5e-206: tmp = math.sqrt((1.0 / (h * l))) * -d elif l <= -4.5e-303: tmp = t_1 * ((0.125 / d) * (D * (D * (M * M)))) elif l <= 6.5e-226: tmp = t_0 elif l <= 1.6e-145: tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d)) else: tmp = t_0 return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(d / Float64(sqrt(h) * sqrt(l))) t_1 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (l <= -1.5e-206) tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d)); elseif (l <= -4.5e-303) tmp = Float64(t_1 * Float64(Float64(0.125 / d) * Float64(D * Float64(D * Float64(M * M))))); elseif (l <= 6.5e-226) tmp = t_0; elseif (l <= 1.6e-145) tmp = Float64(t_1 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); else tmp = t_0; end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = d / (sqrt(h) * sqrt(l));
t_1 = sqrt((h / (l * (l * l))));
tmp = 0.0;
if (l <= -1.5e-206)
tmp = sqrt((1.0 / (h * l))) * -d;
elseif (l <= -4.5e-303)
tmp = t_1 * ((0.125 / d) * (D * (D * (M * M))));
elseif (l <= 6.5e-226)
tmp = t_0;
elseif (l <= 1.6e-145)
tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: d, h, l, 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[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.5e-206], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, -4.5e-303], N[(t$95$1 * N[(N[(0.125 / d), $MachinePrecision] * N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.5e-226], t$95$0, If[LessEqual[l, 1.6e-145], N[(t$95$1 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{-206}:\\
\;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
\mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\
\;\;\;\;t\_1 \cdot \left(\frac{0.125}{d} \cdot \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 6.5 \cdot 10^{-226}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\
\;\;\;\;t\_1 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.5000000000000001e-206Initial program 66.6%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6452.1
Applied rewrites52.1%
if -1.5000000000000001e-206 < l < -4.5000000000000001e-303Initial program 54.4%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites71.1%
if -4.5000000000000001e-303 < l < 6.50000000000000033e-226 or 1.60000000000000004e-145 < l Initial program 63.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6455.7
Applied rewrites55.7%
Applied rewrites55.7%
Applied rewrites59.0%
if 6.50000000000000033e-226 < l < 1.60000000000000004e-145Initial program 79.5%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites68.8%
Final simplification58.1%
NOTE: d, h, l, 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 (/ h (* l (* l l))))))
(if (<= h -32.0)
(* (* D t_0) (/ (* M (* D M)) (* d 8.0)))
(if (<= h -5e-310)
(* (sqrt (/ 1.0 (* h l))) (- d))
(if (<= h 9e+140)
(/ d (* (sqrt h) (sqrt l)))
(* (* t_0 (/ (* M M) d)) (* -0.125 (* D D))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double tmp;
if (h <= -32.0) {
tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
} else if (h <= -5e-310) {
tmp = sqrt((1.0 / (h * l))) * -d;
} else if (h <= 9e+140) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D));
}
return tmp;
}
NOTE: d, h, l, 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((h / (l * (l * l))))
if (h <= (-32.0d0)) then
tmp = (d_1 * t_0) * ((m * (d_1 * m)) / (d * 8.0d0))
else if (h <= (-5d-310)) then
tmp = sqrt((1.0d0 / (h * l))) * -d
else if (h <= 9d+140) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = (t_0 * ((m * m) / d)) * ((-0.125d0) * (d_1 * d_1))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (h <= -32.0) {
tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
} else if (h <= -5e-310) {
tmp = Math.sqrt((1.0 / (h * l))) * -d;
} else if (h <= 9e+140) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) tmp = 0 if h <= -32.0: tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0)) elif h <= -5e-310: tmp = math.sqrt((1.0 / (h * l))) * -d elif h <= 9e+140: tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (h <= -32.0) tmp = Float64(Float64(D * t_0) * Float64(Float64(M * Float64(D * M)) / Float64(d * 8.0))); elseif (h <= -5e-310) tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d)); elseif (h <= 9e+140) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(Float64(t_0 * Float64(Float64(M * M) / d)) * Float64(-0.125 * Float64(D * D))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((h / (l * (l * l))));
tmp = 0.0;
if (h <= -32.0)
tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
elseif (h <= -5e-310)
tmp = sqrt((1.0 / (h * l))) * -d;
elseif (h <= 9e+140)
tmp = d / (sqrt(h) * sqrt(l));
else
tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D));
end
tmp_2 = tmp;
end
NOTE: d, h, l, 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[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -32.0], N[(N[(D * t$95$0), $MachinePrecision] * N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[h, 9e+140], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;h \leq -32:\\
\;\;\;\;\left(D \cdot t\_0\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
\mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \frac{M \cdot M}{d}\right) \cdot \left(-0.125 \cdot \left(D \cdot D\right)\right)\\
\end{array}
\end{array}
if h < -32Initial program 59.2%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites41.1%
Applied rewrites44.0%
if -32 < h < -4.999999999999985e-310Initial program 70.3%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6469.5
Applied rewrites69.5%
if -4.999999999999985e-310 < h < 9.0000000000000003e140Initial program 67.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6456.6
Applied rewrites56.6%
Applied rewrites56.6%
Applied rewrites60.3%
if 9.0000000000000003e140 < h Initial program 62.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.1
Applied rewrites25.1%
Applied rewrites18.5%
Taylor expanded in d around 0
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites45.5%
Final simplification56.7%
NOTE: d, h, l, 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 (/ h (* l (* l l))))))
(if (<= h -32.0)
(* (* D t_0) (/ (* M (* D M)) (* d 8.0)))
(if (<= h -5e-310)
(* (sqrt (/ 1.0 (* h l))) (- d))
(if (<= h 9e+140)
(/ d (* (sqrt h) (sqrt l)))
(* t_0 (* (* D D) (/ (* -0.125 (* M M)) d))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double tmp;
if (h <= -32.0) {
tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
} else if (h <= -5e-310) {
tmp = sqrt((1.0 / (h * l))) * -d;
} else if (h <= 9e+140) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
}
return tmp;
}
NOTE: d, h, l, 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((h / (l * (l * l))))
if (h <= (-32.0d0)) then
tmp = (d_1 * t_0) * ((m * (d_1 * m)) / (d * 8.0d0))
else if (h <= (-5d-310)) then
tmp = sqrt((1.0d0 / (h * l))) * -d
else if (h <= 9d+140) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = t_0 * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (h <= -32.0) {
tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
} else if (h <= -5e-310) {
tmp = Math.sqrt((1.0 / (h * l))) * -d;
} else if (h <= 9e+140) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) tmp = 0 if h <= -32.0: tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0)) elif h <= -5e-310: tmp = math.sqrt((1.0 / (h * l))) * -d elif h <= 9e+140: tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (h <= -32.0) tmp = Float64(Float64(D * t_0) * Float64(Float64(M * Float64(D * M)) / Float64(d * 8.0))); elseif (h <= -5e-310) tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d)); elseif (h <= 9e+140) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((h / (l * (l * l))));
tmp = 0.0;
if (h <= -32.0)
tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
elseif (h <= -5e-310)
tmp = sqrt((1.0 / (h * l))) * -d;
elseif (h <= 9e+140)
tmp = d / (sqrt(h) * sqrt(l));
else
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
end
tmp_2 = tmp;
end
NOTE: d, h, l, 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[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -32.0], N[(N[(D * t$95$0), $MachinePrecision] * N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[h, 9e+140], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;h \leq -32:\\
\;\;\;\;\left(D \cdot t\_0\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
\mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\end{array}
\end{array}
if h < -32Initial program 59.2%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites41.1%
Applied rewrites44.0%
if -32 < h < -4.999999999999985e-310Initial program 70.3%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6469.5
Applied rewrites69.5%
if -4.999999999999985e-310 < h < 9.0000000000000003e140Initial program 67.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6456.6
Applied rewrites56.6%
Applied rewrites56.6%
Applied rewrites60.3%
if 9.0000000000000003e140 < h Initial program 62.6%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites45.5%
Final simplification56.7%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l))))
(if (<= l -2.9e-222)
(* (sqrt t_0) (- d))
(if (<= l 4.5e-226)
(* d (sqrt (sqrt (* t_0 t_0))))
(if (<= l 1.6e-145)
(* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
(/ d (* (sqrt h) (sqrt l))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -2.9e-222) {
tmp = sqrt(t_0) * -d;
} else if (l <= 4.5e-226) {
tmp = d * sqrt(sqrt((t_0 * t_0)));
} else if (l <= 1.6e-145) {
tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
NOTE: d, h, l, 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 = 1.0d0 / (h * l)
if (l <= (-2.9d-222)) then
tmp = sqrt(t_0) * -d
else if (l <= 4.5d-226) then
tmp = d * sqrt(sqrt((t_0 * t_0)))
else if (l <= 1.6d-145) then
tmp = sqrt((h / (l * (l * l)))) * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -2.9e-222) {
tmp = Math.sqrt(t_0) * -d;
} else if (l <= 4.5e-226) {
tmp = d * Math.sqrt(Math.sqrt((t_0 * t_0)));
} else if (l <= 1.6e-145) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = 1.0 / (h * l) tmp = 0 if l <= -2.9e-222: tmp = math.sqrt(t_0) * -d elif l <= 4.5e-226: tmp = d * math.sqrt(math.sqrt((t_0 * t_0))) elif l <= 1.6e-145: tmp = math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (l <= -2.9e-222) tmp = Float64(sqrt(t_0) * Float64(-d)); elseif (l <= 4.5e-226) tmp = Float64(d * sqrt(sqrt(Float64(t_0 * t_0)))); elseif (l <= 1.6e-145) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = 1.0 / (h * l);
tmp = 0.0;
if (l <= -2.9e-222)
tmp = sqrt(t_0) * -d;
elseif (l <= 4.5e-226)
tmp = d * sqrt(sqrt((t_0 * t_0)));
elseif (l <= 1.6e-145)
tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
else
tmp = d / (sqrt(h) * sqrt(l));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.9e-222], N[(N[Sqrt[t$95$0], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, 4.5e-226], N[(d * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.6e-145], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;\ell \leq -2.9 \cdot 10^{-222}:\\
\;\;\;\;\sqrt{t\_0} \cdot \left(-d\right)\\
\mathbf{elif}\;\ell \leq 4.5 \cdot 10^{-226}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\\
\mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.9000000000000002e-222Initial program 66.0%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6452.0
Applied rewrites52.0%
if -2.9000000000000002e-222 < l < 4.50000000000000011e-226Initial program 63.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6428.2
Applied rewrites28.2%
Applied rewrites38.3%
if 4.50000000000000011e-226 < l < 1.60000000000000004e-145Initial program 79.5%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites68.8%
if 1.60000000000000004e-145 < l Initial program 62.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6457.7
Applied rewrites57.7%
Applied rewrites57.7%
Applied rewrites60.7%
Final simplification54.4%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l 3e-298) (* (sqrt (/ 1.0 (* h l))) (- d)) (/ d (* (sqrt h) (sqrt l)))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3e-298) {
tmp = sqrt((1.0 / (h * l))) * -d;
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
NOTE: d, h, l, 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 <= 3d-298) then
tmp = sqrt((1.0d0 / (h * l))) * -d
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3e-298) {
tmp = Math.sqrt((1.0 / (h * l))) * -d;
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= 3e-298: tmp = math.sqrt((1.0 / (h * l))) * -d else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= 3e-298) tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d)); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= 3e-298)
tmp = sqrt((1.0 / (h * l))) * -d;
else
tmp = d / (sqrt(h) * sqrt(l));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3e-298], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3 \cdot 10^{-298}:\\
\;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 2.9999999999999999e-298Initial program 64.6%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.4
Applied rewrites46.4%
if 2.9999999999999999e-298 < l Initial program 65.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6450.7
Applied rewrites50.7%
Applied rewrites50.6%
Applied rewrites53.6%
Final simplification49.9%
NOTE: d, h, l, 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 (/ 1.0 (* h l))))) (if (<= l 3e-298) (* t_0 (- d)) (* d t_0))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double tmp;
if (l <= 3e-298) {
tmp = t_0 * -d;
} else {
tmp = d * t_0;
}
return tmp;
}
NOTE: d, h, l, 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((1.0d0 / (h * l)))
if (l <= 3d-298) then
tmp = t_0 * -d
else
tmp = d * t_0
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (h * l)));
double tmp;
if (l <= 3e-298) {
tmp = t_0 * -d;
} else {
tmp = d * t_0;
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (h * l))) tmp = 0 if l <= 3e-298: tmp = t_0 * -d else: tmp = d * t_0 return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) tmp = 0.0 if (l <= 3e-298) tmp = Float64(t_0 * Float64(-d)); else tmp = Float64(d * t_0); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((1.0 / (h * l)));
tmp = 0.0;
if (l <= 3e-298)
tmp = t_0 * -d;
else
tmp = d * t_0;
end
tmp_2 = tmp;
end
NOTE: d, h, l, 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[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3e-298], N[(t$95$0 * (-d)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;\ell \leq 3 \cdot 10^{-298}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < 2.9999999999999999e-298Initial program 64.6%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.4
Applied rewrites46.4%
if 2.9999999999999999e-298 < l Initial program 65.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6450.7
Applied rewrites50.7%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= h -2.8e-247) (sqrt (* d (/ d (* h l)))) (* d (sqrt (/ 1.0 (* h l))))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e-247) {
tmp = sqrt((d * (d / (h * l))));
} else {
tmp = d * sqrt((1.0 / (h * l)));
}
return tmp;
}
NOTE: d, h, l, 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.8d-247)) then
tmp = sqrt((d * (d / (h * l))))
else
tmp = d * sqrt((1.0d0 / (h * l)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e-247) {
tmp = Math.sqrt((d * (d / (h * l))));
} else {
tmp = d * Math.sqrt((1.0 / (h * l)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if h <= -2.8e-247: tmp = math.sqrt((d * (d / (h * l)))) else: tmp = d * math.sqrt((1.0 / (h * l))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= -2.8e-247) tmp = sqrt(Float64(d * Float64(d / Float64(h * l)))); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= -2.8e-247)
tmp = sqrt((d * (d / (h * l))));
else
tmp = d * sqrt((1.0 / (h * l)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.8e-247], N[Sqrt[N[(d * N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\
\;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\end{array}
\end{array}
if h < -2.79999999999999986e-247Initial program 66.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f645.8
Applied rewrites5.8%
Applied rewrites34.2%
Applied rewrites38.4%
if -2.79999999999999986e-247 < h Initial program 64.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Final simplification42.7%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= h -2.8e-247) (sqrt (* d (/ d (* h l)))) (/ d (sqrt (* h l)))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e-247) {
tmp = sqrt((d * (d / (h * l))));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
NOTE: d, h, l, 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.8d-247)) then
tmp = sqrt((d * (d / (h * l))))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e-247) {
tmp = Math.sqrt((d * (d / (h * l))));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if h <= -2.8e-247: tmp = math.sqrt((d * (d / (h * l)))) else: tmp = d / math.sqrt((h * l)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= -2.8e-247) tmp = sqrt(Float64(d * Float64(d / Float64(h * l)))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= -2.8e-247)
tmp = sqrt((d * (d / (h * l))));
else
tmp = d / sqrt((h * l));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.8e-247], N[Sqrt[N[(d * N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\
\;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if h < -2.79999999999999986e-247Initial program 66.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f645.8
Applied rewrites5.8%
Applied rewrites34.2%
Applied rewrites38.4%
if -2.79999999999999986e-247 < h Initial program 64.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Applied rewrites46.2%
Final simplification42.6%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
return d / sqrt((h * l));
}
NOTE: d, h, l, 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((h * l))
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): return d / math.sqrt((h * l))
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d / sqrt((h * l));
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 65.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6427.9
Applied rewrites27.9%
Applied rewrites27.9%
herbie shell --seed 2024221
(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)))))