| Alternative 1 | |
|---|---|
| Accuracy | 77.8% |
| Cost | 83661 |
(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)))))
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l))))))
(if (<= t_0 -1e+296)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.125 (* (* (/ M d) (/ (* h D) d)) (* M (/ D l))))))
(if (or (<= t_0 -5e-181) (and (not (<= t_0 0.0)) (<= t_0 2e+233)))
t_0
(fabs (/ d (sqrt (* 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)));
}
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -1e+296) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.125 * (((M / d) * ((h * D) / d)) * (M * (D / l)))));
} else if ((t_0 <= -5e-181) || (!(t_0 <= 0.0) && (t_0 <= 2e+233))) {
tmp = t_0;
} else {
tmp = fabs((d / sqrt((h * l))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
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
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0)) * (h / l)))
if (t_0 <= (-1d+296)) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.125d0 * (((m / d) * ((h * d_1) / d)) * (m * (d_1 / l)))))
else if ((t_0 <= (-5d-181)) .or. (.not. (t_0 <= 0.0d0)) .and. (t_0 <= 2d+233)) then
tmp = t_0
else
tmp = abs((d / sqrt((h * l))))
end if
code = tmp
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)));
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -1e+296) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.125 * (((M / d) * ((h * D) / d)) * (M * (D / l)))));
} else if ((t_0 <= -5e-181) || (!(t_0 <= 0.0) && (t_0 <= 2e+233))) {
tmp = t_0;
} else {
tmp = Math.abs((d / Math.sqrt((h * l))));
}
return tmp;
}
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)))
def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)) * (h / l))) tmp = 0 if t_0 <= -1e+296: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.125 * (((M / d) * ((h * D) / d)) * (M * (D / l))))) elif (t_0 <= -5e-181) or (not (t_0 <= 0.0) and (t_0 <= 2e+233)): tmp = t_0 else: tmp = math.fabs((d / math.sqrt((h * l)))) return tmp
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 code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_0 <= -1e+296) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(M / d) * Float64(Float64(h * D) / d)) * Float64(M * Float64(D / l)))))); elseif ((t_0 <= -5e-181) || (!(t_0 <= 0.0) && (t_0 <= 2e+233))) tmp = t_0; else tmp = abs(Float64(d / sqrt(Float64(h * l)))); end return tmp 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
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((0.5 * (((M * D) / (d * 2.0)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_0 <= -1e+296) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.125 * (((M / d) * ((h * D) / d)) * (M * (D / l))))); elseif ((t_0 <= -5e-181) || (~((t_0 <= 0.0)) && (t_0 <= 2e+233))) tmp = t_0; else tmp = abs((d / sqrt((h * l)))); end tmp_2 = tmp; 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]
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+296], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(M / d), $MachinePrecision] * N[(N[(h * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$0, -5e-181], And[N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision], LessEqual[t$95$0, 2e+233]]], t$95$0, N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\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)
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+296}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{M}{d} \cdot \frac{h \cdot D}{d}\right) \cdot \left(M \cdot \frac{D}{\ell}\right)\right)\right)\\
\mathbf{elif}\;t_0 \leq -5 \cdot 10^{-181} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 2 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\end{array}
Results
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -9.99999999999999981e295Initial program 2.7%
Simplified6.1%
[Start]2.7 | \[ \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)
\] |
|---|---|
metadata-eval [=>]2.7 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \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)
\] |
unpow1/2 [=>]2.7 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \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)
\] |
metadata-eval [=>]2.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\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)
\] |
unpow1/2 [=>]2.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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)
\] |
*-commutative [=>]2.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right)
\] |
associate-*l* [=>]2.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
times-frac [=>]6.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right)
\] |
metadata-eval [=>]6.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right)
\] |
Taylor expanded in M around 0 7.4%
Simplified14.1%
[Start]7.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}\right)
\] |
|---|---|
associate-*r/ [=>]7.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot {d}^{2}}}\right)
\] |
*-commutative [=>]7.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right)
\] |
associate-*r/ [<=]7.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}\right)
\] |
associate-*r* [=>]6.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)
\] |
*-commutative [=>]6.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot h}{{d}^{2} \cdot \ell}\right)
\] |
associate-*l* [=>]7.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{{M}^{2} \cdot \left({D}^{2} \cdot h\right)}}{{d}^{2} \cdot \ell}\right)
\] |
unpow2 [=>]7.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{{M}^{2} \cdot \left({D}^{2} \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}\right)
\] |
associate-*l* [=>]8.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{{M}^{2} \cdot \left({D}^{2} \cdot h\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}}\right)
\] |
times-frac [=>]11.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \frac{{D}^{2} \cdot h}{d \cdot \ell}\right)}\right)
\] |
unpow2 [=>]11.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{M \cdot M}}{d} \cdot \frac{{D}^{2} \cdot h}{d \cdot \ell}\right)\right)
\] |
unpow2 [=>]11.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\frac{M \cdot M}{d} \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot h}{d \cdot \ell}\right)\right)
\] |
associate-*l* [=>]14.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\frac{M \cdot M}{d} \cdot \frac{\color{blue}{D \cdot \left(D \cdot h\right)}}{d \cdot \ell}\right)\right)
\] |
Applied egg-rr24.0%
[Start]14.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\frac{M \cdot M}{d} \cdot \frac{D \cdot \left(D \cdot h\right)}{d \cdot \ell}\right)\right)
\] |
|---|---|
clear-num [=>]14.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\frac{M \cdot M}{d} \cdot \color{blue}{\frac{1}{\frac{d \cdot \ell}{D \cdot \left(D \cdot h\right)}}}\right)\right)
\] |
un-div-inv [=>]14.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \color{blue}{\frac{\frac{M \cdot M}{d}}{\frac{d \cdot \ell}{D \cdot \left(D \cdot h\right)}}}\right)
\] |
associate-/l* [=>]16.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\frac{M}{\frac{d}{M}}}}{\frac{d \cdot \ell}{D \cdot \left(D \cdot h\right)}}\right)
\] |
associate-/r/ [=>]16.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\frac{M}{d} \cdot M}}{\frac{d \cdot \ell}{D \cdot \left(D \cdot h\right)}}\right)
\] |
*-commutative [=>]16.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\frac{M}{d} \cdot M}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot h\right) \cdot D}}}\right)
\] |
times-frac [=>]24.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\frac{M}{d} \cdot M}{\color{blue}{\frac{d}{D \cdot h} \cdot \frac{\ell}{D}}}\right)
\] |
Applied egg-rr34.2%
[Start]24.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\frac{M}{d} \cdot M}{\frac{d}{D \cdot h} \cdot \frac{\ell}{D}}\right)
\] |
|---|---|
times-frac [=>]34.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{\frac{M}{d}}{\frac{d}{D \cdot h}} \cdot \frac{M}{\frac{\ell}{D}}\right)}\right)
\] |
div-inv [=>]34.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{M}{d} \cdot \frac{1}{\frac{d}{D \cdot h}}\right)} \cdot \frac{M}{\frac{\ell}{D}}\right)\right)
\] |
clear-num [<=]34.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{M}{d} \cdot \color{blue}{\frac{D \cdot h}{d}}\right) \cdot \frac{M}{\frac{\ell}{D}}\right)\right)
\] |
div-inv [=>]34.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{M}{d} \cdot \frac{D \cdot h}{d}\right) \cdot \color{blue}{\left(M \cdot \frac{1}{\frac{\ell}{D}}\right)}\right)\right)
\] |
clear-num [<=]34.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{M}{d} \cdot \frac{D \cdot h}{d}\right) \cdot \left(M \cdot \color{blue}{\frac{D}{\ell}}\right)\right)\right)
\] |
if -9.99999999999999981e295 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -5.0000000000000001e-181 or -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1.99999999999999995e233Initial program 98.5%
if -5.0000000000000001e-181 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -0.0 or 1.99999999999999995e233 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 13.3%
Taylor expanded in d around inf 36.1%
Simplified36.1%
[Start]36.1 | \[ \sqrt{\frac{1}{\ell \cdot h}} \cdot d
\] |
|---|---|
*-commutative [=>]36.1 | \[ \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}}
\] |
associate-/r* [=>]36.1 | \[ d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}}
\] |
Applied egg-rr35.9%
[Start]36.1 | \[ d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}
\] |
|---|---|
pow1/2 [=>]36.1 | \[ d \cdot \color{blue}{{\left(\frac{\frac{1}{\ell}}{h}\right)}^{0.5}}
\] |
add-cube-cbrt [=>]35.9 | \[ d \cdot {\color{blue}{\left(\left(\sqrt[3]{\frac{\frac{1}{\ell}}{h}} \cdot \sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right) \cdot \sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right)}}^{0.5}
\] |
pow3 [=>]35.9 | \[ d \cdot {\color{blue}{\left({\left(\sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right)}^{3}\right)}}^{0.5}
\] |
pow-pow [=>]35.9 | \[ d \cdot \color{blue}{{\left(\sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right)}^{\left(3 \cdot 0.5\right)}}
\] |
metadata-eval [=>]35.9 | \[ d \cdot {\left(\sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right)}^{\color{blue}{1.5}}
\] |
Applied egg-rr35.9%
[Start]35.9 | \[ d \cdot {\left(\sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right)}^{1.5}
\] |
|---|---|
add-log-exp [=>]12.9 | \[ d \cdot {\color{blue}{\log \left(e^{\sqrt[3]{\frac{\frac{1}{\ell}}{h}}}\right)}}^{1.5}
\] |
*-un-lft-identity [=>]12.9 | \[ d \cdot {\log \color{blue}{\left(1 \cdot e^{\sqrt[3]{\frac{\frac{1}{\ell}}{h}}}\right)}}^{1.5}
\] |
log-prod [=>]12.9 | \[ d \cdot {\color{blue}{\left(\log 1 + \log \left(e^{\sqrt[3]{\frac{\frac{1}{\ell}}{h}}}\right)\right)}}^{1.5}
\] |
metadata-eval [=>]12.9 | \[ d \cdot {\left(\color{blue}{0} + \log \left(e^{\sqrt[3]{\frac{\frac{1}{\ell}}{h}}}\right)\right)}^{1.5}
\] |
add-log-exp [<=]35.9 | \[ d \cdot {\left(0 + \color{blue}{\sqrt[3]{\frac{\frac{1}{\ell}}{h}}}\right)}^{1.5}
\] |
Simplified35.9%
[Start]35.9 | \[ d \cdot {\left(0 + \sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right)}^{1.5}
\] |
|---|---|
+-lft-identity [=>]35.9 | \[ d \cdot {\color{blue}{\left(\sqrt[3]{\frac{\frac{1}{\ell}}{h}}\right)}}^{1.5}
\] |
unpow1/3 [<=]34.2 | \[ d \cdot {\color{blue}{\left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{0.3333333333333333}\right)}}^{1.5}
\] |
exp-to-pow [<=]34.3 | \[ d \cdot {\color{blue}{\left(e^{\log \left(\frac{\frac{1}{\ell}}{h}\right) \cdot 0.3333333333333333}\right)}}^{1.5}
\] |
associate-/r* [<=]34.2 | \[ d \cdot {\left(e^{\log \color{blue}{\left(\frac{1}{\ell \cdot h}\right)} \cdot 0.3333333333333333}\right)}^{1.5}
\] |
log-rec [=>]34.3 | \[ d \cdot {\left(e^{\color{blue}{\left(-\log \left(\ell \cdot h\right)\right)} \cdot 0.3333333333333333}\right)}^{1.5}
\] |
*-rgt-identity [<=]34.3 | \[ d \cdot {\left(e^{\color{blue}{\left(\left(-\log \left(\ell \cdot h\right)\right) \cdot 1\right)} \cdot 0.3333333333333333}\right)}^{1.5}
\] |
*-rgt-identity [=>]34.3 | \[ d \cdot {\left(e^{\color{blue}{\left(-\log \left(\ell \cdot h\right)\right)} \cdot 0.3333333333333333}\right)}^{1.5}
\] |
distribute-lft-neg-out [=>]34.3 | \[ d \cdot {\left(e^{\color{blue}{-\log \left(\ell \cdot h\right) \cdot 0.3333333333333333}}\right)}^{1.5}
\] |
exp-neg [=>]34.3 | \[ d \cdot {\color{blue}{\left(\frac{1}{e^{\log \left(\ell \cdot h\right) \cdot 0.3333333333333333}}\right)}}^{1.5}
\] |
exp-to-pow [=>]34.2 | \[ d \cdot {\left(\frac{1}{\color{blue}{{\left(\ell \cdot h\right)}^{0.3333333333333333}}}\right)}^{1.5}
\] |
unpow1/3 [=>]35.9 | \[ d \cdot {\left(\frac{1}{\color{blue}{\sqrt[3]{\ell \cdot h}}}\right)}^{1.5}
\] |
Applied egg-rr19.7%
[Start]35.9 | \[ d \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}
\] |
|---|---|
add-sqr-sqrt [=>]34.9 | \[ \color{blue}{\sqrt{d \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}} \cdot \sqrt{d \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}}}
\] |
sqrt-unprod [=>]22.3 | \[ \color{blue}{\sqrt{\left(d \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}\right) \cdot \left(d \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}\right)}}
\] |
pow1/2 [=>]22.3 | \[ \color{blue}{{\left(\left(d \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}\right) \cdot \left(d \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}\right)\right)}^{0.5}}
\] |
swap-sqr [=>]19.5 | \[ {\color{blue}{\left(\left(d \cdot d\right) \cdot \left({\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5} \cdot {\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{1.5}\right)\right)}}^{0.5}
\] |
pow-prod-up [=>]19.5 | \[ {\left(\left(d \cdot d\right) \cdot \color{blue}{{\left(\frac{1}{\sqrt[3]{\ell \cdot h}}\right)}^{\left(1.5 + 1.5\right)}}\right)}^{0.5}
\] |
inv-pow [=>]19.5 | \[ {\left(\left(d \cdot d\right) \cdot {\color{blue}{\left({\left(\sqrt[3]{\ell \cdot h}\right)}^{-1}\right)}}^{\left(1.5 + 1.5\right)}\right)}^{0.5}
\] |
pow1/3 [=>]19.0 | \[ {\left(\left(d \cdot d\right) \cdot {\left({\color{blue}{\left({\left(\ell \cdot h\right)}^{0.3333333333333333}\right)}}^{-1}\right)}^{\left(1.5 + 1.5\right)}\right)}^{0.5}
\] |
pow-pow [=>]19.0 | \[ {\left(\left(d \cdot d\right) \cdot {\color{blue}{\left({\left(\ell \cdot h\right)}^{\left(0.3333333333333333 \cdot -1\right)}\right)}}^{\left(1.5 + 1.5\right)}\right)}^{0.5}
\] |
pow-pow [=>]19.7 | \[ {\left(\left(d \cdot d\right) \cdot \color{blue}{{\left(\ell \cdot h\right)}^{\left(\left(0.3333333333333333 \cdot -1\right) \cdot \left(1.5 + 1.5\right)\right)}}\right)}^{0.5}
\] |
metadata-eval [=>]19.7 | \[ {\left(\left(d \cdot d\right) \cdot {\left(\ell \cdot h\right)}^{\left(\color{blue}{-0.3333333333333333} \cdot \left(1.5 + 1.5\right)\right)}\right)}^{0.5}
\] |
metadata-eval [=>]19.7 | \[ {\left(\left(d \cdot d\right) \cdot {\left(\ell \cdot h\right)}^{\left(-0.3333333333333333 \cdot \color{blue}{3}\right)}\right)}^{0.5}
\] |
metadata-eval [=>]19.7 | \[ {\left(\left(d \cdot d\right) \cdot {\left(\ell \cdot h\right)}^{\color{blue}{-1}}\right)}^{0.5}
\] |
Simplified61.7%
[Start]19.7 | \[ {\left(\left(d \cdot d\right) \cdot {\left(\ell \cdot h\right)}^{-1}\right)}^{0.5}
\] |
|---|---|
unpow1/2 [=>]19.7 | \[ \color{blue}{\sqrt{\left(d \cdot d\right) \cdot {\left(\ell \cdot h\right)}^{-1}}}
\] |
*-commutative [=>]19.7 | \[ \sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{-1} \cdot \left(d \cdot d\right)}}
\] |
metadata-eval [<=]19.7 | \[ \sqrt{{\left(\ell \cdot h\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}} \cdot \left(d \cdot d\right)}
\] |
pow-sqr [<=]19.6 | \[ \sqrt{\color{blue}{\left({\left(\ell \cdot h\right)}^{-0.5} \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)} \cdot \left(d \cdot d\right)}
\] |
swap-sqr [<=]22.4 | \[ \sqrt{\color{blue}{\left({\left(\ell \cdot h\right)}^{-0.5} \cdot d\right) \cdot \left({\left(\ell \cdot h\right)}^{-0.5} \cdot d\right)}}
\] |
rem-sqrt-square [=>]61.7 | \[ \color{blue}{\left|{\left(\ell \cdot h\right)}^{-0.5} \cdot d\right|}
\] |
*-commutative [=>]61.7 | \[ \left|\color{blue}{d \cdot {\left(\ell \cdot h\right)}^{-0.5}}\right|
\] |
rem-exp-log [<=]58.5 | \[ \left|d \cdot \color{blue}{e^{\log \left({\left(\ell \cdot h\right)}^{-0.5}\right)}}\right|
\] |
log-pow [=>]58.5 | \[ \left|d \cdot e^{\color{blue}{-0.5 \cdot \log \left(\ell \cdot h\right)}}\right|
\] |
metadata-eval [<=]58.5 | \[ \left|d \cdot e^{\color{blue}{\left(1.5 \cdot -0.3333333333333333\right)} \cdot \log \left(\ell \cdot h\right)}\right|
\] |
associate-*r* [<=]58.0 | \[ \left|d \cdot e^{\color{blue}{1.5 \cdot \left(-0.3333333333333333 \cdot \log \left(\ell \cdot h\right)\right)}}\right|
\] |
*-commutative [<=]58.0 | \[ \left|d \cdot e^{\color{blue}{\left(-0.3333333333333333 \cdot \log \left(\ell \cdot h\right)\right) \cdot 1.5}}\right|
\] |
metadata-eval [<=]58.0 | \[ \left|d \cdot e^{\left(-0.3333333333333333 \cdot \log \left(\ell \cdot h\right)\right) \cdot \color{blue}{\left(0.75 + 0.75\right)}}\right|
\] |
distribute-lft-out [<=]58.0 | \[ \left|d \cdot e^{\color{blue}{\left(-0.3333333333333333 \cdot \log \left(\ell \cdot h\right)\right) \cdot 0.75 + \left(-0.3333333333333333 \cdot \log \left(\ell \cdot h\right)\right) \cdot 0.75}}\right|
\] |
distribute-rgt-out [=>]58.0 | \[ \left|d \cdot e^{\color{blue}{0.75 \cdot \left(-0.3333333333333333 \cdot \log \left(\ell \cdot h\right) + -0.3333333333333333 \cdot \log \left(\ell \cdot h\right)\right)}}\right|
\] |
exp-prod [=>]58.3 | \[ \left|d \cdot \color{blue}{{\left(e^{0.75}\right)}^{\left(-0.3333333333333333 \cdot \log \left(\ell \cdot h\right) + -0.3333333333333333 \cdot \log \left(\ell \cdot h\right)\right)}}\right|
\] |
distribute-rgt-out [=>]58.3 | \[ \left|d \cdot {\left(e^{0.75}\right)}^{\color{blue}{\left(\log \left(\ell \cdot h\right) \cdot \left(-0.3333333333333333 + -0.3333333333333333\right)\right)}}\right|
\] |
metadata-eval [=>]58.3 | \[ \left|d \cdot {\left(e^{0.75}\right)}^{\left(\log \left(\ell \cdot h\right) \cdot \color{blue}{-0.6666666666666666}\right)}\right|
\] |
metadata-eval [<=]58.3 | \[ \left|d \cdot {\left(e^{0.75}\right)}^{\left(\log \left(\ell \cdot h\right) \cdot \color{blue}{\left(-0.6666666666666666\right)}\right)}\right|
\] |
distribute-rgt-neg-in [<=]58.3 | \[ \left|d \cdot {\left(e^{0.75}\right)}^{\color{blue}{\left(-\log \left(\ell \cdot h\right) \cdot 0.6666666666666666\right)}}\right|
\] |
*-commutative [<=]58.3 | \[ \left|d \cdot {\left(e^{0.75}\right)}^{\left(-\color{blue}{0.6666666666666666 \cdot \log \left(\ell \cdot h\right)}\right)}\right|
\] |
Final simplification78.7%
| Alternative 1 | |
|---|---|
| Accuracy | 77.8% |
| Cost | 83661 |
| Alternative 2 | |
|---|---|
| Accuracy | 77.6% |
| Cost | 83661 |
| Alternative 3 | |
|---|---|
| Accuracy | 68.1% |
| Cost | 21400 |
| Alternative 4 | |
|---|---|
| Accuracy | 68.1% |
| Cost | 21400 |
| Alternative 5 | |
|---|---|
| Accuracy | 66.1% |
| Cost | 21268 |
| Alternative 6 | |
|---|---|
| Accuracy | 68.7% |
| Cost | 20872 |
| Alternative 7 | |
|---|---|
| Accuracy | 61.3% |
| Cost | 15456 |
| Alternative 8 | |
|---|---|
| Accuracy | 67.9% |
| Cost | 15448 |
| Alternative 9 | |
|---|---|
| Accuracy | 61.7% |
| Cost | 15324 |
| Alternative 10 | |
|---|---|
| Accuracy | 62.1% |
| Cost | 15320 |
| Alternative 11 | |
|---|---|
| Accuracy | 65.0% |
| Cost | 15316 |
| Alternative 12 | |
|---|---|
| Accuracy | 66.2% |
| Cost | 15056 |
| Alternative 13 | |
|---|---|
| Accuracy | 66.5% |
| Cost | 15056 |
| Alternative 14 | |
|---|---|
| Accuracy | 62.3% |
| Cost | 14996 |
| Alternative 15 | |
|---|---|
| Accuracy | 61.8% |
| Cost | 14864 |
| Alternative 16 | |
|---|---|
| Accuracy | 62.3% |
| Cost | 14864 |
| Alternative 17 | |
|---|---|
| Accuracy | 64.2% |
| Cost | 13384 |
| Alternative 18 | |
|---|---|
| Accuracy | 63.0% |
| Cost | 13252 |
| Alternative 19 | |
|---|---|
| Accuracy | 56.8% |
| Cost | 13120 |
| Alternative 20 | |
|---|---|
| Accuracy | 45.5% |
| Cost | 6980 |
| Alternative 21 | |
|---|---|
| Accuracy | 47.5% |
| Cost | 6980 |
| Alternative 22 | |
|---|---|
| Accuracy | 47.6% |
| Cost | 6980 |
| Alternative 23 | |
|---|---|
| Accuracy | 30.7% |
| Cost | 6784 |
| Alternative 24 | |
|---|---|
| Accuracy | 30.7% |
| Cost | 6720 |
herbie shell --seed 2023152
(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)))))