
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (- A))))
(if (<= (* V l) (- INFINITY))
(/ (/ c0 (/ (sqrt (- V)) t_0)) (sqrt l))
(if (<= (* V l) -4e-296)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 5e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 1e+284)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (pow (/ (/ A V) l) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(-A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 / (sqrt(-V) / t_0)) / sqrt(l);
} else if ((V * l) <= -4e-296) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 5e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 / pow(((A / V) / l), -0.5);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / (Math.sqrt(-V) / t_0)) / Math.sqrt(l);
} else if ((V * l) <= -4e-296) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt(-A) tmp = 0 if (V * l) <= -math.inf: tmp = (c0 / (math.sqrt(-V) / t_0)) / math.sqrt(l) elif (V * l) <= -4e-296: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 5e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 1e+284: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.pow(((A / V) / l), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 / Float64(sqrt(Float64(-V)) / t_0)) / sqrt(l)); elseif (Float64(V * l) <= -4e-296) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 / (sqrt(-V) / t_0)) / sqrt(l);
elseif ((V * l) <= -4e-296)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 5e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 1e+284)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 / (((A / V) / l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-296], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{c0}{\frac{\sqrt{-V}}{t\_0}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-296}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 40.9%
*-commutative40.9%
associate-/r*58.9%
sqrt-div56.3%
associate-*l/56.4%
Applied egg-rr56.4%
clear-num56.4%
sqrt-div56.3%
metadata-eval56.3%
Applied egg-rr56.3%
associate-*l/56.4%
*-un-lft-identity56.4%
Applied egg-rr56.4%
frac-2neg56.4%
sqrt-div62.2%
Applied egg-rr62.2%
if -inf.0 < (*.f64 V l) < -4e-296Initial program 82.6%
frac-2neg82.6%
sqrt-div99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
if -4e-296 < (*.f64 V l) < 5.0000000000022e-312Initial program 33.3%
associate-/r*73.4%
clear-num73.3%
sqrt-div79.2%
metadata-eval79.2%
clear-num73.3%
associate-/r*33.3%
clear-num33.3%
associate-/l*79.3%
Applied egg-rr79.3%
un-div-inv79.5%
*-commutative79.5%
sqrt-prod43.2%
sqrt-div13.6%
associate-/r/13.7%
sqrt-div34.6%
sqrt-undiv79.3%
Applied egg-rr79.3%
clear-num73.5%
associate-/r/79.3%
clear-num79.4%
Applied egg-rr79.4%
if 5.0000000000022e-312 < (*.f64 V l) < 1.00000000000000008e284Initial program 79.4%
*-commutative79.4%
sqrt-div99.3%
associate-*l/97.6%
Applied egg-rr97.6%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 49.0%
associate-/r*88.8%
clear-num87.1%
sqrt-div87.1%
metadata-eval87.1%
clear-num87.1%
associate-/r*49.0%
clear-num49.0%
associate-/l*87.1%
Applied egg-rr87.1%
un-div-inv87.3%
*-commutative87.3%
sqrt-prod52.1%
sqrt-div55.8%
associate-/r/55.8%
sqrt-div56.0%
sqrt-undiv87.3%
Applied egg-rr87.3%
associate-/r/87.3%
*-commutative87.3%
Simplified87.3%
clear-num87.2%
div-inv87.3%
Applied egg-rr87.3%
clear-num87.3%
sqrt-div88.9%
metadata-eval88.9%
clear-num87.1%
associate-/r/87.1%
associate-*l/49.0%
clear-num49.0%
inv-pow49.0%
sqrt-pow249.0%
metadata-eval49.0%
Applied egg-rr49.0%
associate-/r*88.9%
Simplified88.9%
Final simplification93.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 4e-291) (not (<= t_0 5e+192)))
(* c0 (sqrt (/ (/ A l) V)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 4e-291) || !(t_0 <= 5e+192)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 4d-291) .or. (.not. (t_0 <= 5d+192))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 4e-291) || !(t_0 <= 5e+192)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 4e-291) or not (t_0 <= 5e+192): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 4e-291) || !(t_0 <= 5e+192)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 4e-291) || ~((t_0 <= 5e+192)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 4e-291], N[Not[LessEqual[t$95$0, 5e+192]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-291} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+192}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e-291 or 5.00000000000000033e192 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 63.0%
Taylor expanded in c0 around 0 63.0%
*-commutative63.0%
associate-/r*70.7%
Simplified70.7%
if 3.99999999999999985e-291 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000033e192Initial program 97.3%
Final simplification76.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+293)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+293)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+293))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+293)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+293): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+293)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+293)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+293]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+293}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 5.00000000000000033e293 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 62.1%
associate-/r*71.5%
Simplified71.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000033e293Initial program 96.7%
Final simplification77.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(/ c0 (pow (/ (/ A V) l) -0.5))
(if (<= t_0 1e+190) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / pow(((A / V) / l), -0.5);
} else if (t_0 <= 1e+190) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 / (((a / v) / l) ** (-0.5d0))
else if (t_0 <= 1d+190) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
} else if (t_0 <= 1e+190) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.pow(((A / V) / l), -0.5) elif t_0 <= 1e+190: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); elseif (t_0 <= 1e+190) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / (((A / V) / l) ^ -0.5);
elseif (t_0 <= 1e+190)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+190], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\mathbf{elif}\;t\_0 \leq 10^{+190}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 64.7%
associate-/r*72.8%
clear-num72.6%
sqrt-div73.9%
metadata-eval73.9%
clear-num72.6%
associate-/r*64.7%
clear-num66.4%
associate-/l*71.7%
Applied egg-rr71.7%
un-div-inv71.8%
*-commutative71.8%
sqrt-prod37.2%
sqrt-div26.5%
associate-/r/26.5%
sqrt-div47.5%
sqrt-undiv73.9%
Applied egg-rr73.9%
associate-/r/71.8%
*-commutative71.8%
Simplified71.8%
clear-num71.8%
div-inv72.4%
Applied egg-rr72.4%
clear-num70.8%
sqrt-div70.9%
metadata-eval70.9%
clear-num70.6%
associate-/r/72.3%
associate-*l/64.6%
clear-num64.6%
inv-pow64.6%
sqrt-pow264.7%
metadata-eval64.7%
Applied egg-rr64.7%
associate-/r*72.9%
Simplified72.9%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e190Initial program 97.3%
if 1.0000000000000001e190 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 54.9%
associate-/r*69.9%
clear-num69.9%
sqrt-div71.9%
metadata-eval71.9%
clear-num69.8%
associate-/r*54.8%
clear-num54.8%
associate-/l*72.0%
Applied egg-rr72.0%
un-div-inv72.0%
*-commutative72.0%
sqrt-prod45.6%
sqrt-div19.8%
associate-/r/19.9%
sqrt-div40.4%
sqrt-undiv71.9%
Applied egg-rr71.9%
associate-/r/72.0%
*-commutative72.0%
Simplified72.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 4e-291)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+190) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-291) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+190) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-291) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+190) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-291) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+190) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-291: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+190: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-291) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+190) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-291)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+190)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-291], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+190], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-291}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+190}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e-291Initial program 64.9%
Taylor expanded in c0 around 0 64.9%
*-commutative64.9%
associate-/r*71.1%
Simplified71.1%
if 3.99999999999999985e-291 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e190Initial program 97.3%
if 1.0000000000000001e190 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 54.9%
associate-/r*69.9%
clear-num69.9%
sqrt-div71.9%
metadata-eval71.9%
clear-num69.8%
associate-/r*54.8%
clear-num54.8%
associate-/l*72.0%
Applied egg-rr72.0%
un-div-inv72.0%
*-commutative72.0%
sqrt-prod45.6%
sqrt-div19.8%
associate-/r/19.9%
sqrt-div40.4%
sqrt-undiv71.9%
Applied egg-rr71.9%
associate-/r/72.0%
*-commutative72.0%
Simplified72.0%
Final simplification76.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(/ (/ 1.0 (/ (sqrt (/ V A)) c0)) (sqrt l))
(if (<= (* V l) -4e-296)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 1e+284)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (pow (/ (/ A V) l) -0.5)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (1.0 / (sqrt((V / A)) / c0)) / sqrt(l);
} else if ((V * l) <= -4e-296) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 / pow(((A / V) / l), -0.5);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (1.0 / (Math.sqrt((V / A)) / c0)) / Math.sqrt(l);
} else if ((V * l) <= -4e-296) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = (1.0 / (math.sqrt((V / A)) / c0)) / math.sqrt(l) elif (V * l) <= -4e-296: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 1e+284: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.pow(((A / V) / l), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(V / A)) / c0)) / sqrt(l)); elseif (Float64(V * l) <= -4e-296) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (1.0 / (sqrt((V / A)) / c0)) / sqrt(l);
elseif ((V * l) <= -4e-296)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 1e+284)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 / (((A / V) / l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(1.0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-296], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{\frac{1}{\frac{\sqrt{\frac{V}{A}}}{c0}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 40.9%
*-commutative40.9%
associate-/r*58.9%
sqrt-div56.3%
associate-*l/56.4%
Applied egg-rr56.4%
clear-num56.4%
sqrt-div56.3%
metadata-eval56.3%
Applied egg-rr56.3%
associate-*l/56.4%
*-un-lft-identity56.4%
clear-num56.5%
Applied egg-rr56.5%
if -inf.0 < (*.f64 V l) < -4e-296Initial program 82.6%
frac-2neg82.6%
sqrt-div99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
if -4e-296 < (*.f64 V l) < 5.0000000000022e-312Initial program 33.3%
associate-/r*73.4%
clear-num73.3%
sqrt-div79.2%
metadata-eval79.2%
clear-num73.3%
associate-/r*33.3%
clear-num33.3%
associate-/l*79.3%
Applied egg-rr79.3%
un-div-inv79.5%
*-commutative79.5%
sqrt-prod43.2%
sqrt-div13.6%
associate-/r/13.7%
sqrt-div34.6%
sqrt-undiv79.3%
Applied egg-rr79.3%
clear-num73.5%
associate-/r/79.3%
clear-num79.4%
Applied egg-rr79.4%
if 5.0000000000022e-312 < (*.f64 V l) < 1.00000000000000008e284Initial program 79.4%
*-commutative79.4%
sqrt-div99.3%
associate-*l/97.6%
Applied egg-rr97.6%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 49.0%
associate-/r*88.8%
clear-num87.1%
sqrt-div87.1%
metadata-eval87.1%
clear-num87.1%
associate-/r*49.0%
clear-num49.0%
associate-/l*87.1%
Applied egg-rr87.1%
un-div-inv87.3%
*-commutative87.3%
sqrt-prod52.1%
sqrt-div55.8%
associate-/r/55.8%
sqrt-div56.0%
sqrt-undiv87.3%
Applied egg-rr87.3%
associate-/r/87.3%
*-commutative87.3%
Simplified87.3%
clear-num87.2%
div-inv87.3%
Applied egg-rr87.3%
clear-num87.3%
sqrt-div88.9%
metadata-eval88.9%
clear-num87.1%
associate-/r/87.1%
associate-*l/49.0%
clear-num49.0%
inv-pow49.0%
sqrt-pow249.0%
metadata-eval49.0%
Applied egg-rr49.0%
associate-/r*88.9%
Simplified88.9%
Final simplification92.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(if (<= (* V l) -4e-296)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 1e+284)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (pow (/ (/ A V) l) -0.5)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else if ((V * l) <= -4e-296) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 / pow(((A / V) / l), -0.5);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else if ((V * l) <= -4e-296) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) elif (V * l) <= -4e-296: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 1e+284: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.pow(((A / V) / l), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -4e-296) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
elseif ((V * l) <= -4e-296)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 1e+284)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 / (((A / V) / l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-296], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 40.9%
associate-/r*58.9%
sqrt-div56.3%
associate-*r/56.4%
Applied egg-rr56.4%
*-commutative56.4%
associate-/l*56.3%
Simplified56.3%
if -inf.0 < (*.f64 V l) < -4e-296Initial program 82.6%
frac-2neg82.6%
sqrt-div99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
if -4e-296 < (*.f64 V l) < 5.0000000000022e-312Initial program 33.3%
associate-/r*73.4%
clear-num73.3%
sqrt-div79.2%
metadata-eval79.2%
clear-num73.3%
associate-/r*33.3%
clear-num33.3%
associate-/l*79.3%
Applied egg-rr79.3%
un-div-inv79.5%
*-commutative79.5%
sqrt-prod43.2%
sqrt-div13.6%
associate-/r/13.7%
sqrt-div34.6%
sqrt-undiv79.3%
Applied egg-rr79.3%
clear-num73.5%
associate-/r/79.3%
clear-num79.4%
Applied egg-rr79.4%
if 5.0000000000022e-312 < (*.f64 V l) < 1.00000000000000008e284Initial program 79.4%
*-commutative79.4%
sqrt-div99.3%
associate-*l/97.6%
Applied egg-rr97.6%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 49.0%
associate-/r*88.8%
clear-num87.1%
sqrt-div87.1%
metadata-eval87.1%
clear-num87.1%
associate-/r*49.0%
clear-num49.0%
associate-/l*87.1%
Applied egg-rr87.1%
un-div-inv87.3%
*-commutative87.3%
sqrt-prod52.1%
sqrt-div55.8%
associate-/r/55.8%
sqrt-div56.0%
sqrt-undiv87.3%
Applied egg-rr87.3%
associate-/r/87.3%
*-commutative87.3%
Simplified87.3%
clear-num87.2%
div-inv87.3%
Applied egg-rr87.3%
clear-num87.3%
sqrt-div88.9%
metadata-eval88.9%
clear-num87.1%
associate-/r/87.1%
associate-*l/49.0%
clear-num49.0%
inv-pow49.0%
sqrt-pow249.0%
metadata-eval49.0%
Applied egg-rr49.0%
associate-/r*88.9%
Simplified88.9%
Final simplification92.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e-310)
(* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 l))))
(if (<= (* V l) 5e-312)
(/ 1.0 (* (/ 1.0 c0) (sqrt (* V (/ l A)))))
(if (<= (* V l) 1e+284)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (pow (/ (/ A V) l) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-310) {
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
} else if ((V * l) <= 5e-312) {
tmp = 1.0 / ((1.0 / c0) * sqrt((V * (l / A))));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 / pow(((A / V) / l), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d-310)) then
tmp = c0 * (sqrt((a / v)) * sqrt((1.0d0 / l)))
else if ((v * l) <= 5d-312) then
tmp = 1.0d0 / ((1.0d0 / c0) * sqrt((v * (l / a))))
else if ((v * l) <= 1d+284) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
else
tmp = c0 / (((a / v) / l) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-310) {
tmp = c0 * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
} else if ((V * l) <= 5e-312) {
tmp = 1.0 / ((1.0 / c0) * Math.sqrt((V * (l / A))));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-310: tmp = c0 * (math.sqrt((A / V)) * math.sqrt((1.0 / l))) elif (V * l) <= 5e-312: tmp = 1.0 / ((1.0 / c0) * math.sqrt((V * (l / A)))) elif (V * l) <= 1e+284: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.pow(((A / V) / l), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= 5e-312) tmp = Float64(1.0 / Float64(Float64(1.0 / c0) * sqrt(Float64(V * Float64(l / A))))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e-310)
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
elseif ((V * l) <= 5e-312)
tmp = 1.0 / ((1.0 / c0) * sqrt((V * (l / A))));
elseif ((V * l) <= 1e+284)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 / (((A / V) / l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-312], N[(1.0 / N[(N[(1.0 / c0), $MachinePrecision] * N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-312}:\\
\;\;\;\;\frac{1}{\frac{1}{c0} \cdot \sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.999999999999969e-311Initial program 76.9%
pow1/276.9%
associate-/r*76.2%
div-inv76.1%
unpow-prod-down53.7%
pow1/253.7%
Applied egg-rr53.7%
unpow1/253.7%
Simplified53.7%
if -9.999999999999969e-311 < (*.f64 V l) < 5.0000000000022e-312Initial program 28.6%
associate-/r*71.5%
clear-num71.3%
sqrt-div77.6%
metadata-eval77.6%
clear-num71.3%
associate-/r*28.6%
clear-num28.6%
associate-/l*77.7%
Applied egg-rr77.7%
un-div-inv78.0%
clear-num77.8%
*-commutative77.8%
sqrt-prod42.6%
sqrt-div14.6%
associate-/r/14.7%
sqrt-div33.4%
sqrt-undiv77.7%
Applied egg-rr77.7%
clear-num77.7%
associate-/r/77.7%
associate-/r/77.8%
*-commutative77.8%
Applied egg-rr77.8%
if 5.0000000000022e-312 < (*.f64 V l) < 1.00000000000000008e284Initial program 79.4%
*-commutative79.4%
sqrt-div99.3%
associate-*l/97.6%
Applied egg-rr97.6%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 49.0%
associate-/r*88.8%
clear-num87.1%
sqrt-div87.1%
metadata-eval87.1%
clear-num87.1%
associate-/r*49.0%
clear-num49.0%
associate-/l*87.1%
Applied egg-rr87.1%
un-div-inv87.3%
*-commutative87.3%
sqrt-prod52.1%
sqrt-div55.8%
associate-/r/55.8%
sqrt-div56.0%
sqrt-undiv87.3%
Applied egg-rr87.3%
associate-/r/87.3%
*-commutative87.3%
Simplified87.3%
clear-num87.2%
div-inv87.3%
Applied egg-rr87.3%
clear-num87.3%
sqrt-div88.9%
metadata-eval88.9%
clear-num87.1%
associate-/r/87.1%
associate-*l/49.0%
clear-num49.0%
inv-pow49.0%
sqrt-pow249.0%
metadata-eval49.0%
Applied egg-rr49.0%
associate-/r*88.9%
Simplified88.9%
Final simplification75.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-272)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 1e+284)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (pow (/ (/ A V) l) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-272) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} else {
tmp = c0 / pow(((A / V) / l), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-272)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d-312) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 1d+284) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
else
tmp = c0 / (((a / v) / l) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-272) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 1e+284) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-272: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 1e+284: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.pow(((A / V) / l), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-272) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); else tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-272)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 1e+284)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
else
tmp = c0 / (((A / V) / l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-272], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-272}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999982e-272Initial program 76.7%
associate-/r*76.0%
sqrt-div53.4%
associate-*r/51.6%
Applied egg-rr51.6%
associate-/l*53.4%
Simplified53.4%
if -4.99999999999999982e-272 < (*.f64 V l) < 5.0000000000022e-312Initial program 36.5%
associate-/r*72.9%
clear-num72.8%
sqrt-div78.1%
metadata-eval78.1%
clear-num72.8%
associate-/r*36.5%
clear-num36.5%
associate-/l*78.2%
Applied egg-rr78.2%
un-div-inv78.4%
*-commutative78.4%
sqrt-prod39.1%
sqrt-div12.4%
associate-/r/12.4%
sqrt-div37.7%
sqrt-undiv78.3%
Applied egg-rr78.3%
clear-num73.0%
associate-/r/78.3%
clear-num78.3%
Applied egg-rr78.3%
if 5.0000000000022e-312 < (*.f64 V l) < 1.00000000000000008e284Initial program 79.4%
*-commutative79.4%
sqrt-div99.3%
associate-*l/97.6%
Applied egg-rr97.6%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 49.0%
associate-/r*88.8%
clear-num87.1%
sqrt-div87.1%
metadata-eval87.1%
clear-num87.1%
associate-/r*49.0%
clear-num49.0%
associate-/l*87.1%
Applied egg-rr87.1%
un-div-inv87.3%
*-commutative87.3%
sqrt-prod52.1%
sqrt-div55.8%
associate-/r/55.8%
sqrt-div56.0%
sqrt-undiv87.3%
Applied egg-rr87.3%
associate-/r/87.3%
*-commutative87.3%
Simplified87.3%
clear-num87.2%
div-inv87.3%
Applied egg-rr87.3%
clear-num87.3%
sqrt-div88.9%
metadata-eval88.9%
clear-num87.1%
associate-/r/87.1%
associate-*l/49.0%
clear-num49.0%
inv-pow49.0%
sqrt-pow249.0%
metadata-eval49.0%
Applied egg-rr49.0%
associate-/r*88.9%
Simplified88.9%
Final simplification75.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-272)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 5e+264)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(/ c0 (pow (/ (/ A V) l) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-272) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 5e+264) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 / pow(((A / V) / l), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-272)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d-312) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 5d+264) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 / (((a / v) / l) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-272) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 5e+264) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.pow(((A / V) / l), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-272: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 5e+264: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 / math.pow(((A / V) / l), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-272) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 5e+264) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 / (Float64(Float64(A / V) / l) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-272)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 5e+264)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 / (((A / V) / l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-272], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+264], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-272}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+264}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999982e-272Initial program 76.7%
associate-/r*76.0%
sqrt-div53.4%
associate-*r/51.6%
Applied egg-rr51.6%
associate-/l*53.4%
Simplified53.4%
if -4.99999999999999982e-272 < (*.f64 V l) < 5.0000000000022e-312Initial program 36.5%
associate-/r*72.9%
clear-num72.8%
sqrt-div78.1%
metadata-eval78.1%
clear-num72.8%
associate-/r*36.5%
clear-num36.5%
associate-/l*78.2%
Applied egg-rr78.2%
un-div-inv78.4%
*-commutative78.4%
sqrt-prod39.1%
sqrt-div12.4%
associate-/r/12.4%
sqrt-div37.7%
sqrt-undiv78.3%
Applied egg-rr78.3%
clear-num73.0%
associate-/r/78.3%
clear-num78.3%
Applied egg-rr78.3%
if 5.0000000000022e-312 < (*.f64 V l) < 5.00000000000000033e264Initial program 79.6%
sqrt-div99.3%
associate-*r/97.6%
Applied egg-rr97.6%
*-commutative97.6%
associate-/l*96.3%
Simplified96.3%
if 5.00000000000000033e264 < (*.f64 V l) Initial program 52.6%
associate-/r*86.9%
clear-num85.4%
sqrt-div85.5%
metadata-eval85.5%
clear-num85.4%
associate-/r*52.6%
clear-num52.6%
associate-/l*85.5%
Applied egg-rr85.5%
un-div-inv85.6%
*-commutative85.6%
sqrt-prod48.3%
sqrt-div51.5%
associate-/r/51.5%
sqrt-div51.7%
sqrt-undiv85.6%
Applied egg-rr85.6%
associate-/r/85.6%
*-commutative85.6%
Simplified85.6%
clear-num85.6%
div-inv85.6%
Applied egg-rr85.6%
clear-num85.7%
sqrt-div87.1%
metadata-eval87.1%
clear-num85.5%
associate-/r/85.5%
associate-*l/52.6%
clear-num52.6%
inv-pow52.6%
sqrt-pow252.6%
metadata-eval52.6%
Applied egg-rr52.6%
associate-/r*87.0%
Simplified87.0%
Final simplification75.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (/ c0 (sqrt (* V (/ l A)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-5d-310)) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 74.1%
associate-/r*82.1%
clear-num81.9%
sqrt-div84.2%
metadata-eval84.2%
clear-num81.9%
associate-/r*73.8%
clear-num74.6%
associate-/l*79.7%
Applied egg-rr79.7%
un-div-inv79.8%
*-commutative79.8%
sqrt-prod38.6%
sqrt-div0.0%
associate-/r/0.0%
sqrt-div0.0%
sqrt-undiv84.3%
Applied egg-rr84.3%
associate-/r/79.8%
*-commutative79.8%
Simplified79.8%
if -4.999999999999985e-310 < l Initial program 66.7%
associate-/r*70.6%
sqrt-div80.7%
associate-*r/77.6%
Applied egg-rr77.6%
associate-/l*80.7%
Simplified80.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 70.0%
herbie shell --seed 2024145
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))